#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, i, j, k, s;
  cin >> n >> m;
  vector<string> a(n), b(m);
  vector<vector<long long>> aa(n, vector<long long>(m));
  vector<vector<long long>> bb(m, vector<long long>(n));
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < m; i++) cin >> b[i];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      aa[i][j] = a[i][j] - 'a';
      bb[j][i] = b[j][i] - 'a';
    }
  }
  vector<long long> h(m * m);
  h[0] = 1;
  for (i = 1; i < m * m; i++) h[i] = (h[i - 1] * 37LL) % 1000000007LL;
  vector<long long> ha(n), hb(n);
  s = 0;
  for (i = 0; i < m - 1; i++) {
    for (j = 0; j < m; j++) {
      s = (s + aa[i][j] * h[(m * m - 1) - (i * m + j)]) % 1000000007LL;
    }
  }
  for (i = m - 1; i < n; i++) {
    for (j = 0; j < m; j++) s = (s + aa[i][j] * h[m - 1 - j]) % 1000000007LL;
    ha[i - (m - 1)] = s;
    for (j = 0; j < m; j++)
      s = (s - aa[i - (m - 1)][j] * h[(m - 1) * m + m - 1 - j] +
           1000000007LL * 1000000007LL) %
          1000000007LL;
    s = (s * h[m]) % 1000000007LL;
  }
  s = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < m - 1; j++) {
      s = (s + bb[i][j] * h[(m * m - 1) - (i * m + j)]) % 1000000007LL;
    }
  }
  for (i = m - 1; i < n; i++) {
    for (j = 0; j < m; j++)
      s = (s + bb[j][i] * h[m * (m - 1 - j)]) % 1000000007LL;
    hb[i - (m - 1)] = s;
    for (j = 0; j < m; j++)
      s = (s - bb[j][i - (m - 1)] * h[m * (m - 1 - j) + m - 1] +
           1000000007LL * 1000000007LL) %
          1000000007LL;
    s = (s * 37LL) % 1000000007LL;
  }
  for (i = 0; i <= n - m; i++) {
    for (j = 0; j <= n - m; j++)
      if (ha[i] == hb[j]) {
        cout << i + 1 << " " << j + 1 << "\n";
        goto done;
      }
  }
done:;
  return 0;
}
