#include <bits/stdc++.h>
using namespace std;
const int p1 = 233, p2 = 433;
long long a[2020][3], b[2020][3];
int nxt[2020];
char aa[2020][2020], bb[2020][2020];
long long hs[2020][3], hs2[2020][3];
map<pair<long long, long long>, int> vis;
int main() {
  int ans, n, m, i, j, k;
  long long sum1, sum2, tmp1, tmp2;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%s", aa[i] + 1);
  }
  for (i = 1; i <= m; i++) {
    scanf("%s", bb[i] + 1);
  }
  tmp1 = 1;
  for (i = 1; i <= m; i++) tmp1 = tmp1 * p1;
  tmp2 = 1;
  for (i = 1; i <= m; i++) tmp2 = tmp2 * p2;
  for (i = 1; i <= n; i++) {
    sum1 = 0, sum2 = 0;
    for (j = 1; j <= m; j++) {
      sum1 = sum1 * p1 + aa[i][j] - 'a' + 1;
      sum2 = sum2 * p2 + aa[i][j] - 'a' + 1;
    }
    hs[i][1] = sum1;
    hs[i][2] = sum2;
  }
  for (i = 1; i <= n - m + 1; i++) {
    sum1 = 0, sum2 = 0;
    for (j = 1; j <= m; j++) {
      sum1 = sum1 * tmp1 + hs[i + j - 1][1];
      sum2 = sum2 * tmp2 + hs[i + j - 1][2];
    }
    vis[make_pair(sum1, sum2)] = i;
  }
  for (i = 1; i <= n; i++) {
    sum1 = 0, sum2 = 0;
    for (j = 1; j <= m; j++) {
      sum1 = sum1 * tmp1 + bb[j][i] - 'a' + 1;
      sum2 = sum2 * tmp2 + bb[j][i] - 'a' + 1;
    }
    hs2[i][1] = sum1;
    hs2[i][2] = sum2;
  }
  for (i = 1; i <= n - m + 1; i++) {
    sum1 = 0, sum2 = 0;
    for (j = 1; j <= m; j++) {
      sum1 = sum1 * p1 + hs2[i + j - 1][1];
      sum2 = sum2 * p2 + hs2[i + j - 1][2];
    }
    if (vis.count(make_pair(sum1, sum2))) {
      printf("%d %d\n", vis[make_pair(sum1, sum2)], i);
      return 0;
    }
  }
  return 0;
}
