B. Wet Shark and Coordinate Plane Game
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Wet Shark is now trying to help Dry Shark cheat in a game so that Dry Shark can win. The game is played on a regular xy coordinate grid. There is a stack of n cards. Wet Shark will hand all n cards to Dry Shark, in some order. When Dry Shark receives a card, he must move in the direction stated by the card.

In the game, there are 2 types of cards, as follows:

Type 1 cards are in the form “Right X, Left Y.” This means that Wet Shark must move right X units and then move left Y units, in that order.

Type 2 cards are in the form “Up X, Down Y.” This means that Wet Shark must move up X units and then move down Y units, in that order.

Dry Shark initially starts on the point (1, 1). If Wet Shark ever crosses or lands on the x or y axis after he is handed any card, he becomes consumed by the Evil Sharks, and therefore loses the game. If Wet Shark can hand Dry Shark the cards in some order so that he never gets consumed by the Evil Sharks, Dry Shark wins the game.

Determine if there is a way Wet Shark can hand Dry Shark the cards so that Dry Shark can win the game.

The Evil Sharks, however, still want to eat Dry Shark in the game. Therefore, help the Evil Sharks determine what point Dry Shark will land on if he wins.

Input

The first line contains an integer n (1 ≤ n ≤ 1000).

Each of the next n lines contains 3 space-separated integers ti, Xi, Yi (1 ≤ ti ≤ 2,  - 1000 ≤ Xi, Yi ≤ 1000), representing the type and values written on the ith card. If ti = 1, a Type 1 card is depicted; X and Y are the units Dry Shark is to move right and left, respectively. If ti = 2, a Type 2 card is depicted; X and Y are the units Dry Shark is to move up and down, respectively.

Output

On the first line of the output, output a single "YES" or "NO" (quotes for clarity). Output "YES" if Dry Shark can win and "NO" if Dry Shark cannot win.

If Dry Shark can win, output the coordinates of the point Wet Shark will be at after Wet Shark gives him all the cards. Check the sample output for the exact format.

Examples
Input
5
1 4 1
1 2 7
2 4 9
2 5 6
2 3 4
Output
NO
Input
2
1 50 1
2 2 1
Output
YES
(50, 2)
Note

Note that the Xi, Yi could be negative. Going right  - n blocks is equivalent to going left n blocks, and going up  - m blocks is equivalent to going down m blocks.