Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/integer-yarimlarni-almashtirish

Swap the halves

Easy 1000 ms 64 MB 16%
Share

A four-digit positive integer $n$ is given. Find the number obtained by swapping the part made of its first two digits with the part made of its last two digits: $1234$ gives $3412$. Leading zeros of the result are not written: for example, $1205$ gives $512$ and $1200$ gives $12$.

The four-digit number is split into two-digit parts that swap places

Input

One four-digit positive integer $n$.

Output

One integer — the number with swapped halves.

Note

$1000 \le n \le 9999$

Examples

Input #1
1234
Output #1
3412
Input #2
1205
Output #2
512

Sign in to submit a solution

Signing up is free and takes a minute.