#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const int M = 2010;
char s1[M][M], s2[M][M];
unsigned long long dp1[M][M], dp2[M][M], prime = 3797, F[M * M];
int n, m;
int main() {
  F[0] = 1;
  for (int i = 1; i < M * M; i++) F[i] = F[i - 1] * prime;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", s1[i]);
  for (int i = 0; i < m; i++) scanf("%s", s2[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      dp1[i + 1][j + 1] =
          dp1[i][j + 1] + dp1[i + 1][j] - dp1[i][j] + F[i * N + j] * s1[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      dp2[i + 1][j + 1] =
          dp2[i][j + 1] + dp2[i + 1][j] - dp2[i][j] + F[i * N + j] * s2[i][j];
    }
  }
  unordered_map<unsigned long long, int> mp;
  for (int i = m - 1; i < m; i++) {
    for (int j = m - 1; j < n; j++) {
      unsigned long long h1 = dp2[i + 1][j + 1] - dp2[i - m + 1][j + 1] -
                              dp2[i + 1][j - m + 1] + dp2[i - m + 1][j - m + 1];
      h1 = F[N * N - i * N - j] * h1;
      mp[h1] = j + 2;
    }
  }
  for (int i = m - 1; i < n; i++) {
    for (int j = m - 1; j < m; j++) {
      unsigned long long h1 = dp1[i + 1][j + 1] - dp1[i - m + 1][j + 1] -
                              dp1[i + 1][j - m + 1] + dp1[i - m + 1][j - m + 1];
      h1 = F[N * N - i * N - j] * h1;
      if (mp[h1]) {
        printf("%d %d\n", i - m + 2, mp[h1] - m);
        return 0;
      }
    }
  }
}
