#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 + 5;
string s1[maxn], s2[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s1[i];
  for (int i = 0; i < m; i++) cin >> s2[i];
  for (int i = 0; i <= n - m; i++)
    for (int j = 0; j <= n - m; j++) {
      bool flag = true;
      for (int p = 0; p < m && flag; p++) {
        if (memcmp(&s1[i + p][0], &s2[p][j], m)) flag = false;
      }
      if (flag) {
        cout << i + 1 << " " << j + 1 << "\n";
        return 0;
      }
    }
  return 0;
}
