Skip to main content

~/algor $ cat contests/round-8/G

G. Swap the outer digits

Problem G ICPC rules 1000 ms 64 MB

A four-digit positive integer is given. Find the number obtained by swapping its first and last digits: gives . Leading zeros of the result are not written: for example, gives .

The first and fourth digits of the four-digit number swap places

Input

One four-digit positive integer .

Output

One integer — the number with swapped outer digits.

Note

Examples

Input #1
1234
Output #1
4231
Input #2
1230
Output #2
231

Sign in to submit a solution

Signing up is free and takes a minute.