using System;
using System.Linq;

namespace _0524
{
    class Program
    {
        static void Main()
        {
            while (true)
            {
                int m = int.Parse(Console.ReadLine());
                if (m == 0)
                {
                    break;
                }
                int[] seizax = new int[m];
                int[] seizay = new int[m];
                for (int i = 0; i < m; i++)
                {
                    string[] x = Console.ReadLine().Split();
                    seizax[i] = int.Parse(x[0]);
                    seizay[i] = int.Parse(x[1]);
                }
                int n = int.Parse(Console.ReadLine());
                int[] sagasux = new int[n];
                int[] sagasuy = new int[n];
                for (int i = 0; i < n; i++)
                {
                    string[] x = Console.ReadLine().Split();
                    sagasux[i] = int.Parse(x[0]);
                    sagasuy[i] = int.Parse(x[1]);
                }
                bool b = true;
                for (int i = 0; i < m && b; i++)
                {
                    for (int j = 0; j < n && b; j++)
                    {
                        int x = sagasux[j] - seizax[i];
                        int y = sagasuy[j] - seizay[i];
                        bool now = true;
                        for (int k = 0; k < m && now; k++)
                        {
                            if (!(sagasux.Contains(seizax[k] + x) && sagasuy.Contains(seizay[k] + y)))
                            {
                                now = false;
                            }
                        }
                        if (now)
                        {
                            b = false;
                            Console.WriteLine(x + " " + y);
                        }
                    }
                }
            }
        }
    }
}