Artist
M. Kalevich, while working on his futuristic masterpiece, has developed an interest in creating one-dimensional black-and-white drawings. He aims to determine the best placement and quantity of black segments in these drawings. To achieve this, he draws segments on a line, alternating between black and white. After each drawing operation, he wants to know how many black segments are present and their total length.
Initially, the entire line is white. Your task is to write a program that provides the artist with the desired information after each operation.
Input
The first line of the input specifies the number of segments N (1 ≤ N ≤ 100000) that will be drawn. The following N lines describe each operation. Each operation is formatted as c x l, where c indicates the color of the segment (W for white, B for black), and the segment is defined by the interval [x; x+l]. The coordinates of the segment's endpoints are integers, each not exceeding 500000 in absolute value. The length l is a positive integer.
Output
For each operation, output a line containing two numbers: the count of black segments and their total length, separated by a space.