Chestnut – the Green Symbol of Kyiv
The chestnut tree has long been a green emblem of Kyiv. In spring, its white and pink candle-like blossoms are a sight to behold, and in autumn, its shiny, lacquer-like fruits are a joy to collect.
Every resident of the capital feels it is their duty to know all about the chestnuts growing in the city. Kupilsky Rostyslav, born and raised in Kyiv, is unsure if he knows everything about this symbol of the capital. Therefore, he seeks your assistance.
To test Rostyslav's knowledge of chestnuts, he might be asked to calculate the total liters of water used for watering the chestnuts in a park area defined by the rectangle (x_1, y_1, x_2, y_2). Alternatively, he might be informed about the liters of water used for watering each tree within the rectangle (x_1, y_1, x_2, y_2).
Assist him in handling this task.
Input
The first line of the input file contains the numbers x, y (1 ≤ x, y ≤ 10^3), representing the dimensions of the park in question. The next line contains the number of queries. The following n (1 ≤ n ≤ 10^5) lines describe the queries in the following format:
1 x_1 y_1 x_2 y_2 w - Rostyslav is informed about the liters of water used for watering each tree (1 ≤ x_1 ≤ x_2 ≤ x, 1 ≤ y_1 ≤ y_2 ≤ y, -10^4 ≤ w ≤ 10^4).
2 x_1 y_1 x_2 y_2 - he is asked to calculate the total amount of water used for watering the chestnuts in the specified rectangle over the entire period (1 ≤ x_1 ≤ x_2 ≤ x, 1 ≤ y_1 ≤ y_2 ≤ y).
Output
For each query of the second type, output the result on a separate line.