#include <bits/stdc++.h>
using namespace std;
unsigned long long val(char x) { return x - 'a' + 1; }
unsigned long long _hash(string &str) {
  unsigned long long res = val(str[0]);
  for (int i = 1; i < ((int)(str).size()); ++i) res = res * 29 + val(str[i]);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<char>> A(n, vector<char>(m)), B(m, vector<char>(n));
  for (auto &r : A)
    for (char &c : r) cin >> c;
  for (auto &r : B)
    for (char &c : r) cin >> c;
  map<unsigned long long, int> hsh;
  for (int i = 0; i + m <= n; ++i) {
    string tmp = "";
    for (int j = i; j < i + m; ++j)
      for (int k = 0; k < m; ++k) tmp += A[j][k];
    unsigned long long tem;
    hsh[tem = _hash(tmp)] = i;
  }
  for (int i = 0; i + m <= n; ++i) {
    string tmp = "";
    for (int k = 0; k < m; ++k)
      for (int j = i; j < i + m; ++j) tmp += B[k][j];
    unsigned long long tem = _hash(tmp);
    if (hsh.count(tem)) {
      cout << hsh[tem] + 1 << ' ' << i + 1 << endl;
      return 0;
    }
  }
  return 0;
}
