生成排列 Generating Permutations

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=229&page=show_problem&problem=3076 [PDF](https://uva.onlinejudge.org/external/119/p11925.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11925/4ae01d3bad0e00d10dd54ea1a36732d8994153c9.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11925/39a915f8fa7c330f6d88d2084592f1cdbcc50f29.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11925/b09493d267f3d2d325027cbace89abb524055c4a.png)

输入输出样例

输入样例 #1

3 2 1 3
3 2 3 1
4 4 2 3 1
0

输出样例 #1

1
2
12122