#include <bits/stdc++.h>
using namespace std;
long long mi[400010], ni[400010], x;
char a[400010];
int n, m;
map<pair<long long, long long>, int> s;
void pre(long long x, long long len) {
  long long i;
  mi[0] = 1;
  for (i = 1; i < 400010; i++) mi[i] = mi[i - 1] * 31 % 1000007;
  ni[0] = 1;
  for (i = 1; i < 400010; i++) ni[i] = ni[i - 1] * 37 % 9999997;
  long long t = 0, tt = 0;
  for (i = 0; i < x; i++)
    t = (t * 31 + (a[i] - 'a' + 1)) % 1000007,
    tt = (tt * 37 + (a[i] - 'a' + 1)) % 9999997;
  s[pair<long long, long long>(t, tt)] = 1;
  for (i = 0; i < len - x; i++) {
    t = (t - (a[i] - 'a' + 1) * mi[x - 1] % 1000007 + 1000007) % 1000007;
    t = (t * 31 + (a[i + x] - 'a' + 1)) % 1000007;
    tt = (tt - (a[i] - 'a' + 1) * ni[x - 1] % 9999997 + 9999997) % 9999997;
    tt = (tt * 37 + (a[i + x] - 'a' + 1)) % 9999997;
    if ((i + 1) % m == 0)
      s[pair<long long, long long>(t, tt)] = (i + 1) / m + 1;
  }
}
char cc[202][2002];
long long f[202] = {0}, ff[202] = {0};
int main() {
  scanf("%d%d", &n, &m);
  for (long long i = 0; i < n; i++) scanf("%s", a + m * i);
  pre(m * m, n * m);
  for (long long i = 0; i < m; i++) scanf("%s", cc[i]);
  long long d = 0, dd = 0;
  for (long long i = 0; i < m; i++) {
    for (long long j = 0; j < m; j++)
      f[i] = (f[i] * 31 + (cc[i][j] - 'a' + 1)) % 1000007,
      ff[i] = (ff[i] * 37 + (cc[i][j] - 'a' + 1)) % 9999997;
    d = (d + (long long)f[i] * mi[(m - i - 1) * m] % 1000007) % 1000007;
    dd = (dd + (long long)ff[i] * ni[(m - i - 1) * m] % 9999997) % 9999997;
  }
  if (s[pair<long long, long long>(d, dd)]) {
    printf("%d %d", s[pair<long long, long long>(d, dd)], 1);
    return 0;
  }
  for (long long i = 0; i < n - m; i++) {
    d = dd = 0;
    for (long long j = 0; j < m; j++) {
      f[j] = (f[j] - (cc[j][i] - 'a' + 1) * mi[m - 1] % 1000007 + 1000007) %
             1000007;
      f[j] = (f[j] * 31 + (cc[j][i + m] - 'a' + 1)) % 1000007;
      d = (d + (long long)f[j] * mi[(m - j - 1) * m] % 1000007) % 1000007;
      ff[j] = (ff[j] - (cc[j][i] - 'a' + 1) * ni[m - 1] % 9999997 + 9999997) %
              9999997;
      ff[j] = (ff[j] * 37 + (cc[j][i + m] - 'a' + 1)) % 9999997;
      dd = (dd + (long long)ff[j] * ni[(m - j - 1) * m] % 9999997) % 9999997;
    }
    if (s[pair<long long, long long>(d, dd)]) {
      printf("%d %I64d", s[pair<long long, long long>(d, dd)], i + 2);
      return 0;
    }
  }
}
