#include <bits/stdc++.h>
using namespace std;
const int N = 2005, M = 205, M1 = 1e9 + 7, M2 = 1e9 + 9;
char a[N][M], b[M][N];
int A[N], B[N];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%s", b[i]);
  }
  for (int i = 0; i < n; i++) {
    int l = i, r = i + m - 1;
    if (r >= n) {
      A[l] = -1;
      continue;
    }
    int ret = 0;
    for (int i = l; i <= r; i++) {
      for (int j = 0; j < m; j++) {
        ret = (ret * 31 + a[i][j] - 'a' + 1);
      }
    }
    A[l] = ret;
  }
  for (int i = 0; i < n; i++) {
    int l = i, r = i + m - 1;
    if (r >= n) {
      B[l] = -1;
      continue;
    }
    int ret = 0;
    for (int i = 0; i < m; i++) {
      for (int j = l; j <= r; j++) {
        ret = (ret * 31 + b[i][j] - 'a' + 1);
      }
    }
    B[l] = ret;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (A[i] != -1 && B[j] != -1 && A[i] == B[j]) {
        cout << i + 1 << " " << j + 1 << endl;
        return 0;
      }
    }
  }
}
