#include <bits/stdc++.h>
using namespace std;
const int MAX_ROW = 2000 + 7;
const int MAX_COLUMN = 200 + 7;
const int BASE = 2807;
const int MOD = 1e7 + 7;
int n, m;
char TableA[MAX_ROW][MAX_COLUMN], TableB[MAX_COLUMN][MAX_ROW];
int HashA[MAX_ROW][MAX_COLUMN], HashB[MAX_COLUMN][MAX_ROW], Pow2807[MAX_ROW],
    HashFinding[MOD];
int GetHash(const int& L, const int& R, const int H[]) {
  return (1LL * H[R] - 1LL * H[L - 1] * Pow2807[R - L + 1] + 1LL * MOD * MOD) %
         MOD;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0), cin.tie(0);
  Pow2807[0] = 1;
  for (int i = 1; i < MAX_ROW; ++i)
    Pow2807[i] = 1LL * Pow2807[i - 1] * BASE % MOD;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", TableA[i] + 1);
  for (int j = 1; j <= m; ++j) scanf("%s", TableB[j] + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      HashA[i][j] = (1LL * HashA[i][j - 1] * BASE + TableA[i][j]) % MOD;
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j)
      HashB[i][j] = (1LL * HashB[i][j - 1] * BASE + TableB[i][j]) % MOD;
  for (int j = 1; j <= (n - m + 1); ++j) {
    int HashBase = 0;
    for (int k = j; k <= (j + m - 1); ++k)
      HashBase = (1LL * HashBase * Pow2807[m] + GetHash(1, m, HashA[k])) % MOD;
    HashFinding[HashBase] = j;
  }
  for (int j = 1; j <= (n - m + 1); ++j) {
    int HashTest = 0;
    for (int i = 1; i <= m; ++i)
      HashTest =
          (1LL * HashTest * Pow2807[m] + GetHash(j, j + m - 1, HashB[i])) % MOD;
    if (HashFinding[HashTest]) {
      cout << HashFinding[HashTest] << " " << j << "\n";
      return 0;
    }
  }
  cout << "Error 404!\n";
  return 0;
}
