SAC '22 Code Challenge 5 P2 - Querying Extensions

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

After looking at a truck with N extensions, Max realized that every second extension would move in the same direction (either left or right) when the vehicle swayed.

With this knowledge, Max wanted to figure out the direction the Nth extension would sway.

Can you help him?

Constraints

Subtask 1 [50%]

1N10

Subtask 2 [50%]

1N109

Input Specification

The first line will contain an integer, N, the truck's number of extensions.

The second line will contain either left or right, representing the direction that the first extension sways.

Output Specification

Output either left or right depending on the direction the Nth extension will sway.

Sample Input 1

Copy
2
left

Sample Output 1

Copy
right

Sample Input 2

Copy
15
right

Sample Output 2

Copy
right

Comments

There are no comments at the moment.