#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int mod = 1e9 + 7;
const double eps = 1e-6;
const int N = 2e3 + 7;
unsigned long long h1[N], h2[N][N];
char s[N][N], t[N][N];
int n, m;
void init() {
  for (int i = 1; i <= n; i++) {
    unsigned long long h = 0;
    for (int j = 1; j <= m; j++) h = h * 131 + s[i][j];
    h1[i] = h;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j + m - 1 <= n; j++) {
      unsigned long long h = 0;
      for (int k = j; k <= j + m - 1; k++) h = h * 131 + t[i][k];
      h2[i][j] = h;
    }
  }
}
bool judge(int first, int second) {
  for (int i = 1; i <= m; i++)
    if (h1[first + i - 1] != h2[i][second]) return false;
  return true;
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= m; i++) scanf("%s", t[i] + 1);
  init();
  for (int i = 1; i + m - 1 <= n; i++)
    for (int j = 1; j + m - 1 <= n; j++)
      if (judge(i, j)) {
        printf("%d %d\n", i, j);
        return 0;
      }
  return 0;
}
