Problem: Find places where a R × C pattern is found within a H × W region. Print top-left coordinates (i, j) of sub-regions where the pattern found. The top-left and bottom-right coordinates of the region is (0, 0) and (H-1, W-1) respectively.

Constraints

* 1 ≤ H, W ≤ 1000
* 1 ≤ R, C ≤ 1000
* The input consists of alphabetical characters and digits

Input

In the first line, two integers H and W are given. In the following H lines, i-th lines of the region are given.

In the next line, two integers R and C are given. In the following R lines, i-th lines of the pattern are given.

Example

Input

4 5
00010
00101
00010
00100
3 2
10
01
10


Output

0 3
1 2

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define MOD 1000000007LL
#define C1  401
#define C2  397
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)

typedef long long ll;

using namespace std;

int h,w,r,c;

vector<vector<ll> > genHash(const vector<string> v, int xs, int ys)
{
  vector<vector<ll> > h1(xs,vector<ll>(ys,0));
  vector<vector<ll> > h2(xs,vector<ll>(ys,0));
  ll cn1 = 1, cn2 = 1;
  REP(i,c) cn1 = (cn1*C1)%MOD;
  REP(i,r) cn2 = (cn2*C2)%MOD;
  REP(i,xs)
  {
    ll h = 0;
    REP(j,c) h=(h*C1+v[i][j])%MOD;
    REP(j,ys-c+1)
    {
      h1[i][j] = h;
      if(j+c<ys) h = (h*C1-v[i][j]*cn1+v[i][j+c])%MOD;
      h = (h<0)?h+MOD:h;
    }
  }
  REP(j,ys)
  {
    ll h = 0;
    REP(i,r) h=(h*C2+h1[i][j])%MOD;
    REP(i,xs-r+1)
    {
      h2[i][j] = h;
      if(i+r<xs) h = (h*C2-h1[i][j]*cn2+h1[i+r][j])%MOD;
      h = (h<0)?h+MOD:h;
    }
  }
  return h2;
}

int main()
{
  cin >> h >> w;
  vector<string> a(h);
  REP(i,h) cin >> a[i];
  cin >> r >> c;
  vector<string> b(r);
  REP(i,r) cin >> b[i];
  if(h<r||w<c) return 0;
  auto f = genHash(a,h,w);
  auto p = genHash(b,r,c);
  REP(i,h-r+1) REP(j,w-c+1) if(f[i][j] == p[0][0])
    printf("%d %d\n",i,j);
  return 0;
}