Sanggeun received N toy tanks for his birthday. He built a battlefield of size N by N on a wooden board and placed the tanks on distinct cells.
In one move, a tank may move to one of the four adjacent cells. A tank can attack every cell in its row and column, so it can be considered to protect that row and column.
No two tanks may occupy the same cell at the same time.
Before leaving for lunch, Sanggeun wants to rearrange the tanks so that every row and every column is protected by exactly one tank. In other words, the final arrangement must contain one tank in each row and one tank in each column.
Find a way to move the tanks using the minimum possible number of moves.
The first line contains the number of tanks N. (5 <= N <= 500)
Each of the next N lines contains the row R and column C of one tank. (1 <= R, C <= N) Rows are numbered from top to bottom, and columns are numbered from left to right, starting at 1.
No two tanks are initially placed on the same cell.
Print the minimum number of moves K on the first line.
Then print K lines. Each line must contain the number of the tank to move and the direction of that move. The tanks are numbered in input order: the first tank is 1, then 2, 3, ..., N.
Use L for left, R for right, U for up, and D for down.
If there are multiple valid answers, print any one of them.