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

exit if r > h || c > w

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

min_val = rc_hash.values.min
min_key = rc_hash.key(min_val)
idx = rc.index(min_key)

key = rc[idx]
0.upto(h-r){|i|
  0.upto(w-c){|j|
    hash[hw[i][j,c]][i][j] = 1
  }
}
if hash[key] then
  hash[key].each_key{|i|
    hash[key][i].each_key{|j|
      ans = true
      0.upto(r-1){|k|
        unless hw[i-idx+k][j,c] == rc[k] then
          ans = false
          break
        end
      }
      puts "#{i-idx} #{j}" if ans
    }
  }
end