Chef has a rectangular matrix A of nxm integers. Rows are numbered by integers from 1 to n from top to bottom, columns - from 1 to m from left to right. Ai, j denotes the j-th integer of the i-th row.
Chef wants you to guess his matrix. To guess integers, you can ask Chef questions of next type: "How many integers from submatrix iL, iR, jL, jR are grater than or equal to x and less than or equal to y?". By submatrix iL, iR, jL, jR we mean all elements Ai, j for all iL ≤ i ≤ iR and jL ≤ j ≤ jR. 
Also Chef can answer not more than C questions of next type: "What is the sum of integers from submatrix iL, iR, jL, jR?"
As soon as you think you know the Chefs matrix, you can stop asking questions and tell to the Chef your variant of the matrix. Please see "Scoring" part to understand how your solution will be evaluated. 
-----Input-----
The first line of the input contains three space-separated integers n, m and C denoting the sizes of the matrix and the maximum number of the second-type questions. After that the judge will answer your questions and evaluate the resuts. Read more about that in the "Interaction with the judge" part of the statement. 
-----Interaction with the judge-----
To ask a first-type question you should print to the standard output one line containing seven space-separated integers 1 iL iR jL jR x y. To ask a second-type question you should print one line containing five space-separated integers 2 iL iR jL jR. After that you should read from the standard input one integer - answer to the question. To end the game you should print 3 and starting from next line print n lines, each of them contains m space-separated integers - your variant of the matrix A. After that your program must stop. Remember to flush the output after every line you print.
-----Constraints-----
- 1 ≤ n, m ≤ 2.5 * 105
- 1 ≤ n * m ≤ 2.5 * 105
- 103 ≤ C ≤ 104
- 1 ≤ Ai, j ≤ 50
- 1 ≤ iL ≤ iR ≤ n
- 1 ≤ jL ≤ jR ≤ m
- 1 ≤ x ≤ y ≤ 50
- 0 ≤ number of asked questions ≤ 5 * 105
- 1 ≤ Bi, j ≤ 50
- 1 ≤ a1, a2, a3 ≤ 10
----- Scoring -----
Let B will be the matrix you output and diff = ∑ |Ai, j - Bi, j| for all 1 ≤ i ≤ n, 1 ≤ j ≤ m. The number of questions you asked is questions. The number of integers, you correctly guessed is correct(i. e. the number of elements i, j such that Ai, j = Bi, j). 
The score for each test case will be: score = a1 * questions +  a2 * diff +  a3 * (n * m - correct).
Your goal is to minimize this score.
Your total score for the problem will be the sum of scores on all the test cases.
-----Example-----
Input:
3 3 10
4
0
3
1
6
Output:
1 1 2 1 2 1 3
1 3 3 1 3 1 1
1 3 3 1 3 2 2
1 1 2 3 3 1 1
2 3 3 1 3
3
2 2 1
2 2 1
2 2 2
-----Explanation-----
[1, 2, 3]
A = [3, 2, 1]
[2, 2, 2]
For this test case a1 = 1, a2 = 1 and a3 = 1.
The score for this test case will be 1 * 5 + 1 * 4 + 1 * (9 - 6) = 12.
----- Test data generation -----
There will be four types of the test files.
- Type #1: n = 10,  m = 25000
- Type #2: n = 100,  m = 2500
- Type #3: n = 250,  m = 1000
- Type #4: n = 500,  m = 500
There will be 5 test files of each type. During the contest, you will be shown the score for only one test file of each type.
All elements of matrix A are randomly chosen.
For each test case C is randomly chosen from interval [103 .. 104].
For each test case values a1, a2 and a3 are manually chosen. 
import sys,numpy as np
def find_nearest(array,value):
       idx = (np.abs(array-value)).argmin()
       return array[idx]
       
n,m,c=list(map(int,input().split()))
max=[]
li=[]
options=[]
for i in range(1,51):
       print(1,1,n,1,m,i,i)
       sys.stdout.flush()
       ans=int(input())
       max.append(ans)
       li.append(ans)
max.sort()
max=max[::-1]

for i in range(50):
       options.append(li.index(max[i])+1)
       
array=np.array(options)       
k=1
li=[]
query=m
rem=0
if c<=query:
       query=c
       rem=m-query

for i in range(query):
       print(2,1,n,k,k+1-1)
       sys.stdout.flush()
       sum=int(input())
       li.append((sum/(n)))
       #print m,k
       if k>=m:break
       k+=1
print(3)
       
for i in range(n):
       for j in range(query):
              print(str(find_nearest(array,li[j])), end=' ')
       print(" ".join([str(options[0])]*rem))

       


       

       

import sys,numpy as np
def find_nearest(array,value):
       idx = (np.abs(array-value)).argmin()
       return array[idx]
       
n,m,c=list(map(int,input().split()))
max=[]
li=[]
options=[]
for i in range(1,51):
       print(1,1,n,1,m,i,i)
       sys.stdout.flush()
       ans=int(input())
       max.append(ans)
       li.append(ans)
max.sort()
max=max[::-1]

for i in range(50):
       options.append(li.index(max[i])+1)
       
array=np.array(options)       
k=1
li=[]
query=m
rem=0
if c<=query:
       query=c
       rem=m-query

for i in range(query):
       print(2,1,n,k,k+1-1)
       sys.stdout.flush()
       sum=int(input())
       li.append((sum/(n)))
       #print m,k
       if k>=m:break
       k+=1
print(3)
       
for i in range(n):
       for j in range(query):
              print(str(find_nearest(array,li[j])), end=' ')
       print(" ".join([str(options[0])]*rem))

       


       

       
