while True:

    try:

        dax,bx = [],[]

        m = int(input())

        a = sorted([list(map(int, input().split())) for i in range(m)])

        for i in range(m):

            dax.append(a[i][0]-a[0][0])

        n = int(input())

        b = sorted([list(map(int, input().split())) for i in range(n)])

        for i in b:

            bx.append(i[0])

        for i in range(n-m+1):

            for j in range(m):

                if bx.count(bx[i]+dax[j]) == 0:

                    break

            else:

                print(b[i][0]-a[0][0],b[i][1]-a[0][1])

                break

    except:

        break
while True:

    try:

        m = int(input())

        a = sorted([list(map(int, input().split())) for i in range(m)])

        dax = [a[i][0]-a[0][0] for i in range(m)]

        n = int(input())

        b = sorted([list(map(int, input().split())) for i in range(n)])

        bx = [b[i][0] for i in range(n)]

        for i in range(n-m+1):

            for j in range(m):

                if bx[i]+dax[j] not in bx:

                    break

            else:

                print(b[i][0]-a[0][0],b[i][1]-a[0][1])

                break

    except:

        break
while True:
    try:
        dax, bx = [], []
        m = int(input())
        a = sorted([list(map(int, input().split())) for i in range(m)])
        for i in range(m):
            dax.append(a[i][0] - a[0][0])
        n = int(input())
        b = sorted([list(map(int, input().split())) for i in range(n)])
        for i in b:
            bx.append(i[0])
        for i in range(n - m + 1):
            for j in range(m):
                if bx.count(bx[i] + dax[j]) == 0:
                    break
            else:
                print(b[i][0] - a[0][0], b[i][1] - a[0][1])
                break
    except:
        break

while True:
    try:
        m = int(input())
        a = sorted([list(map(int, input().split())) for i in range(m)])
        dax = [a[i][0] - a[0][0] for i in range(m)]
        n = int(input())
        b = sorted([list(map(int, input().split())) for i in range(n)])
        bx = [b[i][0] for i in range(n)]
        for i in range(n - m + 1):
            for j in range(m):
                if bx[i] + dax[j] not in bx:
                    break
            else:
                print(b[i][0] - a[0][0], b[i][1] - a[0][1])
                break
    except:
        break

-        dax, bx = [], [] -        for i in range(m): -            dax.append(a[i][0] - a[0][0]) +        dax = [a[i][0] - a[0][0] for i in range(m)] -        for i in b: -            bx.append(i[0]) +        bx = [b[i][0] for i in range(n)] -                if bx.count(bx[i] + dax[j]) == 0: +                if bx[i] + dax[j] not in bx: