Задана матрица, содержащая не более 10^6 элементов, которая разбита на r строк и c столбцов. Каждый элемент имеет свое местоположение (x, y), где 1 ≤ x ≤ r, 1 ≤ y ≤ c. Изначально все элементы равны нулю. Необходимо реализовать следующие операции:
In the above descriptions, submatrix (x1, y1, x2, y2) means all the elements (x, y) satisfying x1 ≤ x ≤ x2 and y1 ≤ x ≤ y2. It is guaranteed that 1 ≤ x1 ≤ x2 ≤ r, 1 ≤ y1 ≤ y2 ≤ c. After any operation, the sum of all the elements in the matrix will not exceed 10^9.
There are several test cases. The first line of each case contains three positive integers r, c, m, where m (1 ≤ m ≤ 20,000) is the number of operations. Each of the next m lines contains a query. There will be at most twenty rows in the matrix. The input is terminated by end-of-file (EOF). The size of input file does not exceed 500 KB.
For each type-3 query, print the summation, min and max.