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 N^\text{th} extension would sway.

Can you help him?

Constraints

Subtask 1 [50%]

1 \le N \le 10

Subtask 2 [50%]

1 \le N \le 10^9

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 N^\text{th} extension will sway.

Sample Input 1

2
left

Sample Output 1

right

Sample Input 2

15
right

Sample Output 2

right

Comments

There are no comments at the moment.