#include <bits/stdc++.h>
using namespace std;
const int SZ = 100010;
long long INF = 0x7FFFFFFF;
const double EPS = 1e-8;
char one[2010][2010], two[2010][2010];
long long mod = 1e9 + 7;
int main() {
  {
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i) {
      scanf(" %s", one[i]);
    }
    for (int i = 0; i < m; ++i) {
      scanf(" %s", two[i]);
    }
    map<int, int> mp;
    for (int i = 0; i < n - m + 1; ++i) {
      long long res = 0;
      for (int j = i; j < i + m; ++j) {
        for (int k = 0; k < m; ++k) {
          res += (one[j][k] - 96) * ((j - i) * m + k + 1) % mod;
        }
      }
      mp[res] = i + 1;
    }
    for (int i = 0; i < n - m + 1; ++i) {
      long long res = 0;
      for (int k = 0; k < m; ++k) {
        for (int j = i; j < i + m; ++j) {
          res += (two[k][j] - 96) * (k * m + (j - i) + 1) % mod;
        }
      }
      if (mp.count(res)) {
        printf("%d %d\n", mp[res], i + 1);
        return 0;
      }
    }
  }
}
