The segment of numerical axis from 0 to 10^{9} is painted into white color. After that some parts of this segment are painted into black, then some into white again and so on. In total there have been made N repaintings (1 ≤ N ≤ 5000). You are to write a program that finds the longest white open interval after this sequence of repaintings.
Input
The first line of input contains the only number N. Next N lines contain information about repaintings. Each of these lines has a form:
a_{i} b_{i} c_{i}
where a_{i} and b_{i} are integers, c_{i} is symbol 'b' or 'w', a_{i}, b_{i}, c_{i} are separated by spaces.
This triple of parameters represents repainting of segment from a_{i} to b_{i} into color c_{i} ('w' — white, 'b' — black). You may assume that 0 < a_{i} < b_{i} < 10^{9}.
Output
Output should contain two numbers x and y (x < y) divided by space(s). These numbers should define the longest white open interval. If there are more than one such an interval output should contain the one with the smallest x.
Sample
input  output 

4
1 999999997 b
40 300 w
300 634 w
43 47 b
 47 634

Problem Source: Ural State University Internal Contest '99 #2