def extract_arguments(fh):
    datasets = []
    while True:
        m = int(fh.readline().strip())
        if m == 0:
            break
        constellation = [tuple(map(int, fh.readline().strip().split())) for _ in range(m)]
        n = int(fh.readline().strip())
        photo = [tuple(map(int, fh.readline().strip().split())) for _ in range(n)]
        datasets.append((m, constellation, n, photo))
    return datasets