Cow Rectangles
The locations of Farmer John's n cows are described by distinct points in the 2D plane. The cows belong to two different breeds: Holsteins and Guernseys. Farmer John wants to build a rectangular fence with sides parallel to the coordinate axes enclosing only Holsteins, with no Guernseys (a cow counts as enclosed even if it is on the boundary of the fence). Among all such fences, Farmer John wants to build a fence enclosing the maximum number of Holsteins. And among all these fences, Farmer John wants to build a fence of minimum possible area. Please determine this area. A fence of zero width or height is allowable.
Input
The first line contains n (1 ≤ n ≤ 500). Each of the next n lines describes a cow, and contains two integers and a character. The integers indicate a point (x, y) (0 ≤ x, y ≤ 1000) at which the cow is located. The character is H or G, indicating the cow's breed. No two cows are located at the same point, and there is always at least one Holstein.
Output
Print two integers. The first line should contain the maximum number of Holsteins that can be enclosed by a fence containing no Guernseys, and second line should contain the minimum area enclosed by such afence.