import java.util.*;

// abstract checker

public class JohnChecker
{
	public static final int MINJTF = 1;
	public static final int MAXJTF = 1000;
	public static final int MINXY = -10000;
	public static final int MAXXY = 10000;

    public static void printError(int line, String msg)
	{
		System.out.println("ERROR Line " + line + ": " + msg);
		System.exit(-1);
	}

    public static void checkIntBounds(int x, int min, int max, String name, int nLines)
    {
        if (x < min || x > max)
            printError(nLines, "invalid " + name + " value: " + x);
    }

    public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);
		int n, m, p;
		String line;
		int nLines=0;

        line = in.nextLine();
        nLines++;
        StringTokenizer st = new StringTokenizer(line);
        if (st.countTokens() != 3)
            printError(nLines, "number of values on line incorrect");
        n = Integer.parseInt(st.nextToken());
        m = Integer.parseInt(st.nextToken());
        p = Integer.parseInt(st.nextToken());
        checkIntBounds(n, MINJTF, MAXJTF, "n", nLines);
        checkIntBounds(m, MINJTF, MAXJTF, "m", nLines);
        checkIntBounds(p, MINJTF, MAXJTF, "p", nLines);

        for(int i=0; i<n+m+p; i++) {
            line = in.nextLine();
            nLines++;
            st = new StringTokenizer(line);
            if (st.countTokens() != 2)
                printError(nLines, "number of values on line incorrect");
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            checkIntBounds(x, MINXY, MAXXY, "x", nLines);
            checkIntBounds(y, MINXY, MAXXY, "y", nLines);
        }
		if (in.hasNextLine())
			printError(nLines, "incorrect number of lines");
        System.exit(42);
	}
}
