#P450. 【例82.2】 座次问题
【例82.2】 座次问题
Description
In Little A's school, after solving the registration problem for the city competition, the teacher is now facing another challenge. There are students participating in the competition, and the teacher needs to arrange their seats. There are many possible arrangements, and the teacher wants to know what all the possible arrangements look like and how many different arrangements there are.
Please design a program to help the teacher. Output each possible arrangement of names, one arrangement per line, with names in each arrangement sorted according to their registration (input) order.
Input Format
The first line contains ;
The next lines contain names.
Due to the limited capacity of Little A's school, is less than or equal to 10.
Output Format
Output each possible arrangement of names, one arrangement per line, with names in each arrangement sorted according to their registration (input) order.
Sample
3
xiaowang
xiaoA
xiaolixiaowang xiaoA xiaoli
xiaowang xiaoli xiaoA
xiaoA xiaowang xiaoli
xiaoA xiaoli xiaowang
xiaoli xiaowang xiaoA
xiaoli xiaoA xiaowang