#include <bits/stdc++.h>
using namespace std;
const long long N = 2020;
const long long base = 257;
const long long base2 = 263;
const long long inf = 1e9 + 7;
long long n, m;
string str;
long long hash_1[N][N], hash_2[N][N], P[N];
unordered_map<long long, int> mymap;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (fopen("math.inp", "r")) {
    freopen("math.inp", "r", stdin);
    freopen("math.out", "w", stdout);
  }
  memset(hash_1, 0, sizeof(hash_1));
  memset(hash_2, 0, sizeof(hash_2));
  P[0] = 1;
  for (int i = (1); i <= (N - 1); i++) P[i] = (P[i - 1] * base) % inf;
  cin >> m >> n;
  for (int i = (1); i <= (m); i++) {
    cin >> str;
    for (int j = (1); j <= (n); j++)
      hash_1[i][j] = (hash_1[i][j - 1] * base + str[j - 1]) % inf;
  }
  for (int i = (1); i <= (m - n + 1); i++) {
    long long ha = 0;
    for (int j = (1); j <= (n); j++)
      ha = (ha * base2 + hash_1[j + i - 1][n]) % inf;
    mymap[ha] = i;
  }
  for (int i = (1); i <= (n); i++) {
    cin >> str;
    for (int j = (1); j <= (m); j++)
      hash_2[i][j] = (hash_2[i][j - 1] * base + str[j - 1]) % inf;
  }
  for (int i = (1); i <= (m - n + 1); i++) {
    long long ha = 0;
    for (int j = (1); j <= (n); j++) {
      long long h =
          (hash_2[j][n + i - 1] - hash_2[j][i - 1] * P[n] + inf * inf) % inf;
      ha = (ha * base2 + h) % inf;
    }
    if (mymap.count(ha)) {
      cout << mymap[ha] << " " << i;
      return 0;
    }
  }
  return 0;
}
