#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int a = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
  return a * f;
}
const int mod = 997;
const int N = 2e3 + 5;
const int inf = 0x3f3f3f3f;
int n, m, a[N], b[N][N];
char A[N][N], B[N][N];
signed main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", A[i] + 1);
    for (int j = 1; j <= m; ++j) a[i] = (a[i] + (A[i][j] - 97 + 1) * j) % mod;
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%s", B[i] + 1);
    for (int j = 1; j + m - 1 <= n; ++j) {
      int r = j + m - 1;
      for (int k = j, kk = 1; k <= r; ++k, ++kk)
        b[i][j] = (b[i][j] + (B[i][k] - 97 + 1) * kk) % mod;
    }
  }
  for (int q = 1; q + m - 1 <= n; ++q)
    for (int g = 1; g + m - 1 <= n; ++g) {
      bool flag = 1;
      int tmp = 0;
      for (int i = 1, j = q; i <= m; ++i, ++j)
        if (a[j] != b[i][g]) {
          flag = 0;
          break;
        }
      if (flag) {
        return printf("%d %d\n", q, g), 0;
      }
    }
  return 0;
}
