#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1061109567;
const ll INF = 4557430888798830399;
const int MOD = 1e9 + 7;
const int p = 131;
const int q = 113;
int n, m;
char a[2005][205];
char b[205][2005];
int hashp[205];
int hashq[2005];
int s[2005][2005];
int t[2005][2005];
int get(int u, int v, int x, int y, int c[2005][2005]) {
  int res = (c[x][y] + (ll)c[u - 1][v - 1] * hashp[x - u + 1] % MOD *
                           hashq[y - v + 1] % MOD) %
            MOD;
  res = (res - (ll)c[x][v - 1] * hashq[y - v + 1] % MOD + MOD) % MOD;
  res = (res - (ll)c[u - 1][y] * hashp[x - u + 1] % MOD + MOD) % MOD;
  return res;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  if (fopen(""
            ".in",
            "r")) {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> a[i][j];
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j) cin >> b[i][j];
  hashq[0] = hashp[0] = 1;
  for (int i = 1; i <= m; ++i) hashp[i] = (ll)hashp[i - 1] * p % MOD;
  for (int i = 1; i <= n; ++i) hashq[i] = (ll)hashq[i - 1] * q % MOD;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      s[i][j] = a[i][j];
      (s[i][j] += (ll)s[i - 1][j] * p % MOD) %= MOD;
      (s[i][j] += (ll)s[i][j - 1] * q % MOD) %= MOD;
      s[i][j] = (s[i][j] - (ll)s[i - 1][j - 1] * p % MOD * q % MOD + MOD) % MOD;
    }
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j) {
      t[i][j] = b[i][j];
      (t[i][j] += (ll)t[i - 1][j] * p % MOD) %= MOD;
      (t[i][j] += (ll)t[i][j - 1] * q % MOD) %= MOD;
      t[i][j] = (t[i][j] - (ll)t[i - 1][j - 1] * p % MOD * q % MOD + MOD) % MOD;
    }
  for (int i = 1; i <= n - m + 1; ++i) {
    int cur = get(1, i, m, i + m - 1, t);
    for (int j = 1; j <= n - m + 1; ++j) {
      int tmp = get(j, 1, j + m - 1, m, s);
      if (cur == tmp) {
        cout << j << " " << i << "\n";
        return 0;
      }
    }
  }
  return 0;
}
