#include <bits/stdc++.h>
using namespace std;
const int N = 2000, M = 200;
char map1[N][M], map2[M][N];
int n, m;
map<string, int> list1, list2;
void set1(int r) {
  string s;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) s.push_back(map1[r + i][j]);
  list1[s] = r;
}
void set2(int c) {
  string s;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) s.push_back(map2[i][j + c]);
  list2[s] = c;
}
void check() {
  for (auto p : list1)
    if (list2.count(p.first)) {
      cout << 1 + p.second << ' ' << 1 + list2[p.first] << endl;
      return;
    }
}
int main() {
  iostream::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> map1[i][j];
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) cin >> map2[i][j];
  for (int i = 0; i <= n - m; i++) set1(i), set2(i);
  check();
}
