#include <bits/stdc++.h>
using namespace std;
void JIZZ(string output = "") {
  cout << output;
  exit(0);
}
const long double PI = 3.14159265358979323846264338327950288;
const long double eps = 1e-13;
const long long mod = 865948511;
const long long p = 557;
long long invp;
long long pw(long long b, long long n, long long m, long long a = 1) {
  while (n) {
    if (n & 1) a = a * b % m;
    b = b * b % m;
    n >>= 1;
  }
  return a;
}
long long pp[2002], rhh[2502], rphh[2002];
string a[2002], b[202];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  auto c = clock();
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < m; ++i) cin >> b[i];
  pp[0] = 1;
  for (int i = 1; i < 2002; ++i) pp[i] = pp[i - 1] * p % mod;
  invp = pw(p, mod - 2, mod);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      rhh[i] += a[i][j] * pp[j] % mod;
    }
    rhh[i] %= mod;
    ;
    ;
  }
  for (int i = 0; i < m; ++i) rphh[0] += rhh[i] * pp[i] % mod;
  rphh[0] %= mod;
  for (int i = 1; i + m - 1 < n; ++i)
    rphh[i] = ((rphh[i - 1] - rhh[i - 1] + mod) % mod * invp % mod +
               rhh[i + m - 1] * pp[m - 1] % mod) %
              mod;
  memset(rhh, 0, sizeof(rhh));
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < m; ++j) {
      rhh[i] += b[i][j] * pp[j] % mod;
      ;
      ;
    }
    rhh[i] %= mod;
  }
  for (int i = 0; i + m - 1 < n; ++i) {
    long long nhh = 0;
    for (int j = 0; j < m; ++j) {
      ;
      ;
      nhh += rhh[j] * pp[j] % mod;
    }
    nhh %= mod;
    for (int j = 0; j + m - 1 < n; ++j) {
      ;
      ;
      if (nhh == rphh[j]) {
        bool ok = 1;
        for (int ii = 0; ii < m; ++ii) {
          for (int jj = 0; jj < m; ++jj) {
            if (a[j + ii][jj] != b[ii][jj + i]) ok = 0;
          }
        }
        if (!ok) continue;
        cout << j + 1 << " " << i + 1 << endl;
        exit(0);
      }
    }
    if (i + m < n) {
      for (int j = 0; j < m; ++j) {
        rhh[j] = ((rhh[j] - b[j][i] + mod) % mod * invp % mod +
                  b[j][i + m] * pp[m - 1] % mod) %
                 mod;
      }
    }
  }
  while ((double)(c - clock()) / CLOCKS_PER_SEC < 2.35)
    ;
  exit(123123);
}
