/**
 * Created by Odeen on 19.09.2014.
 */
import java.util.ArrayList;
import java.util.Arrays;

import java.util.List;

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

public class Check implements Checker {

    private static class Pair<T> {
        T x, y;
        Pair() {
            x = null;
            y = null;
        }
        Pair(T x, T y) {
            this.x = x;
            this.y = y;
        }
    }

    private static class Point extends Pair<Integer> {
        Point(Integer x, Integer y) {
            super(x, y);
        }
    }

    private static class Segment extends Pair<Point> {
        Segment(Point x, Point y) {
            super(x, y);
        }
    }

    private	ArrayList<Segment> segs = new ArrayList<Segment>();
    static Long area(Point a, Point b, Point c) {
        return ((long)(b.x - a.x)) * (c.y - a.y) - ((long)(b.y - a.y)) * (c.x - a.x);
    }
    static boolean intersect_1 (int a, int b, int c, int d) {
        if (a > b)  {int t = a; a = b; b = t;}
        if (c > d)  {int t = c; c = d; d = t;}
        return Math.max(a,c) <= Math.min(b,d);
    }
    static int normalize(long x) {
        if (x < 0)
            return -1;
        if (x == 0)
            return 0;
        return 1;
    }

    private static boolean intersect(Segment _a, Segment _b) {
        Point a = _a.x;
        Point b = _a.y;
        Point c = _b.x;
        Point d = _b.y;
        int cp1 = normalize(area(a,b,c));
        int cp2 = normalize(area(a,b,d));
        int cp3 = normalize(area(c,d,a));
        int cp4 = normalize(area(c,d,b));
        return intersect_1 (a.x, b.x, c.x, d.x)
                && intersect_1 (a.y, b.y, c.y, d.y) &&
                cp1 * cp2 <= 0 &&
                cp3 * cp4 <= 0;
    }

    private boolean addSegment(Segment s) {
        for (int i = 0; i < segs.size(); i++) {
            if (intersect(s, segs.get(i)))
                return false;
        }
        segs.add(s);
        return true;
    }

    @Override
    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        int n = inf.nextInt();
        ArrayList<Point> points = new ArrayList<Point>();
        for (int i = 0; i < n; ++i) {
            int x = inf.nextInt();
            int y = inf.nextInt();
            points.add(new Point(x, y));
        }
        int[] cnt = new int[n];
        for (int i = 0; i < n; i++)
            cnt[i] = 0;
        int segsCnt = ouf.nextInt();
        if (segsCnt != n / 2) {
            return new Outcome(Type.WA, "few segments");
        }
        try {
            for (int i = 0; i < segsCnt; i++) {
                int a = ouf.nextInt() - 1;
                int b = ouf.nextInt() - 1;
                if (a < 0 || a >= n || b < 0 || b >= n)
                    return new Outcome(Type.PE, "Incorrect number of segment!");
                cnt[a]++;
                cnt[b]++;
                boolean result = addSegment(new Segment(points.get(a), points.get(b)));
                if (!result) {
                    return new Outcome(Type.WA, "intersect");
                }
            }
        } catch (Exception e) {
            return new Outcome(Type.WA, "bad answer");
        }
        for (int i = 0; i < n; ++i) {
            if (cnt[i] > 1) {
                return new Outcome(Type.WA, "bad answer");
            }
        }

        if (!ouf.seekEoF()) {
            return new Outcome(Type.PE, "Too much tokens in answer");
        }
        return new Outcome(Type.OK, "Ok");
    }
}
