#include <bits/stdc++.h>
using namespace std;
const int PRIME_BASE = 719;
const long long PRIME_MOD = 1110111110111ULL;
void mod(long long& h) {
  if (h >= PRIME_MOD) h -= PRIME_MOD;
}
long long mulmod(long long a, long long b) {
  long long res = 0;
  while (a > 0) {
    if (a & 1) {
      res += b;
      mod(res);
    }
    a >>= 1;
    b = (b << 1);
    mod(b);
  }
  return res;
}
char strings1[2010][210];
char strings2[210][2010];
map<long long, int> getRow;
map<long long, int>::iterator it;
int main() {
  int N, M, idx = 1;
  long long hash, power[40010];
  scanf("%d %d", &N, &M);
  power[0] = 1;
  for (int i = 1; i <= M * M; i++) power[i] = mulmod(power[i - 1], PRIME_BASE);
  for (int i = 0; i < N; i++) scanf(" %s", strings1[i]);
  hash = 0;
  idx = 1;
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; j++) {
      hash = mulmod(hash, PRIME_BASE) + strings1[i][j];
      mod(hash);
    }
  }
  getRow[hash] = idx++;
  for (int i = M; i < N; i++) {
    for (int j = 0; j < M; j++) {
      hash = mulmod(hash, PRIME_BASE) + strings1[i][j];
      mod(hash);
      hash -= mulmod(power[M * M], strings1[i - M][j]);
      if (hash < 0) hash += PRIME_MOD;
    }
    if (getRow.find(hash) == getRow.end()) getRow[hash] = idx;
    idx++;
  }
  for (int i = 0; i < M; i++) scanf(" %s", strings2[i]);
  hash = 0;
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; j++) {
      hash = mulmod(hash, PRIME_BASE) + strings2[i][j];
      mod(hash);
    }
  }
  if ((it = getRow.find(hash)) != getRow.end()) {
    printf("%d %d\n", it->second, 1);
    return 0;
  }
  for (int i = M; i < N; i++) {
    hash = mulmod(hash, PRIME_BASE);
    mod(hash);
    for (int j = 1; j <= M; j++) {
      hash -= mulmod(power[j * M], strings2[M - j][i - M]);
      if (hash < 0) hash += PRIME_MOD;
    }
    for (int j = 1; j <= M; j++) {
      hash += mulmod(power[(j - 1) * M], strings2[M - j][i]);
      mod(hash);
    }
    if ((it = getRow.find(hash)) != getRow.end()) {
      printf("%d %d\n", it->second, i - (M - 2));
      break;
    }
  }
  return 0;
}
