#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[2055][255];
char t[255][2055];
const unsigned long long B = 1610612741, C = 805306457;
const unsigned long long X = 104729, Y = 104173;
pair<unsigned long long, unsigned long long> h[2055];
pair<unsigned long long, unsigned long long> c[2055];
pair<unsigned long long, unsigned long long> p[255];
pair<unsigned long long, unsigned long long> v[2055];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < m; i++) scanf("%s", t[i]);
  for (int j = 0; j + 1 < m; j++) {
    for (int i = 0; i < m; i++) {
      c[i].first = c[i].first * B + t[i][j];
      c[i].second = c[i].second * C + t[i][j];
    }
  }
  p[0].first = 1;
  for (int i = 1; i <= m; i++) p[i].first = p[i - 1].first * B;
  p[0].second = 1;
  for (int i = 1; i <= m; i++) p[i].second = p[i - 1].second * C;
  for (int j = 0; j + m - 1 < n; j++) {
    for (int i = 0; i < m; i++) {
      c[i].first = c[i].first * B + t[i][j + m - 1];
      c[i].second = c[i].second * C + t[i][j + m - 1];
    }
    for (int i = 0; i < m; i++) {
      h[j].first = h[j].first * X + c[i].first;
      h[j].second = h[j].second * Y + c[i].second;
    }
    for (int i = 0; i < m; i++) {
      c[i].first = c[i].first - p[m - 1].first * t[i][j];
      c[i].second = c[i].second - p[m - 1].second * t[i][j];
    }
  }
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      c[i].first = c[i].first * B + s[i][j];
      c[i].second = c[i].second * C + s[i][j];
    }
  for (int i = 0; i + m - 1 < n; i++) {
    for (int j = i; j < i + m; j++) {
      v[i].first = v[i].first * X + c[j].first;
      v[i].second = v[i].second * Y + c[j].second;
    }
  }
  for (int j = 0; j + m - 1 < n; j++)
    for (int i = 0; i + m - 1 < n; i++)
      if (v[i] == h[j]) {
        printf("%d %d\n", i + 1, j + 1);
        return 0;
      }
  return 0;
}
