Eric has a lot of shoes, way too many shoes.
On the floor, there are shoes, labelled from to . Each of them are either for his left foot or for his right foot, and he wants to pair up each left shoe with a right shoe.
As there is more than one possible answer, you may output any of them. Furthermore, the input is guaranteed to have at least one valid solution.
, representing if the shoe is left or right, will always be equal to
R. The amount of
R will always be the same.
The first and only line of input will contain space-separated characters, , where represents the index of the shoe.
You are to output pairs of integers , each on a separate line. Each pair represents a pair of shoes made between shoe and shoe .
The pairs can be printed in any order, and the numbers within each pair can be printed in any order.
L R L R
1 2 3 4
We can pair up the first 2 shoes, and the last 2 shoes in order to make pairs. Another valid solution is to pair up the first and last shoe, and then the 2nd and 3rd shoe.