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) }
h.times{|i|
  0.upto(w-c){|j|
    hash[i][hw[i][j,c]][j] = 1
  }
}

#p "hash done"

0.upto(h-r){|i|
  if hash[i][rc[0]]
    # find candidate
    hash[i][rc[0]].each_key{|j|
      ans = true
      1.upto(r-1){|k|
        unless hash[i+k][rc[k]][j] == 1
          ans = false
          break
        end
      }
      puts "#{i} #{j}" if ans
    }
  end
}