#include <bits/stdc++.h>
using namespace std;
const int mod = 997;
const int maxn = 2e3 + 7;
const int maxm = 2e5 + 7;
int ar[maxn], m, n;
bool bo[maxn];
char ch1[maxn][maxn], ch2[maxn][maxn];
int ar1[maxn], ar2[maxn][maxn];
void init() {
  for (int i = 0; i < n; i++) {
    ar1[i] = 0;
    for (int j = 0; j < m; j++) {
      ar1[i] = (ar1[i] + (ch1[i][j] - 'a' + 1) * (j + 1)) % mod;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j + m - 1 < n; j++) {
      ar2[i][j] = 0;
      for (int k = 0; k < m; k++) {
        ar2[i][j] = (ar2[i][j] + (ch2[i][j + k] - 'a' + 1) * (k + 1)) % mod;
      }
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> ch1[i];
  for (int i = 0; i < m; i++) cin >> ch2[i];
  init();
  for (int i = 0; i <= n - m; i++) {
    for (int j = 0; j <= n - m; j++) {
      bool fond = true;
      for (int k = 0; k < m && fond; k++) {
        if (ar1[i + k] != ar2[k][j]) fond = false;
      }
      if (fond) {
        cout << i + 1 << " " << j + 1 << "\n";
        return 0;
      }
    }
  }
  return 0;
}
