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

~/algor $ cat problems/funksiya-teskari-son

Reversed number function

Easy 1000 ms 128 MB 30%
Share

Write a function Reverse(n) that returns the number obtained by writing the digits of the positive integer $n$ in reverse order. Leading zeros are dropped.

Example 1: Reverse(123) → 321

Example 2: Reverse(1200) → 21 — the leading zeros of $0021$ are dropped.

Write only the function body.

A number goes into the function Reverse, which returns the number with its digits reversed

Input

One line with a positive integer $n$ — the argument of the function.

Output

The value returned by the function: an integer.

Note

$1 \le n \le 10^{9}$

Examples

Input #1
123
Output #1
321
Input #2
1200
Output #2
21

Sign in to submit a solution

Signing up is free and takes a minute.