#include <bits/stdc++.h>
using namespace std;
const int MAXLEN = 1e6;
struct RH_single {
  static const unsigned long long B = 127;
  static const unsigned long long P = 1e9 + 7;
  static unsigned long long pow[MAXLEN];
  static unsigned long long add(unsigned long long x, unsigned long long y) {
    return (x + y) % P;
  }
  static unsigned long long mul(unsigned long long x, unsigned long long y) {
    return (x * y) % P;
  }
  static void init() {
    pow[0] = 1;
    for (int i = 1; i < (int)MAXLEN; i++) pow[i] = mul(B, pow[i - 1]);
  }
  vector<unsigned long long> h;
  int len;
  RH_single(string &s) {
    len = s.size();
    h.resize(len);
    h[0] = s[0] - 'a';
    for (int i = 1; i < (int)len; i++) h[i] = add(mul(h[i - 1], B), s[i] - 'a');
  }
  unsigned long long hash(int i, int j) {
    if (i == 0) return h[j];
    return add(h[j], P - mul(h[i - 1], pow[j - i + 1]));
  }
  unsigned long long hash() { return h[len - 1]; }
};
unsigned long long RH_single::pow[MAXLEN];
int n, m;
vector<string> map1;
vector<vector<string>> map2;
vector<unsigned long long> hashmap1;
vector<vector<unsigned long long>> hashmap2;
char l;
pair<int, int> search_coordinate() {
  for (int i = 0; i < (int)n - m + 1; i++)
    for (int j = 0; j < (int)n - m + 1; j++) {
      if (hashmap1[i] == hashmap2[0][j]) {
        bool here = true;
        for (int t = 1; t < (int)m; t++) {
          if (hashmap1[i + t] != hashmap2[t][j]) {
            here = false;
            break;
          }
        }
        if (here) return {i + 1, j + 1};
      }
    }
  return {0, 0};
}
int main() {
  RH_single::init();
  cin >> n >> m;
  map1.resize(n);
  map2.assign(m, vector<string>(n - m + 1, ""));
  hashmap1.resize(n);
  hashmap2.assign(m, vector<unsigned long long>(n - m + 1));
  for (int i = 0; i < (int)n; i++) cin >> map1[i];
  for (int i = 0; i < (int)m; i++)
    for (int j = 0; j < (int)n; j++) {
      cin >> l;
      for (int k = max(0, j - m + 1); k < (int)min(n - m + 1, j + 1); k++)
        map2[i][k] += l;
    }
  for (int i = 0; i < (int)n; i++) {
    string s = map1[i];
    hashmap1[i] = RH_single(s).hash(0, s.size() - 1);
  }
  for (int i = 0; i < (int)m; i++)
    for (int j = 0; j < (int)n - m + 1; j++) {
      string s = map2[i][j];
      hashmap2[i][j] = RH_single(s).hash(0, s.size() - 1);
    }
  pair<int, int> coords = search_coordinate();
  cout << coords.first << ' ' << coords.second << '\n';
}
