#include <bits/stdc++.h>
using namespace std;
constexpr int NMAX = 2002, MMAX = 202;
constexpr int BASE = 29, MOD = 1e9 + 7;
int N, M;
char A[NMAX][MMAX];
char B[MMAX][NMAX];
int val_A[NMAX];
int val_B[NMAX];
int power[MMAX * MMAX];
void Do_Value_A() {
  int aux = M * M - 1;
  for (int i = 1; i <= M; ++i)
    for (int j = 1; j <= M; ++j) {
      val_A[1] =
          (1LL * val_A[1] + ((1LL * power[aux] * (A[i][j] - 'a')) % MOD)) % MOD;
      --aux;
    }
  for (int i = 2; i <= N - M + 1; ++i) {
    val_A[i] = val_A[i - 1];
    int aux = M * M - 1;
    for (int j = 1; j <= M; ++j) {
      val_A[i] = (1LL * val_A[i] -
                  (1LL * power[aux] * (A[i - 1][j] - 'a')) % MOD + 1LL * MOD) %
                 MOD;
      --aux;
    }
    val_A[i] = (1LL * val_A[i] * power[M]) % MOD;
    aux = M - 1;
    for (int j = 1; j <= M; ++j) {
      val_A[i] = (1LL * val_A[i] +
                  (1LL * power[aux] * (A[i + M - 1][j] - 'a')) % MOD) %
                 MOD;
      --aux;
    }
  }
}
void Do_Value_B() {
  int aux = M * M - 1;
  for (int i = 1; i <= M; ++i)
    for (int j = 1; j <= M; ++j) {
      val_B[1] =
          (1LL * val_B[1] + ((1LL * power[aux] * (B[i][j] - 'a')) % MOD)) % MOD;
      --aux;
    }
  for (int i = 2; i <= N - M + 1; ++i) {
    val_B[i] = val_B[i - 1];
    int aux = M * M - 1;
    for (int j = 1; j <= M; ++j) {
      val_B[i] = (1LL * val_B[i] -
                  (1LL * power[aux] * (B[j][i - 1] - 'a')) % MOD + 1LL * MOD) %
                 MOD;
      aux -= M;
    }
    val_B[i] = (1LL * val_B[i] * power[1]) % MOD;
    aux = M * (M - 1);
    for (int j = 1; j <= M; ++j) {
      val_B[i] = (1LL * val_B[i] +
                  (1LL * power[aux] * (B[j][i + M - 1] - 'a')) % MOD) %
                 MOD;
      aux -= M;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> N >> M;
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= M; ++j) cin >> A[i][j];
  for (int i = 1; i <= M; ++i)
    for (int j = 1; j <= N; ++j) cin >> B[i][j];
  power[0] = 1;
  for (int i = 1; i <= M * M; ++i) {
    power[i] = (1LL * power[i - 1] * BASE) % MOD;
  }
  Do_Value_A();
  Do_Value_B();
  for (int i = 1; i <= N - M + 1; ++i) {
    for (int j = 1; j <= N - M + 1; ++j) {
      if (val_A[i] == val_B[j]) {
        cout << i << " " << j << '\n';
        return 0;
      }
    }
  }
  return 0;
}
