import collections as cl
import math
N = int(input())


def f(n):
    if n == 1:
        return [1]
    n_1 = f(n - 1)
    return n_1 + [n] + n_1


print(*f(N))

8a353cd478d3277589e87166171e31e16b062c6a
<mask token>


def f(n):
    if n == 1:
        return [1]
    n_1 = f(n - 1)
    return n_1 + [n] + n_1


<mask token>

<mask token>


def f(n):
    if n == 1:
        return [1]
    n_1 = f(n - 1)
    return n_1 + [n] + n_1


print(*f(N))

<mask token>
N = int(input())


def f(n):
    if n == 1:
        return [1]
    n_1 = f(n - 1)
    return n_1 + [n] + n_1


print(*f(N))

import collections as cl
import math
N = int(input())


def f(n):
    if n == 1:
        return [1]
    n_1 = f(n - 1)
    return n_1 + [n] + n_1


print(*f(N))
