#Lutece1855. Zero One Problem

Zero One Problem

Migrated from Lutece 1855 Zero One Problem

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Given a matrix only consisting 0 and 1. In this problem you should find the difference of two given sub-matrix.

Input

The first line of the input contains two integers H,WH,W(1H,W10001\leq H,W \leq 1000), the height and width of the matrix.

Then HH lines follows, each contains a string SiS_i(Si=W|S_i|=W), representing the ithi^{th} row of the matrix. SiS_i contains only 0 and 1.

The next line contains number of query QQ (Q105Q\leq 10^5).

Each question contains eight integers l1l_1,r1r_1,l2l_2,r2r_2,l3l_3,r3r_3,l4l_4,r4r_4

(0li<H,0ri<W,l1l2,r1r2,l3l4,r3r4,l2l1+1=l4l3+1,r2r1+1=r4r3+10\leq l_i <H,0 \leq r_i <W,l_1\leq l_2,r_1\leq r_2,l_3\leq l_4,r_3\leq r_4,l_2-l_1+1=l_4-l_3+1,r_2-r_1+1=r_4-r_3+1), denote the top-left point and bottom-right point of the first and second sub-matrix.

Output

For each query output one line which means the answer.

If they are the same sub-rectangle, print the word Perfect

If they are different in one cell, print the sentence One difference

Otherwise print the word Wrong on a single line.

Samples

输入数据 1

3 4
0011
0010
0000
1
0 0 1 2 1 0 2 2

输出数据 1

One difference

Resources

The 16th UESTC Programming Contest Preliminary