#include <bits/stdc++.h>
using namespace std;
int di[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dj[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int N = 2e3 + 5;
int n, m;
string mp[N], mp2[N];
map<string, string> shortcut;
map<string, int> ind;
set<string> seq;
void next(string &s) {
  if (s[s.size() - 1] == 'z')
    s.push_back('a');
  else
    s.back()++;
}
int main() {
  scanf("%d%d", &n, &m);
  set<string> uni;
  for (int i = 0; i < n; i++) {
    cin >> mp[i];
    uni.insert(mp[i]);
  }
  for (int j = 0; j < m; j++) cin >> mp2[j];
  string t = "a";
  for (auto s : uni) {
    shortcut[s] = t;
    next(t);
  }
  for (int i = 0; i + m - 1 < n; i++) {
    t = "";
    for (int j = 0; j < m; j++) {
      if (j != 0) t += '#';
      t += shortcut[mp[i + j]];
    }
    ind[t] = i;
    seq.insert(t);
  }
  for (int j = 0; j + m - 1 < n; j++) {
    t = "";
    bool good = 1;
    for (int k = 0; k < m; k++) {
      string cur = "";
      for (int h = 0; h < m; h++) cur += mp2[k][j + h];
      if (k != 0) t += '#';
      good &= shortcut.count(cur);
      t += shortcut[cur];
    }
    if (seq.count(t) && good) {
      printf("%d %d", ind[t] + 1, j + 1);
      return 0;
    }
  }
}
