Input:
1 2 3 4 5 8 9 10 4 5 8 11 7 5 3 1
Output:
7 5 3 1 4 5 8 11 5 8 9 10 1 2 3 4
A conventional logic would