#include <bits/stdc++.h>
using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

struct RollingHash{
  LL H, W;
  const LL B1, B2, M;
  vector<vector<LL>> h;
  VL pow1, pow2;
  RollingHash(VS& str): B1(1009), B2(1007), M(1000000009){
	H = str.size(), W = str[0].size();
	h.assign(H+1, vector<LL>(W+1, 0));
	pow1.assign(H+1,1);
	pow2.assign(W+1,1);

	REP(i,H)
	  pow1[i+1] = pow1[i] * B1 % M;
	REP(i,W)
	  pow2[i+1] = pow2[i] * B2 % M;
	
	REP(y,H) REP(x,W){
	  h[y+1][x+1] = (h[y][x+1] * B1 % M + h[y+1][x] * B2 % M
						+ (M - h[y][x] * B1 % M * B2 % M) + str[y][x]) % M;
	}
  }

  LL hash(int x1, int y1, int x2, int y2){
	return (h[y2][x2]
			+ (M - h[y1][x2] * pow1[y2-y1] % M)
			+ (M - h[y2][x1] * pow2[x2-x1] % M)
			+ (h[y1][x1] * pow1[y2-y1] % M * pow2[x2-x1] % M)) % M;
  }
};



int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int H, W;
  cin >> H >> W;
  VS vs(H);
  REP(y,H) cin >> vs[y];
  int R, C;
  cin >> R >> C;
  VS pat(R);
  REP(y,R) cin >> pat[y];

  RollingHash rs(vs), pt(pat);
  LL target = pt.hash(0, 0, C, R);
  FOR(y,R,H+1) FOR(x,C,W+1){
	if(rs.hash(x-C, y-R, x, y) == target){
	  cout << y-R << " " << x-C << endl;
	}
  }

  return 0;
}
### Prompt

Create a solution in cpp for the following 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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

struct RollingHash{
  LL H, W;
  const LL B1, B2, M;
  vector<vector<LL>> h;
  VL pow1, pow2;
  RollingHash(VS& str): B1(1009), B2(1007), M(1000000009){
	H = str.size(), W = str[0].size();
	h.assign(H+1, vector<LL>(W+1, 0));
	pow1.assign(H+1,1);
	pow2.assign(W+1,1);

	REP(i,H)
	  pow1[i+1] = pow1[i] * B1 % M;
	REP(i,W)
	  pow2[i+1] = pow2[i] * B2 % M;
	
	REP(y,H) REP(x,W){
	  h[y+1][x+1] = (h[y][x+1] * B1 % M + h[y+1][x] * B2 % M
						+ (M - h[y][x] * B1 % M * B2 % M) + str[y][x]) % M;
	}
  }

  LL hash(int x1, int y1, int x2, int y2){
	return (h[y2][x2]
			+ (M - h[y1][x2] * pow1[y2-y1] % M)
			+ (M - h[y2][x1] * pow2[x2-x1] % M)
			+ (h[y1][x1] * pow1[y2-y1] % M * pow2[x2-x1] % M)) % M;
  }
};



int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int H, W;
  cin >> H >> W;
  VS vs(H);
  REP(y,H) cin >> vs[y];
  int R, C;
  cin >> R >> C;
  VS pat(R);
  REP(y,R) cin >> pat[y];

  RollingHash rs(vs), pt(pat);
  LL target = pt.hash(0, 0, C, R);
  FOR(y,R,H+1) FOR(x,C,W+1){
	if(rs.hash(x-C, y-R, x, y) == target){
	  cout << y-R << " " << x-C << endl;
	}
  }

  return 0;
}
```