#include <bits/stdc++.h>
using namespace std;
int n, m;
char m1[2333][2333], m2[2333][2333];
const long long B1 = 233, B2 = 233333333;
long long h[2333], r[2333][2333];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", m1[i] + 1);
    for (int j = 1; j <= m; ++j) h[i] = h[i] * B1 + m1[i][j];
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%s", m2[i] + 1);
    long long ts = 1, c = 0;
    for (int j = 1; j <= m; ++j) ts *= B1;
    for (int j = 1; j <= n; ++j) {
      c = c * B1 + m2[i][j];
      if (j > m) c -= ts * m2[i][j - m];
      r[i][j] = c;
    }
  }
  map<long long, int> sb;
  for (int i = 1; i + m - 1 <= n; ++i) {
    long long p = 0;
    for (int j = 0; j < m; ++j) p = p * B2 + h[i + j];
    sb[p] = i;
  }
  for (int i = m; i <= n; ++i) {
    long long p = 0;
    for (int j = 1; j <= m; ++j) p = p * B2 + r[j][i];
    if (sb[p]) {
      printf("%d %d\n", sb[p], i - m + 1);
      return 0;
    }
  }
}
