#include <bits/stdc++.h>
using namespace std;
const long long arr = 3e5;
const long long base = 257;
long long md = 1e9 + 100;
long long hesh1[2010][2010], hesh2[2010][2010], h1[2010], h2[2010], step[arr],
    rstep[arr];
long long get(long long u, long long l, long long r) {
  return ((hesh2[u][r] - hesh2[u][l - 1]) % md + md) % md * rstep[l - 1] % md;
}
long long bpow(long long u, long long step) {
  if (step == 0) return (1);
  if (step % 2)
    return (bpow(u, step - 1) * u % md);
  else
    return (bpow(u * u % md, step / 2));
}
string st1[3000], st2[3000];
long long n, m;
bool check(long long p1, long long p2) {
  for (long long i = 1; i <= m; i++)
    if (hesh1[p1 + i - 1][m] != get(i, p2, p2 + m - 1)) return (0);
  return (1);
}
bool simple(long long u) {
  for (long long i = 2; i * i <= u; i++)
    if (u % i == 0) return (0);
  return (1);
}
signed main() {
  md++;
  while (!simple(md)) md++;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  step[0] = 1;
  for (long long i = 1; i <= 10000; i++) {
    step[i] = step[i - 1] * base % md;
  }
  for (long long i = 0; i <= 10000; i++) {
    rstep[i] = bpow(step[i], md - 2);
  }
  for (long long i = 1; i <= n; i++) {
    cin >> st1[i];
    for (long long j = 1; j <= m; j++)
      hesh1[i][j] =
          (hesh1[i][j - 1] + (st1[i][j - 1] - 'a' + 1) * step[j]) % md;
  }
  for (long long i = 1; i <= m; i++) {
    cin >> st2[i];
    for (long long j = 1; j <= n; j++)
      hesh2[i][j] =
          (hesh2[i][j - 1] + (st2[i][j - 1] - 'a' + 1) * step[j]) % md;
  }
  for (long long i = 1; i + m - 1 <= n; i++) {
    h1[i] = 0;
    long long len = 0;
    for (long long j = 1; j <= m; j++) {
      h1[i] += hesh1[i + j - 1][m] * step[len];
      h1[i] %= md;
      len += m;
    }
  }
  for (long long i = 1; i + m - 1 <= n; i++) {
    h2[i] = 0;
    long long len = 0;
    for (long long j = 1; j <= m; j++) {
      h2[i] += get(j, i, i + m - 1) * step[len];
      h2[i] %= md;
      len += m;
    }
  }
  vector<pair<pair<long long, long long>, long long> > vec;
  set<long long> bad;
  for (long long i = 1; i + m - 1 <= n; i++) {
    long long cnt = 100;
    for (long long j = m; j <= n; j++)
      if (h1[i] == h2[n - j + 1] && cnt) {
        vec.push_back({{i, n - j + 1}, h1[i]});
        cnt--;
      }
    cnt = 100;
    for (long long j = 1; j + m - 1 <= n; j++)
      if (h1[i] == h2[j] && cnt) {
        vec.push_back({{i, j}, h1[i]});
        cnt--;
      }
  }
  random_shuffle(vec.begin(), vec.end());
  for (auto i : vec) {
    if (bad.count(i.second)) continue;
    if (check(i.first.first, i.first.second)) {
      cout << i.first.first << ' ' << i.first.second;
      return (0);
    }
  }
  exit(1);
}
