Farm#3617

Farm

2 seconds
256 megabytes
Easy

Spring has arrived, and the farmer is eager to enhance the fertility of his land, which measures x \times y meters. To achieve this, he has purchased fertilizers. With days remaining before the sowing season begins, the farmer aims to make the most of the available time.

Each day, the farmer can perform one of the following actions:

While the farmer enjoys fertilizing his land, he does not find calculations interesting. Your task is to help him with these calculations.

Input

The first line contains the integers and (1 \leq x, y \leq 1000). The second line contains the number of days left before sowing begins, (1 \leq n \leq 100000). Each of the following lines describes the farmer's actions for each day in one of the following formats:

  • 1\ x_1\ y_1\ x_2\ y_2\ w — the farmer fertilizes the specified section. (1 \leq x_1 \leq x_2 \leq x, 1 \leq y_1 \leq y_2 \leq y, -10000 \leq w \leq 10000)

  • 2\ x_1\ y_1\ x_2\ y_2 — the farmer asks for the total productivity of the specified section. (1 \leq x_1 \leq x_2 \leq x, 1 \leq y_1 \leq y_2 \leq y)

Output

For each query about the productivity of a section, output the total productivity for that section in a separate line.

Examples

Example 1

Loading
Loading