require 'matrix'
require 'set'
loop {
    m = gets.to_i
    break if m == 0
    target = (1..m).map { Vector[*gets.split.map(&:to_i)] }.sort_by{|v| v[0]}
    n = gets.to_i
    stars = Set[*(1..n).map { Vector[*gets.split.map(&:to_i)] }]
    stars.each{|s|
        diff = s - target[0]
        if target.all?{|c| stars.include?(c + diff)}
            puts diff.to_a.join(" ")
            break
        end
    }
}