while True:

    try:

        a,da, b = [], [], []

        m = int(input())

        for i in range(m):

            a.append(list(map(int, input().split())))

        a = sorted(a)

        dax,day = [],[]

        for i in range(m):

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

            day.append(a[i][1]-a[0][1])

        n = int(input())

        for i in range(n):

            b.append(list(map(int, input().split())))

        b = sorted(b)

        bx,by = [],[]

        for i in b:

            bx.append(i[0])

            by.append(i[1])

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

            for j in range(m):

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

                    break

            else:

                print(bx[i]-a[0][0],by[i]-a[0][1])

                break

    except:

        break
while True:

    try:

        a,da, b = [], [], []

        m = int(input())

        for i in range(m):

            a.append(list(map(int, input().split())))

        a = sorted(a)

        dax = []

        for i in range(m):

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

        n = int(input())

        for i in range(n):

            b.append(list(map(int, input().split())))

        b = sorted(b)

        bx = []

        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:
        a, da, b = [], [], []
        m = int(input())
        for i in range(m):
            a.append(list(map(int, input().split())))
        a = sorted(a)
        dax, day = [], []
        for i in range(m):
            dax.append(a[i][0] - a[0][0])
            day.append(a[i][1] - a[0][1])
        n = int(input())
        for i in range(n):
            b.append(list(map(int, input().split())))
        b = sorted(b)
        bx, by = [], []
        for i in b:
            bx.append(i[0])
            by.append(i[1])
        for i in range(n - m + 1):
            for j in range(m):
                if bx.count(bx[i] + dax[j]) == 0 or by.count(by[i] + day[j]) == 0:
                    break
            else:
                print(bx[i] - a[0][0], by[i] - a[0][1])
                break
    except:
        break

while True:
    try:
        a, da, b = [], [], []
        m = int(input())
        for i in range(m):
            a.append(list(map(int, input().split())))
        a = sorted(a)
        dax = []
        for i in range(m):
            dax.append(a[i][0] - a[0][0])
        n = int(input())
        for i in range(n):
            b.append(list(map(int, input().split())))
        b = sorted(b)
        bx = []
        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

-        dax, day = [], [] +        dax = [] -            day.append(a[i][1] - a[0][1]) -        bx, by = [], [] +        bx = [] -            by.append(i[1]) -                if bx.count(bx[i] + dax[j]) == 0 or by.count(by[i] + day[j]) == 0: +                if bx.count(bx[i] + dax[j]) == 0: -                print(bx[i] - a[0][0], by[i] - a[0][1]) +                print(b[i][0] - a[0][0], b[i][1] - a[0][1])