#include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

typedef vector<long> lvector;
typedef vector<double> dvector;

enum Result {OK, WA, PE, JE, NUM};

const long MaxN = 1000, MaxR = 1000, MaxC = 1000;
const string err [NUM] = {"OK", "WA", "PE", "JE"};

void exitChecker (string msg, int code) {
	cerr << err[code] <<": " << msg << endl;
	exit (code);
}
template <typename T> void checkRange(T val, T lowVal, T hiVal, string msg, Result res) {
	if (val<lowVal||val>hiVal) exitChecker (msg,res);
}
void checkStream (ifstream &f, string msg, Result res) {
	if (!f) exitChecker(msg,res);
}

ifstream fi,fo;

long n;
lvector r;
dvector x,y;


const double eps = 1e-6;
const double ceps = eps*3.0;
const double cdist = (1e-2) - ceps;
const double md = 10000;

inline double dist(long i, long j) {
	return hypot(x[i]-x[j],y[i]-y[j]);
}

void check () {
	long i,j;

	for (i=0;i<n;i++) 
		if ( 
			x[i]-r[i] < -md-eps ||
			x[i]+r[i] > md+eps ||
			y[i]-r[i] < -md-eps ||
			y[i]+r[i] > md+eps
		) exitChecker ("Desk boudary crossed.", WA);

	for (i=0;i<n;i++)
		for (j=i+1;j<n;j++)
			if (dist(i,j)<cdist) 
				exitChecker("Too small distance between centers.", WA);

	for (i=0;i<n;i++)
		for (j=i+1;j<n;j++)
			if (dist(i,j)>r[i]+r[j]+ceps) 
				exitChecker("Two hollows doesn't intersect.", WA);

	exitChecker ("All OK!", OK);
}

int main (int argc, char **argv) {

	assert (argc >= 3);

	fi.open(argv[1]);
	fo.open(argv[2]);
	
	checkStream(fi, "No input file!", JE);
	checkStream(fo, "No output file!", PE);
	
	fi >> n;

	checkStream(fi, "Can't read n!", JE);
	checkRange(n,1l,MaxN,"Invalid n!", JE);

	for (long i=0;i<n;i++) {
		long rr,cc;
		fi >> rr >> cc;
		checkStream (fi, "Can't read next hollow!", JE);
		checkRange (rr,1l,MaxR,"Invalid radius!",JE);
		checkRange (cc,1l,MaxC,"Invalid cost!",JE);
		r.push_back(rr);
	}

	for (long i=0;i<n;i++) {
		double xx,yy;
		fo >> xx >> yy;
		x.push_back(xx);
		y.push_back(yy);
	}
	checkStream (fo, "Can't read hollows' coordinates!", PE);

	check();
	
	return 0;
}
