#include <bits/stdc++.h>
using namespace std;
const int max1 = 2000 + 7, max2 = 200 + 7;
int n, m;
char s1[max1][max2], s2[max2][max1];
int t1[max1], t2[max2][max1];
map<string, int> mp;
int f[max2];
bool solve(int id) {
  f[0] = f[1] = f[2] = 1;
  for (int i = 2; i <= m; ++i) {
    int j = f[i];
    while (j > 1 && t2[i][id] != t2[j][id]) j = f[j];
    f[i + 1] = (t2[i][id] == t2[j][id] ? j + 1 : 1);
  }
  int j = 1;
  for (int i = 1; i <= n; ++i) {
    while (j > 1 && t2[j][id] != t1[i]) j = f[j];
    if (t2[j][id] == t1[i]) j++;
    if (j == m + 1) {
      cout << i - m + 1 << " " << id;
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s1[i] + 1);
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%s", s2[i] + 1);
  }
  int id = 1;
  for (int i = 1; i <= n; ++i) {
    string t;
    for (int k = 1; k <= m; ++k) {
      t.push_back(s1[i][k]);
    }
    if (mp[t])
      t1[i] = mp[t];
    else {
      mp[t] = id++;
      t1[i] = mp[t];
    }
  }
  for (int j = 1; j <= m; ++j) {
    for (int i = 1; i <= n; ++i) {
      if (i + m - 1 > n) break;
      string t;
      for (int k = 0; k < m; ++k) {
        t.push_back(s2[j][i + k]);
      }
      if (mp[t])
        t2[j][i] = mp[t];
      else {
        mp[t] = id++;
        t2[j][i] = mp[t];
      }
    }
  }
  for (int i = 1; i <= (n - m + 1); ++i) {
    if (solve(i)) {
      break;
    }
  }
  return 0;
}
