#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[2005][205], t[205][2005];
long long tmp, now, f[205 * 205], g[2005], h[2005], p[205][2005];
map<long long, int> mp;
int main() {
  scanf("%d%d", &n, &m);
  f[0] = 1;
  for (int i = 1; i <= m * m; i++) f[i] = f[i - 1] * 26 % 1000000007;
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < m; i++) scanf("%s", t[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      s[i][j] -= 'a';
      t[j][i] -= 'a';
    }
  for (int i = 0; i < m; i++) {
    tmp = 0;
    for (int j = 0; j < m; j++) tmp = (tmp * 26 + t[i][j]) % 1000000007;
    for (int j = m; j < n; j++) {
      p[i][j - m] = tmp;
      tmp = (((tmp - f[m - 1] * t[i][j - m] % 1000000007 + 1000000007) %
              1000000007) *
                 26 % 1000000007 +
             t[i][j]) %
            1000000007;
    }
    p[i][n - m] = tmp;
  }
  now = 0;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) now = (now * 26 + s[i][j]) % 1000000007;
  for (int i = m; i < n; i++) {
    g[i - m] = now;
    mp[g[i - m]] = i - m + 1;
    for (int j = 0; j < m; j++) {
      now = (((now - f[m * m - 1] * s[i - m][j] % 1000000007 + 1000000007) %
              1000000007) *
                 26 % 1000000007 +
             s[i][j]) %
            1000000007;
    }
  }
  g[n - m] = now;
  mp[g[n - m]] = n - m + 1;
  now = 0;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) now = (now * 26 + t[i][j]) % 1000000007;
  for (int i = m; i < n; i++) {
    h[i - m] = now;
    for (int j = 0; j < m; j++) {
      now = (now +
             f[m * (m - j - 1)] * (p[j][i - m + 1] - p[j][i - m]) % 1000000007 +
             1000000007) %
            1000000007;
    }
  }
  h[n - m] = now;
  for (int i = 0; i <= n - m; i++)
    if (mp[h[i]]) {
      printf("%d %d\n", mp[h[i]], i + 1);
      return 0;
    }
}
