h, w = gets.split.map(&:to_i)
hw = {}
h.times{|i|
  hw[i] = gets.chomp
}
r, c = gets.split.map(&:to_i)
rc = []
r.times{|i|
  rc[i] = gets.chomp
}

exit if r > h || c > w

hash = Hash.new { |ha,k| ha[k] = Hash.new(&ha.default_proc) }

0.upto(w-c){|j|
#  p j
  str = []
  r.times{|i|
    if i == 0
      str = [hw[i][j,c]]
    else
      str.push(hw[i][j,c])
    end
  }
  (h-r).times{|i|
    hash[str.join][i][j] = 1
    str.shift()
    str.push(hw[i+r][j,c])
  }
  hash[str.join][h-r][j] = 1
}

it = rc.join
if hash[it] then
  hash[it].sort.each{|i, val|
    hash[it][i].sort.each{|j, v|
      puts "#{i} #{j}"
    }
  }
end