#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, p1 = 37, p2 = 23;
char s1[400005], s2[205][2005];
long long sump1[400005], sump2[400005];
pair<long long, long long> hash2[2005], hash1[400005];
pair<long long, long long> gethash1(int sta, int fin) {
  long long h1 =
      (hash1[fin].first - hash1[sta].first * sump1[fin - sta] % mod + mod) %
      mod;
  long long h2 =
      (hash1[fin].second - hash1[sta].second * sump2[fin - sta] % mod + mod) %
      mod;
  return (pair<long long, long long>){h1, h2};
}
int n, m;
void Hash() {
  long long ret1, ret2;
  sump1[0] = sump2[0] = 1;
  for (int i = 1; i <= n * m; i++) {
    hash1[i].first = (hash1[i - 1].first * p1 + (long long)s1[i]) % mod;
    hash1[i].second = (hash1[i - 1].second * p2 + (long long)s1[i]) % mod;
    sump1[i] = sump1[i - 1] * p1 % mod, sump2[i] = sump2[i - 1] * p2 % mod;
  }
  for (int i = 1; i <= n - m + 1; i++) {
    ret1 = ret2 = 0;
    for (int j = 1; j <= m; j++) {
      for (int k = i; k <= m + i - 1; k++) {
        ret1 = (ret1 * p1 + (long long)s2[j][k]) % mod;
        ret2 = (ret2 * p2 + (long long)s2[j][k]) % mod;
      }
    }
    hash2[i] = (pair<long long, long long>){ret1, ret2};
  }
}
int main() {
  scanf("%d%d", &n, &m);
  getchar();
  for (int i = 1; i <= n * m; i++) {
    scanf("%c", s1 + i);
    if (i % m == 0) getchar();
  }
  for (int i = 1; i <= m; i++) scanf("%s", s2[i] + 1);
  Hash();
  for (int i = 1; i <= n * m - m * m + 1; i += m) {
    pair<long long, long long> h1 = gethash1(i - 1, i + m * m - 1);
    for (int j = 1; j <= n - m + 1; j++)
      if (h1 == hash2[j]) return 0 * printf("%d %d\n", (i + m - 1) / m, j);
  }
}
