/*
 * c.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 1000;

typedef long long ll;

const ll BS0 = 2549;
const ll BS1 = 4283;
const ll MOD = 1000000007;

/* typedef */

/* global variables */

string s[MAX_N], p[MAX_N];
ll es0[MAX_N + 1], es1[MAX_N + 1];
ll shs[MAX_N + 1][MAX_N + 1], phs[MAX_N + 1][MAX_N + 1];

/* subroutines */

void makehash(int h, int w, ll hs[MAX_N + 1][MAX_N + 1], string s[]) {
  for (int y = 0; y < h; y++)
    for (int x = 0; x < w; x++)
      hs[y + 1][x + 1] =
	(es0[y] * es1[x] % MOD * s[y][x] % MOD +
	 hs[y][x + 1] + hs[y + 1][x] - hs[y][x] + MOD) % MOD;
}

/* main */

int main() {
  es0[0] = es1[0] = 1;
  for (int i = 1; i <= MAX_N; i++) {
    es0[i] = (es0[i - 1] * BS0) % MOD;
    es1[i] = (es1[i - 1] * BS1) % MOD;
  }

  int h, w;
  cin >> h >> w;
  for (int y = 0; y < h; y++) cin >> s[y];

  int r, c;
  cin >> r >> c;
  for (int y = 0; y < r; y++) cin >> p[y];

  makehash(h, w, shs, s);
  makehash(r, c, phs, p);

  for (int y = 0; y <= h - r; y++)
    for (int x = 0; x <= w - c; x++) {
      ll sh =
	(shs[y + r][x + c] + shs[y][x]
	 - shs[y][x + c] + MOD - shs[y + r][x] + MOD) % MOD;
      ll ph = phs[r][c] * es0[y] % MOD * es1[x] % MOD;
      if (sh == ph) printf("%d %d\n", y, x);
    }
  return 0;
}