#include <bits/stdc++.h>
using namespace std;
char a[2002][202], b[202][2002];
int main() {
  int n, m;
  cin >> n >> m;
  char temp;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> temp;
      a[i][j] = temp;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> temp;
      b[i][j] = temp;
    }
  }
  int i = 1, j = 1;
  for (i = 1; i <= n - m + 1; i++) {
    for (j = 1; j <= n - m + 1; j++) {
      bool flag = true;
      for (int k = 0; k < m && flag; k++) {
        flag &= !memcmp(&a[i + k][1], &b[k + 1][j], m);
      }
      if (flag) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
}
