#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(228);
const int M = 1791791791;
const int B = 239;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> a(n), b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  map<int, int> ans;
  for (int i = 0; i + m - 1 < n; i++) {
    int kek = 0;
    for (int x = i; x <= i + m - 1; x++) {
      for (int y = 0; y < m; y++) {
        kek = (kek * (long long)B + a[x][y]) % M;
      }
    }
    ans[kek] = i;
  }
  for (int j = 0; j + m - 1 < n; j++) {
    int kek = 0;
    for (int x = 0; x < m; x++) {
      for (int y = j; y <= j + m - 1; y++) {
        kek = (kek * (long long)B + b[x][y]) % M;
      }
    }
    if (ans.count(kek)) {
      cout << ans[kek] + 1 << ' ' << j + 1 << '\n';
      return 0;
    }
  }
}
