def pancakeSort(A):
        res=[]
        for i in range(len(A),1,-1):
            A = A[:A.index(i)-1]+A[:A.index(i)]
            res.append(A.index(i)+1)
            res.append(i)
        return res
A=eval(input())
a=pancakeSort(A)
while(1 in a):
    a.pop(a.index(1))
print(a)
2f129ae80bce8409a1a14fbc43db218815a0757d
<mask token>

def pancakeSort(A):
    res = []
    for i in range(len(A), 1, -1):
        A = A[:A.index(i) - 1] + A[:A.index(i)]
        res.append(A.index(i) + 1)
        res.append(i)
    return res


<mask token>

def pancakeSort(A):
    res = []
    for i in range(len(A), 1, -1):
        A = A[:A.index(i) - 1] + A[:A.index(i)]
        res.append(A.index(i) + 1)
        res.append(i)
    return res


<mask token>
while 1 in a:
    a.pop(a.index(1))
print(a)

def pancakeSort(A):
    res = []
    for i in range(len(A), 1, -1):
        A = A[:A.index(i) - 1] + A[:A.index(i)]
        res.append(A.index(i) + 1)
        res.append(i)
    return res


A = eval(input())
a = pancakeSort(A)
while 1 in a:
    a.pop(a.index(1))
print(a)

def pancakeSort(A):
        res=[]
        for i in range(len(A),1,-1):
            A = A[:A.index(i)-1]+A[:A.index(i)]
            res.append(A.index(i)+1)
            res.append(i)
        return res
A=eval(input())
a=pancakeSort(A)
while(1 in a):
    a.pop(a.index(1))
print(a)