Stuck in a Rut (Bronze)#10366

Stuck in a Rut (Bronze)

1 second
128 megabytes
Very easy

Farmer John has recently expanded the size of his farm, so from the perspective of his cows it is effectively now infinite in size! The cows think of the grazing area of the farm as an infinite 2D grid of square "cells", each filled with delicious grass (think of each cell as a square in an infinite chessboard). Each of Farmer John's cows starts out in a different cell; some start facing north, and some start facing east.

Every hour, every cow either

Over time, each cow therefore leaves a barren "rut" of empty cells behind her.

If two cows move onto the same grassy cell in the same move, they share the cell and continue moving in their respective directions in the next hour.

Please determine the amount of grass eaten by each cow. Some cows never stop, and therefore eat an infinite amount of grass.

Input

The first line contains (1 \leq n \leq 50). Each of the next lines describes the starting location of a cow, in terms of a character that is either N (for north-facing) or E (for east-facing) and two nonnegative integers and (0 \leq x \leq 10^9, 0 \leq y \leq 10^9) giving the coordinates of a cell. All -coordinates are distinct from each-other, and similarly for the -coordinates.

To be as clear as possible regarding directions and coordinates, if a cow is in cell (, ) and moves north, she ends up in cell (, y + 1). If she instead had moved east, she would end up in cell (x + 1, ).

Output

Print lines. Line should describe the number of cells worth of grass that the -th cow eats. If a cow eats an infinite amount of grass, output "Infinity" for that cow.

Examples

Example 1

Loading
Loading