package sfs;
public class AllPaiLie {
public static char[] a={'A','B','C','D','E','F'};
public static char[] b={'h','h','h','h','h','h'};
public static int num=0;
public static boolean isRepeat(int k){
boolean at=true;
//for(int p=0;p<=m;p++){
for(int i=0;i<6;i++){
if(a[k]==b[i]){
at=false;
}
}
//}
return at;
}
public static void QuanPai(int n){
if(6==n){
num++;
System.out.print(" ");
return;
}
for(int i=0;i<6;i++){
if(isRepeat(i)){
b[i]=a[i];
System.out.print(a[i]);
QuanPai(n+1);
b[i]='h';
}
}
}
public static void main(String[] args){
QuanPai(0);
System.out.println(" ");
System.out.print(num);
}
}