import java.util.*; public class PermArrayList { public static void perm(ArrayList L1,ArrayList L2){ if (L2.isEmpty()) System.out.println(L1); else for (int e : L2){ ArrayList A = (ArrayList)L1.clone(); ArrayList B = (ArrayList)L2.clone(); A.add(e); B.remove((Integer) e); perm(A,B); } } public static void main(String[] args){ int n = Integer.parseInt(args[0]); ArrayList A = new ArrayList(); ArrayList B = new ArrayList(); for (int i=0;i