#include<bits/stdc++.h>
using namespace std;
int n;
int a[10],vis[10];
void dfs(int step,string s){
	if(step>n){
		cout<<s<<endl;
		return;
	}
	for(int i=1;i<=n;i++){
		if(vis[i]==0){
			vis[i]=1;
			dfs(step+1,s+char(a[i]+'0')+" ");
			vis[i]=0;
		}
	}
	
}
/**************************************************************
	Problem: 1685
	User: fuhongyi
	Language: C++
	Result: Compile Error
****************************************************************/