import ru.ifmo.testlib.*;
import ru.ifmo.testlib.Outcome.Type;

public class Check implements Checker {
	static double EPS = 1e-4;

	class Point {
		double x, y;

		boolean isZero() {
			return Math.max(Math.abs(x), Math.abs(y)) < EPS;
		}

		public Point(double x, double y) {
			super();
			this.x = x;
			this.y = y;
		}
	}

	double distance(Point a, Point b) {
		return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
	}

	boolean equals(double x, double y) {
		return Math.abs(x - y) < EPS;
	}

	@Override
	public Outcome test(InStream inf, InStream ouf, InStream ans) {
		double square = inf.nextDouble();
		Point i1 = new Point(inf.nextDouble(), inf.nextDouble());
		Point i2 = new Point(inf.nextDouble(), inf.nextDouble());
		Point o1 = new Point(ouf.nextDouble(), ouf.nextDouble());
		Point o2 = new Point(ouf.nextDouble(), ouf.nextDouble());
		Point a1 = new Point(ans.nextDouble(), ans.nextDouble());
		Point a2 = new Point(ans.nextDouble(), ans.nextDouble());

		if (o1.isZero() && o2.isZero()) {
			if (a1.isZero() && a2.isZero()) {
				return new Outcome(Type.OK, "Answer doesn't exist");
			} else {
				return new Outcome(Type.WA, "Contestant hadn't found answer");
			}
		}
		if (!equals(distance(i1, o1), distance(i2, o2))) {
			return new Outcome(Type.WA, "Opposite sides aren't equals");
		}
		if (!equals(distance(i1, o2), distance(i2, o1))) {
			return new Outcome(Type.WA, "Opposite sides aren't equals");
		}
		if (!equals(distance(i1, i2), distance(o1, o2))) {
			return new Outcome(Type.WA, "Diagonals aren't equals");
		}
		if (!equals(square, distance(i1, o1) * distance(o1, i2))) {
			return new Outcome(Type.WA, "Square is wrong");
		}
		if (a1.isZero() && a2.isZero()) {
			return new Outcome(Type.FAIL, "Jury hadn't found answer");
		}
		return new Outcome(Type.OK, "Correct answer");
	}

}
