Perform Bitwise Shifts

You are given an integer n (in base-10) and a string left or right indicating the direction of the bitwise shift. You are also given an integer k indicating the number of positions by which n should be shifted.

Write a program that prints the result after performing the bitwise shift operation.

Input

The first line contains a single integer n (0 ≤ n ≤ ).

The second line contains a string, either left or right, indicating the direction of the bitwise shift.

The third line contains a single integer k (0 ≤ k ≤ 16).

Output

The number n after performing the bitwise shift operation.

Examples

Input

Output

3
left
2

12

5
right
1

2

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue