#include <bits/stdc++.h>
using namespace std;
const pair<int, int> P = {1e9 + 7, 1e9 + 9}, base = {29, 37},
                     base1 = {20180417, 20010201};
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
  return pair<int, int>((a.first + b.first) % P.first,
                        (a.second + b.second) % P.second);
}
pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {
  return pair<int, int>((a.first + P.first - b.first) % P.first,
                        (a.second + P.second - b.second) % P.second);
}
pair<int, int> operator*(pair<int, int> a, pair<int, int> b) {
  return pair<int, int>(1LL * a.first * b.first % P.first,
                        1LL * a.second * b.second % P.second);
}
pair<int, int> operator+=(pair<int, int> &a, pair<int, int> b) {
  return a = a + b;
}
pair<int, int> operator-=(pair<int, int> &a, pair<int, int> b) {
  return a = a - b;
}
pair<int, int> operator*=(pair<int, int> &a, pair<int, int> b) {
  return a = a * b;
}
int n, m;
char a[2010][2010], b[2010][2010];
pair<int, int> A[2010], B[2010][2010];
map<pair<int, int>, int> M;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= m; i++) scanf("%s", b[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      A[i] = A[i] * base + pair<int, int>(a[i][j] - 'a', a[i][j] - 'a');
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n - m + 1; j++)
      for (int k = 1; k <= m; k++)
        B[i][j] = B[i][j] * base +
                  pair<int, int>(b[i][j + k - 1] - 'a', b[i][j + k - 1] - 'a');
  for (int i = 1; i <= n - m + 1; i++) {
    pair<int, int> cur = {0, 0};
    for (int j = 1; j <= m; j++) cur = cur * base1 + A[i + j - 1];
    M[cur] = i;
  }
  for (int i = 1; i <= n - m + 1; i++) {
    pair<int, int> cur = {0, 0};
    for (int j = 1; j <= m; j++) cur = cur * base1 + B[j][i];
    if (M.count(cur)) return printf("%d %d\n", M[cur], i), 0;
  }
  puts("%%%%gjghfd");
  return 0;
}
