#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
const int oo = 1e9;
const int mod = 1e9 + 7;
string a[2001], b[201], f1[2001], f2[2001];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  for (int i = 0; i + m <= n; i++) {
    f1[i] = "";
    for (int j = 0; j < m; j++) f1[i] += a[i + j];
  }
  for (int i = 0; i + m <= n; i++) {
    f2[i] = "";
    for (int j = 0; j < m; j++) {
      f2[i] += b[j].substr(i, m);
    }
  }
  for (int i = 0; i + m <= n; i++) {
    for (int j = 0; j + m <= n; j++) {
      if (f1[i] == f2[j]) {
        cout << i + 1 << ' ' << j + 1 << endl;
        return 0;
      }
    }
  }
}
