Tom Sawyer's friends take turns painting a fence with different colors. Each friend paints several consecutive segments of the fence in a certain color; the same color may be used more than once. New paint covers any previous paint.
The first line contains two integers (1 \leq N \leq 10^9) and (1 \leq K \leq 50000): the number of segments in the fence and the number of different colors, respectively.
The second line contains one integer (0 \leq M \leq 50000): the number of Tom Sawyer's friends.
Each of the next lines contains three integers c_i, l_i, r_i (1 \leq c_i \leq K, 1 \leq l_i \leq r_i \leq N): the color used by the -th friend, and the numbers of the first and last segments they painted, respectively.
Output integers in a single line: the -th integer should be the number of segments painted with the -th color after all friends have finished painting.
Пример 1