#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int MAXN = 2e3 + 5;
int n, m;
char a[MAXN][205], b[205][MAXN];
int h[MAXN], l[205][MAXN];
bool judge(int x, int y) {
  for (int i = 1; i <= m; i++)
    if (h[x + i - 1] ^ l[i][y - 1] ^ l[i][y + m - 1]) return false;
  for (int p = 0; p < m; p++)
    for (int q = 0; q < m; q++)
      if (a[x + p][q + 1] != b[p + 1][y + q]) return false;
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf(" %s", a[i] + 1);
    for (int j = 1; j <= m; j++) h[i] ^= 1 << int(a[i][j] - 'a');
  }
  for (int i = 1; i <= m; i++) {
    scanf(" %s", b[i] + 1);
    for (int j = 1; j <= n; j++)
      l[i][j] = l[i][j - 1] ^ (1 << int(b[i][j] - 'a'));
  }
  for (int i = 1; i <= n - m + 1; i++)
    for (int j = 1; j <= n - m + 1; j++)
      if (judge(i, j)) {
        printf("%d %d\n", i, j);
        return 0;
      }
  return 0;
}
