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) }

if r < c then
  min_val = rc_hash.values.min
  min_key = rc_hash.key(min_val)
  idx = rc.index(min_key)
  # p rc_hash
  # p min_val
  # p min_key
  # p idx

  key = rc[idx]
  h.times{|i|
    0.upto(w-c){|j|
      hash[hw[i][j,c]][i][j] = 1
    }
  }
  if hash[key] then
    hash[key].each_key{|i|
      next if i - idx < 0 || i - idx + r > h
      hash[key][i].each_key{|j|
        #      p "can: #{i} #{j}"
        ans = true
        0.upto(r-1){|k|
          # p "k: #{h} #{i-idx+k}"
          #         p "k: #{k} #{hw[i-idx+k][j,c]}"
          unless hw[i-idx+k][j,c] == rc[k] then
            ans = false
            break
          end
        }
        puts "#{i-idx} #{j}" if ans
      }
    }
  end
 else
   #transpose mode
  mat = Array.new(w){Array.new(h)}
  h.times{|i|
    tmp = hw[i].split("")
    tmp.size.times{|j|
      mat[j][i] = tmp[j]
    }
  }
  wh = []
  w.times{|j|
    wh[j] = mat[j].join
  }
#  p wh
  mat = Array.new(c){Array.new(r)}
  r.times{|i|
    tmp = rc[i].split("")
    tmp.size.times{|j|
      mat[j][i] = tmp[j]
    }
  }
  cr_hash = {}
  cr = []
  c.times{|j|
    cr[j] = mat[j].join
    cr_hash[cr[j]] = 0 unless cr_hash[cr[j]]
    cr_hash[cr[j]] += 1
  }
  min_val = cr_hash.values.min
  min_key = cr_hash.key(min_val)
  idx = cr.index(min_key)
  key = cr[idx]
  0.upto(h-r){|i|
    w.times{|j|
      hash[wh[j][i,r]][i][j] = 1
    }
  }
#  p idx
  if hash[key] then
    hash[key].each_key{|i|
      hash[key][i].each_key{|j|
        next if j-idx < 0 || j-idx+c > w
#        p "can: #{i} #{j}"
        ans = true
        0.upto(c-1){|k|
          # p "k: #{h} #{i-idx+k}"
#          p "k: #{k} #{wh[j-idx+k][i,r]}  #{cr[k]}"
          unless wh[j-idx+k][i,r] == cr[k] then
            ans = false
            break
          end
        }
        puts "#{i} #{j-idx}" if ans
      }
    }
  end
  
end