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

~/algor $ cat problems/rekursiya-1-dan-n-gacha-chop-etish

Print from 1 to N

Easy 1000 ms 64 MB 20%
Share

You are given a positive integer $n$. Using a recursive function, print all integers from $1$ to $n$ in ascending order on one line, separated by spaces.

Do not use loops (for, while) — only a recursive function.

The calls go down from n to 1, and the numbers are printed on the way back from 1 to n

Input

One line with one positive integer $n$ ($1 \le n \le 100$).

Output

The numbers from $1$ to $n$ separated by spaces.

Note

$1 \le n \le 100$

Examples

Input #1
1
Output #1
1
Input #2
5
Output #2
1 2 3 4 5

Sign in to submit a solution

Signing up is free and takes a minute.