import java.util.*;
public class FullMutation {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {
int a = in.nextInt();
int b = in.nextInt();
int c = in.nextInt();
int[] arr = new int[]{a,b,c};
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<List<Integer>> res = new LinkedList<>();
res.add(0,Arrays.asList(arr[0]));
for(int i = 1; i < arr.length; i++){
List<List<Integer>> temp_res = new LinkedList<>();
List<Integer> next = Arrays.asList(arr[i]);
for(List<Integer> item : res){
List<Integer> p = new LinkedList<>();
p.addAll(next);
p.addAll(item);
temp_res.add(p);
List<Integer> n = new LinkedList<>();
n.addAll(item);
n.addAll(next);
temp_res.add(n);
for(int j = 1; j < item.size(); j++){
List<Integer> 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);
}
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89