全排列

全排列

暂无测试数据。

Background

Nothing here.

Description

Give n characters \(c_1,c_2,c_3...c_{n-1},c_n\), print the permutations of them.

Format

Input

On the first line:give a integer n, satisfying \( n \le 10 \).
On the second line:give n characters \(c_1,c_2,c_3...c_{n-1},c_n\), satisfying \(c_i\) (\( i \epsilon 1-n \)) \( \epsilon \) \( {A-Z},{a-z},{0-9} \),each one is separated by " "(one space).

Output

The permutations of the characters,the orders follow given(study the Sample).

Sample 1

Input

4
1 a 3 k

Output

1a3k
1ak3
13ak
13ka
1k3a
1ka3
a13k
a1k3
a31k
a3k1
ak31
ak13
3a1k
3ak1
31ak
31ka
3k1a
3ka1
ka31
ka13
k3a1
k31a
k13a
k1a3

Limitation

1s, 64MiB for each test case.

信息

ID
1005
难度
(无)
分类
(无)
标签
(无)
递交数
0
已通过
0
通过率
?
上传者