#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
const int inf = 0x3fffffff;
const long long mod1 = 217636919;
const long long mod2 = 917120411;
int n, m;
string s1[2005], s2[205];
long long ha1s1[2005], ha1s2[205][2005];
long long ha2s1[2005], ha2s2[205][2005];
long long hash1(string s) {
  long long ret = 0;
  for (int i = 0; i < s.size(); i++) {
    ret = (ret * 26 + s[i] - '0') % mod1;
  }
  return ret;
}
long long hash2(string s) {
  long long ret = 0;
  for (int i = 0; i < s.size(); i++) {
    ret = (ret * 26 + s[i] - '0') % mod2;
  }
  return ret;
}
int ck(int x, int y) {
  for (int i = 0; i < m; i++) {
    if (ha1s1[x + i] != ha1s2[i + 1][y] || ha2s1[x + i] != ha2s2[i + 1][y])
      return 0;
  }
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) cin >> s1[i];
  for (int i = 1; i <= m; i++) cin >> s2[i];
  for (int i = 1; i <= n; i++) {
    ha1s1[i] = hash1(s1[i]);
    ha2s1[i] = hash2(s1[i]);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n - m + 1; j++) {
      ha1s2[i][j] = hash1(s2[i].substr(j - 1, m));
      ha2s2[i][j] = hash2(s2[i].substr(j - 1, m));
    }
  }
  for (int i = 1; i <= n - m + 1; i++) {
    for (int j = 1; j <= n - m + 1; j++) {
      if (ck(i, j)) {
        printf("%d %d\n", i, j);
        return 0;
      }
    }
  }
  return 0;
}
