#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int n, m;
map<vector<vector<char> >, int> M;
vector<vector<char> > s, c, d;
void print() {
  for (int i = 0; i < m; i++, cout << "\n")
    for (int j = 0; j < m; j++) {
      cout << d[i][j];
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  d.resize(m);
  s.resize(n);
  c.resize(m);
  for (int i = 0; i < m; i++) d[i].resize(m);
  for (int i = 0; i < n; i++) {
    s[i].resize(m);
    for (int j = 0; j < m; j++) {
      cin >> s[i][j];
    }
    if (i < m) {
      for (int j = 0; j < m; j++) d[i][j] = s[i][j];
    } else {
      for (int j = 0; j < m - 1; j++) {
        for (int k = 0; k < m; k++) {
          d[j][k] = d[j + 1][k];
        }
      }
      for (int j = 0; j < m; j++) d[m - 1][j] = s[i][j];
    }
    if (i >= m - 1) {
      M[d] = i - m + 2;
    }
  }
  d.clear();
  d.resize(m);
  for (int i = 0; i < m; i++) d[i].resize(m);
  for (int i = 0; i < m; i++) {
    c[i].resize(n);
    for (int j = 0; j < n; j++) {
      cin >> c[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++) {
      d[i][j] = c[i][j];
    }
  }
  for (int j = m; j <= n; j++) {
    if (M[d]) {
      return cout << M[d] << " " << j - m + 1, 0;
    }
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < m - 1; j++) {
        d[i][j] = d[i][j + 1];
      }
    }
    for (int i = 0; i < m; i++) d[i][m - 1] = c[i][j];
  }
  if (M[d]) {
    return cout << M[d] << " " << n - m + 1, 0;
  }
  return 0;
}
