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

~/algor $ cat problems/rekursiya-raqamlarni-teskari-chop-etish

Print digits in reverse

Easy 1000 ms 64 MB 29%
Share

You are given a positive integer $n$. Using a recursive function, print the digits of this number starting from the last one (right to left) on one line, separated by spaces.

For example, for $1234$ the output must be 4 3 2 1.

The digits of the number are printed in reverse order

Input

One line with one positive integer $n$ ($1 \le n \le 10^9$).

Output

The digits of $n$ in reverse order, separated by spaces.

Note

$1 \le n \le 10^9$

Examples

Input #1
1234
Output #1
4 3 2 1
Input #2
507
Output #2
7 0 5

Sign in to submit a solution

Signing up is free and takes a minute.