#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000;
const int MAXM = 200;
const int B = 31;
char mat[MAXM + 1][MAXN + 1];
string str;
unsigned long long hsh2[MAXM + 1][MAXN + 1];
unsigned long long hsh1[MAXN + 1];
map<unsigned long long, int> mp;
int main() {
  int i, j, n, m;
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> str;
    unsigned long long val = 0;
    for (auto it : str) {
      val = val * B + it - 'a' + 1;
    }
    hsh1[i] = val;
  }
  for (i = 1; i <= m; i++) {
    cin >> (mat[i] + 1);
  }
  unsigned long long pw = 1;
  for (i = 1; i < m; i++) {
    pw *= B;
  }
  for (i = 1; i <= m; i++) {
    unsigned long long val = 0;
    for (j = 1; j <= n; j++) {
      val = val * B + mat[i][j] - 'a' + 1;
      if (j >= m) {
        hsh2[i][j] = val;
        val -= pw * (mat[i][j - m + 1] - 'a' + 1);
      }
    }
  }
  for (i = 1; i + m <= n + 1; i++) {
    unsigned long long val = 0;
    for (j = i; j < i + m; j++) {
      val = val * pw + hsh1[j];
    }
    mp[val] = i;
  }
  for (i = 1; i + m <= n + 1; i++) {
    unsigned long long val = 0;
    for (j = 1; j <= m; j++) {
      val = val * pw + hsh2[j][i + m - 1];
    }
    if (mp[val] > 0) {
      cout << mp[val] << " " << i;
      return 0;
    }
  }
  return 0;
}
