#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
int m, n;
char s1[2010][210], s2[210][2010];
int phi[2010];
ull a[2010], b[210][2010], c[2010], deg[2010];
ull getHash(int i, int len) { return c[i + len] - c[i] * deg[len]; }
int kmp(int col) {
  int i, k;
  for (k = 0, i = 1; i <= n; ++i) {
    while (k && a[i] != b[k + 1][col]) k = phi[k];
    if (a[i] == b[k + 1][col]) ++k;
    if (k == m) return i - m + 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  int i, j, k, ret;
  cin >> n >> m;
  for (i = 0; i < n; ++i) cin >> s1[i];
  for (i = 0; i < m; ++i) cin >> s2[i];
  for (i = 0; i < n; ++i) {
    for (j = 0; j < m; ++j) {
      a[i + 1] = a[i + 1] * 239017 + s1[i][j];
    }
  }
  for (deg[0] = 1, i = 1; i < 2010; ++i) deg[i] = deg[i - 1] * 239017;
  for (i = 0; i < m; ++i) {
    for (j = 0; j < n; ++j) {
      c[j + 1] = c[j] * 239017 + s2[i][j];
    }
    for (j = 0; j + m - 1 < n; ++j) b[i + 1][j + 1] = getHash(j, m);
  }
  for (k = 0, i = 2; i <= n; ++i) {
    while (k && a[k + 1] != a[i]) k = phi[k];
    if (a[k + 1] == a[i]) ++k;
    phi[i] = k;
  }
  for (i = 1; i <= n - m + 1; ++i)
    if (ret = kmp(i)) {
      cout << ret << ' ' << i << '\n';
      return 0;
    }
  return 0;
}
