CPC '19 Contest 1 P0 - Shoes

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 64M

Problem type

Eric has a lot of shoes, way too many shoes.

On the floor, there are 4 shoes, labelled from 1 to 4. 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.


c_i, representing if the shoe is left or right, will always be equal to L or R. The amount of L and R will always be the same.

Input Specification

The first and only line of input will contain 4 space-separated characters, c_i, where i represents the index of the i^\text{th} shoe.

Output Specification

You are to output 2 pairs of integers (i, j), each on a separate line. Each pair represents a pair of shoes made between shoe i and shoe j.

The pairs can be printed in any order, and the numbers within each pair can be printed in any order.

Sample Input


Sample Output

1 2
3 4

Sample Explanation

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.


There are no comments at the moment.