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

π‘

For example, if we left shift the integer 3 (11 in binary) by 1 position, it becomes 110, which is 6 in base-10.

Similarly, if we right shift the integer 4 (100 in binary) by 2 positions, it becomes 1, which is 1 in base-10.

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

Input

The first line contains a single integer ().

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

The third line contains a single integer ().

Output

The number after performing the bitwise shift operation.