Typing Champ
Problem Statement
Joseph uses his phone so often that he remembers how his fingers move to type in the six-digit passcode, but not the passcode itself. The keypad has the following layout.

His finger starts in the top left, and then his finger movements can be described by a sequence of actions. Each action is either a key press, or a movement up, down, left or right one position.
Given the sequence of actions, what is Joseph's passcode?
Input Format
The first line of input contains a single integer , the number of actions in the sequence. The second line contains a string of characters, representing the sequence of moves:
Lstands for a leftwards movement.Rstands for a rightwards movement.Ustands for a upwards movement.Dstands for a downwards movement.Pstands for a press of the key his finger is currently over.
Constraints
For all test cases:
- .
- Each character is either
L,R,U,D, orP. - The character
Pappears exactly six times.
Additionally:
- For test cases worth 50%, there are no
UorDmoves.
Output Format
Output a single string of digits, Joseph's six-digit passcode.
Sample Input
14
PPRPRPDDLUPLDP
Sample Output
112357
The diagram depicts the sequence of finger movements.
