#include <bits/stdc++.h>
using namespace std;
const int N = 2002, M = 202;
int n, m;
string A[N], B[M];
vector<int> cols;
long long hshA[N][M];
long long hshB[M][N];
long long pwr[N];
void buildHash() {
  pwr[0] = 1;
  for (int i = 1; i <= n; i++) pwr[i] = pwr[i - 1] * 37 % 1000000007;
  for (int i = 0; i < n; i++)
    for (int j = m - 1; j >= 0; j--)
      hshA[i][j] = (hshA[i][j + 1] * 37 + A[i][j] - '1' + 1) % 1000000007;
  for (int i = 0; i < m; i++)
    for (int j = n - 1; j >= 0; j--)
      hshB[i][j] = (hshB[i][j + 1] * 37 + B[i][j] - '1' + 1) % 1000000007;
}
long long getHashA(int i, int l, int len) {
  int r = l + len;
  return (hshA[i][r] * pwr[len] - hshA[i][l] + 1000000007) % 1000000007;
}
long long getHashB(int i, int l, int len) {
  int r = l + len;
  return (hshB[i][r] * pwr[len] - hshB[i][l] + 1000000007) % 1000000007;
}
bool check(int row, int col) {
  for (int i = 0; i < m; i++)
    if (getHashA(row + i, 0, m) != getHashB(i, col, m)) return false;
  cout << row + 1 << " " << col + 1;
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < m; i++) cin >> B[i];
  buildHash();
  for (int i = 0; i <= n - m; i++) {
    for (int j = 0; j <= n - m; j++)
      if (check(i, j)) return 0;
  }
  return 0;
}
