408785: GYM103317 A Oseye Sort

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Oseye Sorttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Oseye, king of hot stuff, is a well-known dictator. Within his heated kingdom, he believes in using his power to maintain a high degree of order.

Avatar Tang and his group of $$$N$$$ friends, The Boomertang Squad, are trying to lay low and fit in by adopting the local customs. Tang's friends are labeled $$$1$$$ through $$$N$$$. At any point in time, this group might end up in the presence of guards. When this happens, they must either line up in ascending or descending order.

Given the number of friends and the desired order, help Tang order his friends properly.

Input

A single integer, $$$1 \leq N \leq 10$$$ and a character $$$x$$$ where $$$x$$$ is 'd' if you want descending order and 'a' if you want ascending order.

Output

Output $$$N$$$ integers, denoting the order of Tang's friends.

ExamplesInput
3 a
Output
1 2 3 
Input
4 d
Output
4 3 2 1 

加入题单

算法标签: