#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vii = vector<pair<int, int>>;
struct node {
  node *succ[26];
  int num;
  node() {
    for (int i = 0; i < 26; ++i) succ[i] = nullptr;
  }
};
vector<int> kmpPreprocessing(vector<int> &sub) {
  vector<int> b(sub.size() + 1);
  b[0] = -1;
  int i = 0, j = -1;
  while (i < (int)sub.size()) {
    while (j >= 0 && sub[i] != sub[j]) j = b[j];
    i++;
    j++;
    b[i] = j;
  }
  return b;
}
vector<int> kmpSearch(vector<int> &s, vector<int> &sub) {
  vector<int> pre = kmpPreprocessing(sub), result;
  int i = 0, j = 0;
  while (i < (int)s.size()) {
    while (j >= 0 && s[i] != sub[j]) j = pre[j];
    ++i;
    ++j;
    if (j == (int)sub.size()) {
      result.push_back(i - j);
      j = pre[j];
    }
  }
  return result;
}
int n, m;
node root;
int ma;
int lookup(string *arr, int i, int j, bool insert) {
  node *cur = &root;
  for (int ii = i; ii < i + m; ++ii) {
    if (cur->succ[arr[ii][j] - 'a'] == nullptr) {
      if (!insert) return -1;
      cur->succ[arr[ii][j] - 'a'] = new node();
      cur->succ[arr[ii][j] - 'a']->num = -1;
    }
    cur = cur->succ[arr[ii][j] - 'a'];
  }
  if (insert && cur->num == -1) cur->num = ma++;
  return cur->num;
}
string second[2007], first[207];
vector<int> fidx;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> second[i];
  }
  for (int j = 0; j < m; ++j) {
    cin >> first[j];
  }
  fidx = vector<int>(n, 0);
  for (int i = 0; i < n; ++i) {
    fidx[i] = lookup(first, 0, i, true);
  }
  for (int i = 0; i < n - m + 1; ++i) {
    vector<int> pat(m, 0);
    bool ok = true;
    for (int j = 0; j < m; ++j) {
      int lo = lookup(second, i, j, false);
      if (lo == -1) {
        ok = false;
        break;
      }
      pat[j] = lo;
    }
    if (!ok) {
      continue;
    }
    vector<int> mat = kmpSearch(fidx, pat);
    if (!mat.empty()) {
      cout << (i + 1) << " " << (mat[0] + 1) << endl;
      return 0;
    }
  }
}
