#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, m;
char s1[2007][207], s2[207][2007];
long long bin[207], bin1[207];
long long a[2007], d[2007];
struct Node {
  long long c[207];
} b[2007], e[2007];
int main() {
  n = read(), m = read();
  bin[0] = bin1[0] = 1;
  for (int i = 1; i <= m; i++)
    bin[i] = bin[i - 1] * 29ll % 998244353,
    bin1[i] = bin1[i - 1] * 29ll % 1000000007;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s1[i] + 1);
    for (int j = 1; j <= m; j++)
      a[i] = ((s1[i][j] - 'a') * bin[m - j] + a[i]) % 998244353,
      d[i] = ((s1[i][j] - 'a') * bin1[m - j] + d[i]) % 1000000007;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%s", s2[i] + 1);
    for (int j = 1; j <= m; j++)
      b[1].c[i] = ((s2[i][j] - 'a') * bin[m - j] + b[1].c[i]) % 998244353,
      e[1].c[i] = ((s2[i][j] - 'a') * bin1[m - j] + e[1].c[i]) % 1000000007;
    for (int j = m + 1, num = 2; j <= n; j++, num++)
      b[num].c[i] =
          ((b[num - 1].c[i] - (s2[i][j - m] - 'a') * bin[m - 1]) * 29ll +
           s2[i][j] - 'a') %
          998244353,
      e[num].c[i] =
          ((e[num - 1].c[i] - (s2[i][j - m] - 'a') * bin1[m - 1]) * 29ll +
           s2[i][j] - 'a') %
          1000000007;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (b[i].c[j] < 0) b[i].c[j] += 998244353;
      if (e[i].c[j] < 0) e[i].c[j] += 1000000007;
    }
  bool flag;
  for (int i = 1; i <= n - m + 1; i++)
    for (int j = 1; j <= n - m + 1; j++) {
      flag = false;
      for (int k = m; k >= 1; k--)
        if (a[i + k - 1] != b[j].c[k] || d[i + k - 1] != e[j].c[k]) {
          flag = true;
          break;
        }
      if (!flag) {
        printf("%d %d", i, j);
        return 0;
      }
    }
}
