#include <bits/stdc++.h>
bool check_overlap(char map1[2000][200], char map2[200][2000], int off1,
                   int off2, int M, int *last_fail) {
  int pos1[2] = {off1 + last_fail[0], last_fail[1]};
  int pos2[2] = {last_fail[0], off2 + last_fail[1]};
  if (map1[pos1[0]][pos1[1]] != map2[pos2[0]][pos2[1]]) {
    return false;
  }
  if (last_fail[1] != 0 &&
      map1[pos1[0]][pos1[1] - 1] != map2[pos2[0]][pos2[1] - 1]) {
    return false;
  }
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; j++) {
      int pos1[2] = {off1 + i, j};
      int pos2[2] = {i, off2 + j};
      if (map1[pos1[0]][pos1[1]] != map2[pos2[0]][pos2[1]]) {
        last_fail[0] = i;
        last_fail[1] = j;
        return false;
      }
    }
  }
  return true;
}
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  char map1[2000][200];
  char map2[200][2000];
  for (int i = 0; i < N; i++) {
    scanf("%s", map1[i]);
  }
  for (int i = 0; i < M; i++) {
    scanf("%s", map2[i]);
  }
  int k = N - M + 1;
  int offset[2] = {0, 0};
  for (int i = 0; i < k; i++) {
    int fail[2] = {0, 0};
    for (int j = 0; j < k; j++) {
      int pos1[2] = {i, 0};
      int pos2[2] = {0, j};
      if (check_overlap(map1, map2, i, j, M, fail)) {
        offset[0] = i;
        offset[1] = j;
        goto outside;
      }
    }
  }
outside:
  printf("%i %i\n", offset[0] + 1, offset[1] + 1);
}
