import java.util.*;/*** 数组全排序* @author Green.Gee* @date 2022/11/18 20:33* @email green.gee.lu@gmail.com*/
public class FullMutation {// 数组元素全排列public static void main(String[] args) {Scanner in = new Scanner(System.in);// 示例 1 2 3while (in.hasNextInt()) { // 注意 while 处理多个 caseint a = in.nextInt();int b = in.nextInt();int c = in.nextInt();int[] arr = new int[]{a,b,c};// 递归方法
// mutation(arr,0,arr.length - 1);// 插入组合方法mutation(arr);}}static void swap(int [] arr,int i,int j){int temp = arr[i];arr[i] = arr[j];arr[j] = temp;}public static void mutation(int [] arr){List> res = new LinkedList<>();res.add(0,Arrays.asList(arr[0]));for(int i = 1; i < arr.length; i++){List> temp_res = new LinkedList<>();List next = Arrays.asList(arr[i]);for(List item : res){List p = new LinkedList<>();p.addAll(next);p.addAll(item);temp_res.add(p);List n = new LinkedList<>();n.addAll(item);n.addAll(next);temp_res.add(n);for(int j = 1; j < item.size(); j++){List m = new LinkedList<>();m.addAll(item.subList(0,j));m.addAll(next);m.addAll(item.subList(j,item.size()));temp_res.add(m);}}res = temp_res;}System.err.println(res.toString());}public static void mutation(int [] arr,int start,int end){if(start == end){System.out.println(Arrays.toString(arr));return;}for(int i = start;i <= end;i++){swap(arr,start,i);mutation(arr,start + 1,end);swap(arr,start,i);}}}