#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> A(n), B(m);
  for (auto& s : A) cin >> s;
  for (auto& s : B) cin >> s;
  vector<vector<long long>> ah(n, vector<long long>(m)),
      bh(m, vector<long long>(n));
  vector<long long> p(n + 2);
  long long ha = 911382323, hb = 972663749;
  p[0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    p[i] = (p[i - 1] * ha) % hb;
  }
  for (int i = 0; i < n; i++) {
    ah[i][0] = A[i][0];
    for (int j = 1; j < m; j++) {
      ah[i][j] = (ah[i][j - 1] * ha + A[i][j]) % hb;
    }
  }
  for (int i = 0; i < m; i++) {
    bh[i][0] = B[i][0];
    for (int j = 1; j < n; j++) {
      bh[i][j] = (bh[i][j - 1] * ha + B[i][j]) % hb;
    }
  }
  for (int i = 0; i + m <= n; i++) {
    for (int j = 0; j + m <= n; j++) {
      bool works = true;
      for (int k = 0; k < m && works; k++) {
        long long h1 = ah[i + k][m - 1];
        long long h2 = (bh[k][j + m - 1] - (j ? bh[k][j - 1] * p[m] : 0)) % hb;
        if (h2 < 0) h2 += hb;
        works = works && (h1 == h2);
      }
      if (works) {
        cout << i + 1 << " " << j + 1;
        return 0;
      }
    }
  }
  return 0;
}
