import Control.Monad (replicateM)
import qualified Data.Set as Set

type Stars = Set.Set (Int,Int)
type Constel = [(Int,Int)]

main = do
    m <- readLn
    if m == 0 then return () else do
        c <- replicateM m (getLine >>= return . coord . map read . words)
        n <- readLn
        ss <- (replicateM n (getLine >>= return . coord . map read . words))
            >>= (return . foldr Set.insert Set.empty)
        let
            (dx,dy) = solve ss c
        putStrLn $ unwords $ map show [dx,dy]
        main

    where
    coord [x,y] = (x,y)

solve :: Stars -> Constel -> (Int,Int)
solve ss c = head $ filter match $ map (</> (head c)) $ Set.elems ss
    where
    match d = all (`Set.member` ss) (map (<+> d) c)

(<+>) :: (Int,Int) -> (Int,Int) -> (Int,Int)
(a,b) <+> (c,d) = (a+c,b+d)

(</>) :: (Int,Int) -> (Int,Int) -> (Int,Int)
(a,b) </> (c,d) = (a-c,b-d)