import scala.io.StdIn.readLine
import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args:Array[String]) = {
    val hw = readLine.split(" ").map(_.toInt)
    val fld = (for(i<-0 until hw(0)) yield {
      readLine.trim.map(_.asDigit)
    }).toArray
    val rc = readLine.split(" ").map(_.toInt)
    val pattern = (for(i<-0 until rc(0)) yield {
      readLine.trim.map(_.asDigit)
    }).toArray
    val b = new ArrayBuffer[Array[Int]]

    for(i<-0 to (hw(0)-rc(0))) {
      for(j<-0 to (hw(1)-rc(1))) {
        var m = true
        var k = 0
        var l = 0
        while(m && k<rc(0)) {
          if(fld(i+k)(j+l) != pattern(k)(l)) m = false
          if(l==rc(1)-1) { k+=1;l=0 }
          else l += 1
        }
        if(m) b+= Array(i,j)
      }
    }
    if(b.length>0)
      println{
        b.sortWith((x,y)=>if(x(0)<y(0)) true else if(x(0)==y(0) && x(1)<y(1)) true else false)
          .map(_.mkString(" ")).mkString("\n")
      }
  }
}