#include <bits/stdc++.h>
using namespace std;
const int N = 2002;
int z[N];
void buildZArray(vector<int> &str) {
  int l = 0, r = 0, sz = str.size();
  for (int i = 1; i < sz; ++i) {
    if (i > r) {
      l = r = i;
      while (r < sz && str[r - l] == str[r]) ++r;
      z[i] = r - l, --r;
    } else if (z[i - l] < r - i + 1) {
      z[i] = z[i - l];
    } else {
      l = i;
      while (r < sz && str[r - l] == str[r]) ++r;
      z[i] = r - l, --r;
    }
  }
}
vector<int> searchZFunction(vector<int> &text, vector<int> &pattern) {
  vector<int> concat = pattern;
  concat.push_back(-1);
  concat.insert(concat.end(), text.begin(), text.end());
  buildZArray(concat);
  vector<int> places;
  int sz = pattern.size();
  for (int i = sz + 1; i < int(concat.size()); ++i)
    if (z[i] == sz) places.push_back(i - sz - 1);
  return places;
}
const int base = (srand(time(NULL)), 128 + rand() % 200);
struct MUL {
  int operator()(const int &a, const int &b) const {
    return a * (long long)b % 2000000011LL;
  }
};
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  MUL mul;
  int n, m;
  cin >> n >> m;
  vector<string> a(n), b(m);
  for (int i = (0); i < (n); i++) cin >> a[i];
  int p = 1;
  for (int i = (0); i < (m); i++) {
    cin >> b[i];
    if (i) p = mul(p, base);
  }
  vector<int> col(n);
  vector<vector<int> > mat(m);
  for (int i = (0); i < (n); i++) {
    int h = 0;
    for (int j = (0); j < (m); j++) {
      h = mul(h, base);
      h = (h + a[i][j]) % 2000000011LL;
    }
    col[i] = h;
  }
  for (int i = (0); i < (m); i++) {
    const string &s = b[i];
    int h = 0;
    for (int j = (0); j < (m); j++) {
      h = mul(h, base);
      h = (h + s[j]) % 2000000011LL;
    }
    mat[i].push_back(h);
    for (int j = m; j < n; ++j) {
      int k = j - m;
      h = (h - mul(s[k], p) + 2000000011LL) % 2000000011LL;
      h = mul(h, base);
      h = (h + s[j]) % 2000000011LL;
      mat[i].push_back(h);
    }
  }
  for (int i = (0); i < ((int)mat[0].size()); i++) {
    vector<int> cur(m);
    for (int j = (0); j < (m); j++) cur[j] = mat[j][i];
    vector<int> res = searchZFunction(col, cur);
    if ((int)res.size()) {
      cout << res[0] + 1 << " " << i + 1 << endl;
      return 0;
    }
  }
  return 0;
}
