#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const long long mod = 1000000000039ll, base = 9971ll;
int n, m;
char a[N][205], b[205][N];
map<long long, int> f;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= m; i++) scanf("%s", b[i] + 1);
  for (int k = 1; k <= n - m + 1; k++) {
    long long res = 0;
    for (int i = k; i <= k + m - 1; i++)
      for (int j = 1; j <= m; j++)
        res = ((long long)res * base + (a[i][j] - 'a' + 1)) % mod;
    f[res] = k;
  }
  for (int k = 1; k <= n - m + 1; k++) {
    long long res = 0;
    for (int i = 1; i <= m; i++)
      for (int j = k; j <= k + m - 1; j++)
        res = ((long long)res * base + (b[i][j] - 'a' + 1)) % mod;
    if (f.count(res)) {
      printf("%d %d\n", f[res], k);
      return 0;
    }
  }
  return 0;
}
