def extract_arguments(fh):
    datasets = []
    while True:
        N = int(fh.readline().strip())
        if N == 0:
            break
        buildings = []
        for _ in range(N):
            x1, y1, x2, y2 = map(int, fh.readline().strip().split())
            buildings.append((x1, y1, x2, y2))
        Ax, Ay, Bx, By = map(int, fh.readline().strip().split())
        datasets.append((N, buildings, (Ax, Ay), (Bx, By)))
    return datasets