11718 - Left Right   

Description

(6 points)

Given a sequence of Left and Right operations, calculate the answer.

'Lab' means Left(a, b), which will choose the left element, and the answer is a.
'Rcd' means Right(c, d), which will choose the right element, and the answer is d.

For a longer sequence such as 'RLxyRRefLmn', it means
Right(Left(x, y), Right(Right(e, f), Left(m, n)))
and the answer is m.

Input

A sequence of Left and Right operations.
Operands are lowercase letters from 'a' to 'z'.

'L' denotes Left and 'R' denotes Right.

There is a symbol '=' at the end of input. 

No blanks between elements.

The length of input (including '=') is less than 40.

Output

Print the answer.

Remeber there have to be a newline character in the end.

Sample Input  Download

Sample Output  Download

Tags




Discuss