Integer
Integer-35
Integer-36
Integer-37
~/algor $ cat problems/integer-chetki-raqamlarni-almashtirish
Swap the outer digits
Medium
1000 ms
64 MB
36%
A four-digit positive integer $n$ is given. Find the number obtained by swapping its first and last digits: $1234$ gives $4231$. Leading zeros of the result are not written: for example, $1230$ gives $231$.
Input
One four-digit positive integer $n$.
Output
One integer — the number with swapped outer digits.
Note
$1000 \le n \le 9999$
Examples
Input #1
1234
Output #1
4231
Input #2
1230
Output #2
231