#include <bits/stdc++.h>
using namespace std;
int n, m, ar[2001][201], ars[201][2001], pr = 31;
map<int, int> mp;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("\n");
    for (int j = 0; j < m; j++) {
      char ch;
      scanf("%c", &ch);
      ar[i][j] = ch - 97;
    }
  }
  for (int i = 0; i < m; i++) {
    scanf("\n");
    for (int j = 0; j < n; j++) {
      char ch;
      scanf("%c", &ch);
      ars[i][j] = ch - 97;
    }
  }
  for (int i = 0; i <= n - m; i++) {
    int q = 0, hash = 0;
    for (int k = i; k < i + m; k++) {
      for (int j = 0; j < m; j++) {
        q = q * pr + ar[k][j];
      }
    }
    mp[q] = i + 1;
  }
  for (int i = 0; i <= n - m; i++) {
    int q = 0, hash = 0;
    for (int j = 0; j < m; j++) {
      for (int k = i; k < i + m; k++) {
        q = q * pr + ars[j][k];
      }
    }
    if (mp[q] != 0) {
      cout << mp[q] << " " << i + 1;
      return 0;
    }
  }
  return 0;
}
