LearnPy Hub
← Recursion & Lambda problems
Medium

Down and Up

Write a recursive function that, for n, prints n down to 1 and then 1 back up to n, all on one line separated by spaces.

Input

One integer n ≥ 1.

Output

One line.

Sample 1

Input
3
Output
3 2 1 1 2 3

Sample 2

Input
1
Output
1 1
solution.py
Output appears here
Down and Up · Python practice problem · LearnPy Hub