#include <bits/stdc++.h>
using namespace std;
const int N = 255001;
const long double PI = acos(-1);
int n, m;
char g1[2222][222];
char g2[222][2222];
pair<int, pair<int, int> > hsh[2222];
pair<int, pair<int, int> > hsh2[222][2222];
pair<int, pair<int, int> > getHash(int i) {
  if (hsh[i].first || hsh[i].second.first) return hsh[i];
  hsh[i].first = 1;
  hsh[i].second.first = 1;
  long long p1 = 31, p2 = 29, p3 = 37;
  for (int j = 0; j < m; j++) {
    hsh[i].first = hsh[i].first +
                   ((1ll * (g1[i][j] - 'a' + 1) * p1) % 998244353) % 998244353;
    hsh[i].second.first =
        hsh[i].second.first +
        ((1ll * (g1[i][j] - 'a' + 1) * p2) % 1000000009) % 1000000009;
    hsh[i].second.second =
        hsh[i].second.second +
        ((1ll * (g1[i][j] - 'a' + 1) * p3) % 1000000007) % 1000000007;
    p1 = p1 * 1ll * 31;
    p1 = p1 % 998244353;
    p2 = p2 * 1ll * 29;
    p2 = p2 % 1000000009;
    p3 = p3 * 1ll * 37;
    p3 = p3 % 1000000007;
  }
  return hsh[i];
}
pair<int, pair<int, int> > getHash2(int i, int j) {
  if (hsh2[i][j].first || hsh2[i][j].second.first) return hsh2[i][j];
  hsh2[i][j].first = 1;
  hsh2[i][j].second.first = 1;
  long long p1 = 31, p2 = 29, p3 = 37;
  for (int k = 0; k < m; k++) {
    hsh2[i][j].first =
        hsh2[i][j].first +
        ((1ll * (g2[i][k + j] - 'a' + 1) * p1) % 998244353) % 998244353;
    hsh2[i][j].second.first =
        hsh2[i][j].second.first +
        ((1ll * (g2[i][k + j] - 'a' + 1) * p2) % 1000000009) % 1000000009;
    hsh2[i][j].second.second =
        hsh2[i][j].second.second +
        ((1ll * (g2[i][k + j] - 'a' + 1) * p3) % 1000000007) % 1000000007;
    p1 = p1 * 1ll * 31;
    p1 = p1 % 998244353;
    p2 = p2 * 1ll * 29;
    p2 = p2 % 1000000009;
    p3 = p3 * 1ll * 37;
    p3 = p3 % 1000000007;
  }
  return hsh2[i][j];
}
signed main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf(" %s", g1[i]);
    hsh[i] = getHash(i);
  }
  for (int i = 0; i < m; i++) {
    scanf(" %s", g2[i]);
    for (int j = 0; j <= n - m; j++) {
      hsh2[i][j] = getHash2(i, j);
    }
  }
  for (int i = 0; i <= n - m; i++) {
    for (int j = 0, b = 0; j <= n - m; j++) {
      b = 0;
      for (int k = 0; k < m; k++) {
        if (hsh[i + k] != hsh2[k][j]) {
          b = 1;
          break;
        }
      }
      if (b == 0) return cout << i + 1 << " " << j + 1 << endl, 0;
    }
  }
}
