#include <bits/stdc++.h>
using namespace std;
char s1[2005][205], s2[205][2005];
long long ha1[2005], ha2[2005], q1 = 19240817, q2 = 1000000007, q1m = 1,
                                q2m = 1, tmp1, tmp2;
map<long long, int> mp;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s1 + i);
    for (int j = m - 1; j >= 0; j--) {
      ha1[i] = ha1[i] * q1 + s1[i][j];
    }
    ha1[i] *= q1;
  }
  for (int i = n - m; i < n; i++) {
    q2m *= q2;
    tmp1 += ha1[i] * q2m;
  }
  mp[tmp1] = n - m + 1;
  ;
  for (int i = n - m - 1; i >= 0; i--) {
    tmp1 -= ha1[i + m] * q2m;
    (tmp1 += ha1[i]) *= q2;
    mp[tmp1] = i + 1;
  }
  for (int i = 0; i < m; i++) scanf("%s", s2 + i);
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      ha2[i] = ha2[i] * q2 + s2[j][i];
    }
    ha2[i] *= q2;
  }
  for (int i = n - m; i < n; i++) {
    q1m *= q1;
    tmp2 += ha2[i] * q1m;
  }
  if (mp.find(tmp2) != mp.end()) {
    printf("%d %d\n", mp[tmp2], n - m + 1);
    return 0;
  }
  for (int i = n - m - 1; i >= 0; i--) {
    tmp2 -= ha2[i + m] * q1m;
    (tmp2 += ha2[i]) *= q1;
    if (mp.find(tmp2) != mp.end()) {
      printf("%d %d\n", mp[tmp2], i + 1);
      return 0;
    }
  }
  return 0;
}
