#include <bits/stdc++.h>
using namespace std;
const int p = 131;
int n, m;
char a[2005][205], b[205][2005];
unsigned int ha[2005];
unsigned int s1[2005], s2[2005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", a[i]);
    ha[i] = hash<string>()(string(a[i], a[i] + m));
  }
  for (int i = 0; i <= (n - m); ++i)
    for (int j = 0; j < m; ++j) s1[i] = s1[i] * p + ha[i + j];
  for (int i = 0; i < m; ++i) {
    scanf("%s", b[i]);
    for (int j = 0; j <= (n - m); ++j)
      s2[j] = s2[j] * p + hash<string>()(string(b[i] + j, b[i] + j + m));
  }
  for (int i = 0; i <= (n - m); ++i)
    for (int j = 0; j <= (n - m); ++j)
      if (s1[i] == s2[j]) {
        printf("%d %d\n", i + 1, j + 1);
        return 0;
      }
  return 0;
}
