#include <cstdio>
#include <set>
#include <vector>
#include <iostream>
#include <cassert>
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

const ULL mo = 55566677, mo2 = 234567, MO = 23456789, MO2 = 1000000007, mm = 4567;

int a[104], b[104], c[104];
double X, Y;
int n, m;
set<ULL> st, st2;

bool side(int id, double x, double y){
	double r = (double)a[id] * x + (double)b[id] * y + (double)c[id];
	if(r > 0) return true;
	return false;
}

void add(int x, int y){
	ULL t = 0, t2 = 0;
	for(int i = 0; i < n; i++){
		t *= mo; t2 *= MO;
		t += (side(i, x, y) + mm) * mo2;
		t2 += (side(i, x, y) + mm) * MO2;
		//t*=2; t+=side(i, x, y);
		//t2*=3; t2+=side(i, x, y);
	}
	st.insert(t);
	st2.insert(t2);
}

LL det(int a, int b, int c, int d){
	return (LL)a*d-(LL)b*c;
}

bool get(int i, int j, double &x, double &y){
	LL d=det(a[i],b[i],a[j],b[j]);
	if(d==0)return false;
	x=det(-c[i],b[i],-c[j],b[j])*1.0/d;
	y=det(a[i],-c[i],a[j],-c[j])*1.0/d;
	return true;
}

void cross(int id1, int id2, int k, ULL &r, ULL &r2){
	r = r2 = 0;
	ULL t;
	for(int i = 0; i < n; i++){
		r *= mo; r2 *= MO;
		if(i == id1)
			t = (k & 1);
		else if(i == id2)
			t = (k >> 1);
		else
			t = ULL(side(i, X, Y));
		//r*=2; r+=t;
		//r2*=3; r2+=t;
		r += (t + mm) * mo2;
		r2 += (t + mm) * MO2;
	}
}

void cross2(int id, int k, ULL &r, ULL &r2){
	r = r2 = 0;
	for(int i = 0; i < n; i++){
		r *= mo; r2 *= MO;
		ULL t;
		if(i == id){
			t = k;
		}
		else{
			t = ULL(side(i, X, Y));
		}
		//r*=2; r+=t;
		//r2*=3; r2+=t;
		r += (t + mm) * mo2;
		r2 += (t + mm) * MO2;
	}
}

int main(){
	int cs;
	scanf("%d", &cs);
	while(cs--){
		scanf("%d %d", &n, &m);
		for(int i = 0; i < n; i++){
			scanf("%d %d %d", a + i, b + i, c + i);
		}
		st.clear();
		st2.clear();
		for(int i = 0; i < m; i++){
			int a, b;
			scanf("%d %d", &a, &b);
			add(a, b);
		}
		bool ans = true;
		ULL tmp, tmp2;


		for(int i = 0; i < n; i++){

			bool flag = false;
			
			for(int j = i + 1; j < n; j++){
				if(get(i, j, X, Y) == false) continue;
				

				flag = true;
				for(int k = 0; k < 4; k++)
					cross(i, j, k, tmp, tmp2);
					if(st.count(tmp) == 0 && st2.count(tmp2) == 0){
						ans = false; break;
					}
			}
			if(!flag){
				if(b[i] == 0){
					X = double(-c[i])/double(a[i]); Y = 0;
					cross2(i, 0, tmp, tmp2);
					if(st.count(tmp) == 0 && st2.count(tmp2) == 0) ans = false;
					cross2(i, 1, tmp, tmp2);
					if(st.count(tmp) == 0 && st2.count(tmp2) == 0) ans = false;
				}
				else{
					X = 0; Y = double(-c[i])/double(b[i]);
					cross2(i, 0, tmp, tmp2);
					if(st.count(tmp) == 0 && st2.count(tmp2) == 0) ans = false;
					cross2(i, 1, tmp, tmp2);
					if(st.count(tmp) == 0 && st2.count(tmp2) == 0) ans = false;
				}
			}
			if(!ans) break;
		}
		if(ans) puts("PROTECTED");
		else puts("VULNERABLE");
	}
	return 0;
}
