#include <bits/stdc++.h>
using namespace std;
template <class T>
void chkmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void chkmin(T &a, T b) {
  if (a > b) a = b;
}
const int inf = 0x3f3f3f3f;
const long long linf = 2e18 + 100;
const double eps = 1e-7;
char s[2005][205], t[205][2005];
int a[2005], pw[2005] = {1};
int b[205][2005];
int aa[2005], bb[2005];
const int mod = 1e9 + 9;
const int base = 31;
int n, m;
bool check(int r, int c) {
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++) {
      if (s[r + i][j] != t[i][c + j]) return 0;
    }
  }
  return 1;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i < 2005; i++) pw[i] = 1ll * pw[i - 1] * base % mod;
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < m; i++) scanf("%s", t[i]);
  for (int i = 0; i < n; i++) {
    a[i] = 0;
    for (int j = 0; j < m; j++)
      a[i] = (1ll * base * a[i] + s[i][j] - 'a') % mod;
  }
  for (int i = 0; i < m; i++) {
    b[i][0] = 0;
    for (int j = 0; j < m; j++)
      b[i][0] = (1ll * b[i][0] * base + t[i][j] - 'a') % mod;
    for (int j = 1; j <= n - m; j++) {
      b[i][j] =
          (((b[i][j - 1] - 1ll * pw[m - 1] * (t[i][j - 1] - 'a')) % mod + mod) *
               base +
           t[i][j + m - 1] - 'a') %
          mod;
    }
  }
  for (int i = 0; i <= n - m; i++) {
    aa[i] = 0;
    for (int j = 0; j < m; j++) {
      aa[i] = (1ll * aa[i] * pw[m] + a[i + j]) % mod;
    }
  }
  for (int j = 0; j <= n - m; j++) {
    bb[j] = 0;
    for (int i = 0; i < m; i++) {
      bb[j] = (1ll * bb[j] * pw[m] + b[i][j]) % mod;
    }
  }
  for (int i = 0; i <= n - m; i++) {
    for (int j = 0; j <= n - m; j++) {
      if (aa[i] == bb[j] && check(i, j)) {
        printf("%d %d\n", i + 1, j + 1);
        return 0;
      }
    }
  }
  return 0;
}
