import java.math.BigInteger;
import java.util.HashSet;

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

public class Check implements Checker {
    @Override
    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        try {
        int n = inf.nextInt();
        String a[] = new String[n];
        for (int i = 0; i < n; i++) {
            a[i] = inf.nextToken();
        }
        String pAns = ouf.nextToken();
        String jAns = ans.nextToken();
        if (pAns.equals("Impossible") && !jAns.equals("Impossible"))
            return new Outcome(Type.WA, "Parti");
        if (pAns.equals("Impossible") && jAns.equals("Impossible"))
            return new Outcome(Type.OK, "OK. Impossible.");
        int k = Integer.parseInt(pAns);
        if (k < 1 || k >= n)
            return new Outcome(Type.WA, "");
        HashSet<Integer> hs = new HashSet<Integer>();
        for (int i = 0; i < k; i++) {
            int tmp = ouf.nextInt();
            if (tmp < 1 || tmp > n)
                return new Outcome(Type.WA, "Incorrect index");
            if (hs.contains(tmp))
                return new Outcome(Type.WA, "Dublicate index");
            hs.add(tmp);
        }
        BigInteger val1 = BigInteger.ONE;
        BigInteger val2 = BigInteger.ONE;
        boolean used1 = false, used2 = false;
        for (int i = 0; i < n; i++) {
            if (hs.contains(i + 1)) {
                val1 = val1.multiply(new BigInteger(a[i]));
                used1 = true;
            } else {
                val2 = val2.multiply(new BigInteger(a[i]));
                used2 = true;
            }
        }
        if (val2.compareTo(val1) >= 0 || !used1 || !used2)
            return new Outcome(Type.WA, "Incorrect set of indexes");
        if (jAns.equals("Impossible"))
            return new Outcome(Type.FAIL, "FAIL");
        else
            return new Outcome(Type.OK, "OK!");
        } catch (Throwable e) {
            return new Outcome(Type.PE, "Something went wrong!");
        }
    }
}
