#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const int N = 2005;
const int M = 205;
char board1[N][M];
char board2[M][N];
const int MOD = 10007;
const int x = 97;
int hash1h[N], hash1v[N];
int hash2h[N], hash2v[N];
int pow_x[MOD - 1];
int main() {
  int n, m;
  pow_x[0] = 1;
  for (int i = 0; i < (int)MOD - 2; ++i) pow_x[i + 1] = (pow_x[i] * x) % MOD;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)n; ++i) scanf("%s", board1[i]);
  for (int i = 0; i < (int)m; ++i) scanf("%s", board2[i]);
  for (int i = 0; i < (int)n; ++i)
    for (int j = 0; j < (int)m; ++j)
      hash1h[i] = (hash1h[i] + (board1[i][j] - 'a') * pow_x[j % MOD]) % MOD;
  for (int i = 0; i < (int)n - m + 1; ++i)
    for (int j = 0; j < (int)m; ++j)
      hash1v[i] = (hash1v[i] + hash1h[i + j] * pow_x[(j * m) % MOD]) % MOD;
  for (int i = 0; i < (int)m; ++i)
    for (int j = 0; j < (int)n; ++j)
      hash2v[j] =
          (hash2v[j] + (board2[i][j] - 'a') * pow_x[(i * m) % MOD]) % MOD;
  for (int i = 0; i < (int)m; ++i)
    for (int j = 0; j < (int)n - m + 1; ++j)
      hash2h[j] = (hash2h[j] + hash2v[i + j] * pow_x[i % MOD]) % MOD;
  vector<vector<int> > hashes2(MOD);
  for (int i = 0; i < (int)n - m + 1; ++i) hashes2[hash2h[i]].push_back(i);
  for (int i = 0; i < (int)n - m + 1; ++i) {
    for (auto j : hashes2[hash1v[i]]) {
      bool flag = true;
      for (int k = 0; k < (int)m; ++k) {
        for (int l = 0; l < (int)m; ++l) {
          if (board1[i + k][l] != board2[k][j + l]) {
            flag = false;
            break;
          }
        }
        if (!flag) break;
      }
      if (flag) {
        printf("%d %d\n", i + 1, j + 1);
        return 0;
      }
    }
  }
  return 0;
}
