The Unknown Trading Company have installed a new inventory-tracking system, which
stores a complete database of goods and trading points worldwide.
Each salespoint and each item was assigned an integer unique identifier (id).
For every sale, the system logs id of the item, number of items sold, and id of the salespoint.

Your task is to output a summary report, tabulating total sales by items and salespoints.
The report must be a two-dimensional table, with the first row containing item ids in increasing order,
first column containing salespoint ids in increasing order, and values inside the table
representing total sales of corresponding item from the corresponding salespoint.
The value in first column of the first row must be −1.
The values in cells without corresponding sales must be 0.

Input file format

Input contains number of records N, followed by N triplets of integers
q_{i}s_{i}v_{i}, where
q_{i} — item id,
s_{i} — salespoint id,
v_{i} — number of items sold.

Output file format

Output file must a table as described above, row-by-row.

Constraints

1 ≤ N ≤ 500000,
1 ≤ q_{i}, s_{i}, v_{i} ≤ 10^{9},
the summary table will have no more than 10^{8} cells,
the summary value in each cell will not exceed than 2^{31}−1.