#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <typename T>
T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
bool is_down(char x) { return ('a' <= x && x <= 'z'); }
bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
bool is_digit(char x) { return ('0' <= x && x <= '9'); }
const double pi = 3.141592653589793238462643383279;
const double log23 = 1.58496250072115618145373894394781;
const double eps = 1e-8;
const long long INF = 1e18 + 239;
const long long prost = 239;
const int two = 2;
const int th = 3;
const long long MOD = 1e9 + 7;
const long long MOD2 = MOD * MOD;
const int BIG = 1e9 + 239;
const int alf = 26;
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 80;
const int T = (1 << 18);
const int B = trunc(sqrt(M)) + 1;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;
const long long p1 = 239;
const long long p2 = 31;
long long pr1[N], pr2[N], h1[N], h2[N];
int n, m;
string a[N], b[N];
int main() {
  cin.sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < m; j++) cin >> b[j];
  pr1[0] = 0;
  for (int i = 0; i < n; i++) {
    pr1[i + 1] = pr1[i] * p1;
    long long s = 0;
    for (int j = 0; j < m; j++) s = p2 * s + (b[j][i] - 'a' + 1);
    pr1[i + 1] += s;
  }
  pr2[0] = 0;
  for (int i = 0; i < n; i++) {
    pr2[i + 1] = pr2[i] * p2;
    long long s = 0;
    for (int j = 0; j < m; j++) s = p1 * s + (a[i][j] - 'a' + 1);
    pr2[i + 1] += s;
  }
  long long pw1 = 1;
  for (int i = 0; i < m; i++) pw1 *= p1;
  for (int i = 0; i <= n - m; i++) h1[i] = pr1[i + m] - pr1[i] * pw1;
  long long pw2 = 1;
  for (int i = 0; i < m; i++) pw2 *= p2;
  for (int i = 0; i <= n - m; i++) h2[i] = pr2[i + m] - pr2[i] * pw2;
  for (int i = 0; i <= n - m; i++)
    for (int j = 0; j <= n - m; j++)
      if (h1[i] == h2[j]) {
        cout << j + 1 << " " << i + 1;
        return 0;
      }
  return 0;
}
