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

typedef long long LL;

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

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){
	vector<bool> t;
	for(int i = 0; i < n; i++)
		t.push_back(side(i, x, y));
	st.insert(t);
}

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, vector<bool> & r){
	r.clear();
	for(int i = 0; i < n; i++){
		if(i == id1)
			r.push_back(bool(k & 1));
		else if(i == id2)
			r.push_back(bool(k >> 1));
		else
			r.push_back(side(i, X, Y));
	}
}

void cross2(int id, vector<bool> &r){
	r.clear();
	for(int i = 0; i < n; i++){
		if(i == id){
			r.push_back(0);
		}
		else{
			r.push_back(side(i, X, Y));
		}
	}
}

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();
		for(int i = 0; i < m; i++){
			int a, b;
			scanf("%d %d", &a, &b);
			add(a, b);
		}
		bool ans = true;
		vector<bool> tmp;


		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);
					if(st.count(tmp) == 0){
						ans = false; break;
					}
				if(!ans) break;
			}
			if(!flag){
				if(b[i] == 0){
					X = double(-c[i])/double(a[i]); Y = 0;
					cross2(i, tmp);


					if(st.count(tmp) == 0) ans = false;
					tmp[i] = 1;
					if(st.count(tmp) == 0) ans = false;
				}
				else{
					X = 0; Y = double(-c[i])/double(b[i]);
					cross2(i, tmp);
					if(st.count(tmp) == 0) ans = false;
					tmp[i] = 1;
					if(st.count(tmp) == 0) ans = false;
				}
			}
			if(!ans) break;
		}
		if(ans) puts("PROTECTED");
		else puts("VULNERABLE");
	}
	return 0;
}
