1. 程式人生 > >2017年上海金馬五校程式設計競賽:Problem A : STEED Cards

2017年上海金馬五校程式設計競賽:Problem A : STEED Cards

Time Limit: 1 s

Description

Corn does not participate the STEED contest, but he is interested in the word "STEED". So, Corn writes all permutations of the word "STEED" on different cards and gets 60 cards finally.

Corn sorts these cards in lexicographical order, and marks them from 1 to 60.

Now, Corn gives you a integer N

 (1 ≤ N ≤ 60), could you tell him the word on the Nth card?

Input

There are multiple test cases (no more than 60).
For each test case, there is one integer N (1 ≤ N ≤ 60) in a line.

Output

For each test case, you should output one line with the word on the Nth card.

Sample Input

1
2
3
4
47
48
49

Sample Output

DEEST
DEETS
DESET
DESTE
STEDE
STEED
TDEES