import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { FastScanner sc = new FastScanner(); int W = sc.nextInt(); int H = sc.nextInt(); int N = sc.nextInt(); int[] S = new int[N]; int[] K = new int[N]; boolean[] chW = new boolean[W]; boolean[] chH = new boolean[H]; for (int i=0; i