aboutsummaryrefslogtreecommitdiff
path: root/day16
diff options
context:
space:
mode:
Diffstat (limited to 'day16')
-rw-r--r--day16/Dockerfile7
-rw-r--r--day16/Makefile17
-rwxr-xr-xday16/entrypoint13
-rw-r--r--day16/input4209
-rwxr-xr-xday16/part1116
-rwxr-xr-xday16/whodawhatnow141
6 files changed, 4503 insertions, 0 deletions
diff --git a/day16/Dockerfile b/day16/Dockerfile
new file mode 100644
index 0000000..5e0a8b7
--- /dev/null
+++ b/day16/Dockerfile
@@ -0,0 +1,7 @@
+FROM ruby:2.5-slim
+
+WORKDIR /opt
+
+COPY . .
+
+ENTRYPOINT ["./entrypoint"]
diff --git a/day16/Makefile b/day16/Makefile
new file mode 100644
index 0000000..703fbcf
--- /dev/null
+++ b/day16/Makefile
@@ -0,0 +1,17 @@
+DAY = 16
+
+.PHONY: run clean push
+
+run: build
+ docker run -it --rm aoc2018day$(DAY)
+
+build: part* input
+ docker build -t aoc2018day$(DAY) .
+ touch build
+
+clean:
+ rm -f build
+
+push: build
+ docker tag aoc2018day$(DAY) advent.4574.co.uk/aoc2018day$(DAY)
+ docker push advent.4574.co.uk/aoc2018day$(DAY)
diff --git a/day16/entrypoint b/day16/entrypoint
new file mode 100755
index 0000000..8982d21
--- /dev/null
+++ b/day16/entrypoint
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if [ -x part1 ] ; then
+ echo -ne "Part 1:\n\t"
+ time ./part1 < input
+fi
+if [ -x part1 -a -x part2 ] ; then
+ echo
+fi
+if [ -x part2 ] ; then
+ echo -ne "Part 2:\n\t"
+ time ./part2 < input
+fi
diff --git a/day16/input b/day16/input
new file mode 100644
index 0000000..6e8da3a
--- /dev/null
+++ b/day16/input
@@ -0,0 +1,4209 @@
+Before: [0, 2, 2, 2]
+11 3 3 3
+After: [0, 2, 2, 0]
+
+Before: [3, 2, 1, 1]
+11 2 3 3
+After: [3, 2, 1, 0]
+
+Before: [1, 2, 2, 1]
+5 3 2 2
+After: [1, 2, 1, 1]
+
+Before: [1, 0, 2, 2]
+14 0 2 2
+After: [1, 0, 0, 2]
+
+Before: [3, 2, 3, 3]
+10 1 3 3
+After: [3, 2, 3, 0]
+
+Before: [1, 1, 2, 1]
+14 0 2 3
+After: [1, 1, 2, 0]
+
+Before: [2, 1, 2, 0]
+6 2 2 0
+After: [1, 1, 2, 0]
+
+Before: [1, 1, 3, 1]
+13 1 2 0
+After: [0, 1, 3, 1]
+
+Before: [1, 1, 1, 3]
+10 2 3 1
+After: [1, 0, 1, 3]
+
+Before: [3, 3, 0, 2]
+3 2 3 0
+After: [1, 3, 0, 2]
+
+Before: [2, 1, 1, 0]
+4 1 0 2
+After: [2, 1, 0, 0]
+
+Before: [2, 3, 3, 2]
+7 3 1 0
+After: [1, 3, 3, 2]
+
+Before: [1, 0, 2, 1]
+12 0 1 0
+After: [1, 0, 2, 1]
+
+Before: [0, 1, 0, 0]
+0 0 3 3
+After: [0, 1, 0, 0]
+
+Before: [0, 1, 2, 1]
+0 0 1 0
+After: [0, 1, 2, 1]
+
+Before: [0, 2, 1, 0]
+0 0 1 0
+After: [0, 2, 1, 0]
+
+Before: [3, 0, 3, 2]
+7 3 0 1
+After: [3, 1, 3, 2]
+
+Before: [1, 3, 2, 2]
+7 3 1 2
+After: [1, 3, 1, 2]
+
+Before: [0, 3, 1, 3]
+9 0 0 2
+After: [0, 3, 0, 3]
+
+Before: [0, 1, 1, 3]
+0 0 3 0
+After: [0, 1, 1, 3]
+
+Before: [1, 1, 2, 3]
+2 1 2 1
+After: [1, 0, 2, 3]
+
+Before: [3, 3, 3, 2]
+7 3 0 1
+After: [3, 1, 3, 2]
+
+Before: [1, 1, 2, 3]
+2 1 2 3
+After: [1, 1, 2, 0]
+
+Before: [1, 0, 2, 1]
+5 3 2 1
+After: [1, 1, 2, 1]
+
+Before: [3, 1, 1, 1]
+1 2 2 0
+After: [2, 1, 1, 1]
+
+Before: [1, 2, 2, 0]
+14 0 2 1
+After: [1, 0, 2, 0]
+
+Before: [0, 3, 1, 1]
+1 2 2 0
+After: [2, 3, 1, 1]
+
+Before: [3, 3, 2, 2]
+11 3 3 3
+After: [3, 3, 2, 0]
+
+Before: [0, 1, 3, 3]
+8 3 2 3
+After: [0, 1, 3, 1]
+
+Before: [0, 3, 2, 0]
+0 0 3 3
+After: [0, 3, 2, 0]
+
+Before: [0, 3, 3, 2]
+0 0 2 2
+After: [0, 3, 0, 2]
+
+Before: [3, 1, 3, 3]
+10 1 3 1
+After: [3, 0, 3, 3]
+
+Before: [1, 1, 1, 1]
+11 3 3 2
+After: [1, 1, 0, 1]
+
+Before: [0, 1, 1, 1]
+0 0 2 1
+After: [0, 0, 1, 1]
+
+Before: [1, 0, 0, 3]
+12 0 1 2
+After: [1, 0, 1, 3]
+
+Before: [0, 0, 3, 2]
+15 3 2 0
+After: [2, 0, 3, 2]
+
+Before: [3, 0, 1, 1]
+12 3 1 0
+After: [1, 0, 1, 1]
+
+Before: [3, 1, 0, 2]
+3 2 3 3
+After: [3, 1, 0, 1]
+
+Before: [0, 2, 0, 3]
+0 0 1 2
+After: [0, 2, 0, 3]
+
+Before: [3, 2, 0, 2]
+3 2 3 3
+After: [3, 2, 0, 1]
+
+Before: [2, 1, 0, 0]
+4 1 0 1
+After: [2, 0, 0, 0]
+
+Before: [1, 1, 2, 1]
+14 0 2 1
+After: [1, 0, 2, 1]
+
+Before: [1, 3, 2, 3]
+14 0 2 3
+After: [1, 3, 2, 0]
+
+Before: [0, 2, 2, 3]
+9 0 0 3
+After: [0, 2, 2, 0]
+
+Before: [1, 1, 2, 0]
+2 1 2 1
+After: [1, 0, 2, 0]
+
+Before: [3, 0, 1, 2]
+1 2 2 0
+After: [2, 0, 1, 2]
+
+Before: [0, 1, 2, 1]
+2 1 2 3
+After: [0, 1, 2, 0]
+
+Before: [0, 3, 3, 2]
+7 3 1 0
+After: [1, 3, 3, 2]
+
+Before: [3, 3, 2, 1]
+5 3 2 0
+After: [1, 3, 2, 1]
+
+Before: [2, 1, 2, 2]
+2 1 2 0
+After: [0, 1, 2, 2]
+
+Before: [3, 1, 2, 3]
+2 1 2 3
+After: [3, 1, 2, 0]
+
+Before: [1, 2, 2, 3]
+10 2 3 0
+After: [0, 2, 2, 3]
+
+Before: [3, 3, 2, 1]
+5 3 2 2
+After: [3, 3, 1, 1]
+
+Before: [2, 1, 0, 3]
+4 1 0 0
+After: [0, 1, 0, 3]
+
+Before: [2, 1, 2, 3]
+4 1 0 2
+After: [2, 1, 0, 3]
+
+Before: [3, 3, 0, 3]
+8 3 0 3
+After: [3, 3, 0, 1]
+
+Before: [2, 1, 0, 3]
+4 1 0 3
+After: [2, 1, 0, 0]
+
+Before: [3, 1, 2, 1]
+2 1 2 2
+After: [3, 1, 0, 1]
+
+Before: [3, 3, 0, 2]
+3 2 3 3
+After: [3, 3, 0, 1]
+
+Before: [2, 2, 0, 1]
+11 3 3 2
+After: [2, 2, 0, 1]
+
+Before: [1, 1, 2, 0]
+14 0 2 0
+After: [0, 1, 2, 0]
+
+Before: [3, 2, 1, 3]
+10 1 3 1
+After: [3, 0, 1, 3]
+
+Before: [2, 1, 2, 3]
+2 1 2 2
+After: [2, 1, 0, 3]
+
+Before: [3, 2, 3, 3]
+15 1 2 2
+After: [3, 2, 2, 3]
+
+Before: [1, 1, 3, 0]
+3 3 2 0
+After: [1, 1, 3, 0]
+
+Before: [3, 3, 3, 3]
+8 3 2 1
+After: [3, 1, 3, 3]
+
+Before: [0, 1, 1, 1]
+9 0 0 3
+After: [0, 1, 1, 0]
+
+Before: [3, 0, 0, 2]
+3 2 3 2
+After: [3, 0, 1, 2]
+
+Before: [0, 2, 2, 2]
+9 0 0 1
+After: [0, 0, 2, 2]
+
+Before: [2, 1, 2, 1]
+2 1 2 2
+After: [2, 1, 0, 1]
+
+Before: [0, 1, 1, 3]
+0 0 3 2
+After: [0, 1, 0, 3]
+
+Before: [3, 2, 1, 3]
+8 3 0 1
+After: [3, 1, 1, 3]
+
+Before: [3, 1, 3, 3]
+13 1 2 3
+After: [3, 1, 3, 0]
+
+Before: [2, 1, 3, 2]
+6 2 1 1
+After: [2, 0, 3, 2]
+
+Before: [2, 3, 2, 3]
+8 2 0 3
+After: [2, 3, 2, 1]
+
+Before: [0, 0, 1, 3]
+0 0 1 3
+After: [0, 0, 1, 0]
+
+Before: [2, 1, 2, 1]
+8 2 0 0
+After: [1, 1, 2, 1]
+
+Before: [1, 0, 3, 3]
+12 0 1 3
+After: [1, 0, 3, 1]
+
+Before: [3, 2, 2, 1]
+5 3 2 2
+After: [3, 2, 1, 1]
+
+Before: [3, 3, 2, 2]
+7 3 1 1
+After: [3, 1, 2, 2]
+
+Before: [2, 2, 2, 1]
+8 2 0 1
+After: [2, 1, 2, 1]
+
+Before: [1, 3, 2, 0]
+14 0 2 0
+After: [0, 3, 2, 0]
+
+Before: [2, 3, 3, 2]
+15 3 2 3
+After: [2, 3, 3, 2]
+
+Before: [2, 0, 2, 3]
+10 2 3 1
+After: [2, 0, 2, 3]
+
+Before: [0, 3, 2, 2]
+7 3 1 2
+After: [0, 3, 1, 2]
+
+Before: [3, 0, 2, 2]
+7 3 0 2
+After: [3, 0, 1, 2]
+
+Before: [1, 0, 2, 3]
+10 2 3 1
+After: [1, 0, 2, 3]
+
+Before: [0, 0, 3, 2]
+11 3 3 3
+After: [0, 0, 3, 0]
+
+Before: [1, 0, 2, 1]
+12 0 1 2
+After: [1, 0, 1, 1]
+
+Before: [1, 0, 2, 1]
+5 3 2 3
+After: [1, 0, 2, 1]
+
+Before: [1, 3, 2, 2]
+11 3 3 3
+After: [1, 3, 2, 0]
+
+Before: [2, 2, 3, 0]
+15 1 2 0
+After: [2, 2, 3, 0]
+
+Before: [2, 3, 3, 2]
+15 3 2 2
+After: [2, 3, 2, 2]
+
+Before: [3, 3, 0, 3]
+8 3 0 1
+After: [3, 1, 0, 3]
+
+Before: [2, 2, 2, 3]
+6 3 1 0
+After: [0, 2, 2, 3]
+
+Before: [3, 1, 2, 3]
+2 1 2 1
+After: [3, 0, 2, 3]
+
+Before: [2, 1, 2, 0]
+8 2 0 1
+After: [2, 1, 2, 0]
+
+Before: [1, 1, 2, 3]
+14 0 2 2
+After: [1, 1, 0, 3]
+
+Before: [0, 2, 1, 2]
+9 0 0 1
+After: [0, 0, 1, 2]
+
+Before: [0, 1, 0, 3]
+10 1 3 1
+After: [0, 0, 0, 3]
+
+Before: [1, 3, 2, 0]
+14 0 2 1
+After: [1, 0, 2, 0]
+
+Before: [2, 0, 2, 3]
+10 2 3 3
+After: [2, 0, 2, 0]
+
+Before: [0, 3, 1, 1]
+0 0 1 2
+After: [0, 3, 0, 1]
+
+Before: [1, 3, 2, 3]
+14 0 2 2
+After: [1, 3, 0, 3]
+
+Before: [0, 2, 1, 1]
+6 0 0 0
+After: [1, 2, 1, 1]
+
+Before: [2, 1, 2, 1]
+2 1 2 0
+After: [0, 1, 2, 1]
+
+Before: [0, 1, 2, 0]
+2 1 2 0
+After: [0, 1, 2, 0]
+
+Before: [0, 0, 3, 1]
+11 3 3 0
+After: [0, 0, 3, 1]
+
+Before: [3, 0, 2, 1]
+12 3 1 1
+After: [3, 1, 2, 1]
+
+Before: [3, 0, 0, 1]
+12 3 1 1
+After: [3, 1, 0, 1]
+
+Before: [3, 0, 2, 1]
+12 3 1 2
+After: [3, 0, 1, 1]
+
+Before: [0, 0, 2, 1]
+5 3 2 0
+After: [1, 0, 2, 1]
+
+Before: [2, 1, 1, 0]
+4 1 0 0
+After: [0, 1, 1, 0]
+
+Before: [0, 2, 1, 0]
+6 0 0 0
+After: [1, 2, 1, 0]
+
+Before: [2, 0, 2, 1]
+5 3 2 1
+After: [2, 1, 2, 1]
+
+Before: [3, 3, 1, 3]
+1 2 2 2
+After: [3, 3, 2, 3]
+
+Before: [0, 0, 1, 1]
+12 3 1 2
+After: [0, 0, 1, 1]
+
+Before: [1, 0, 3, 0]
+3 3 2 3
+After: [1, 0, 3, 1]
+
+Before: [1, 0, 1, 2]
+12 2 1 3
+After: [1, 0, 1, 1]
+
+Before: [0, 1, 1, 3]
+10 2 3 3
+After: [0, 1, 1, 0]
+
+Before: [3, 3, 0, 2]
+7 3 0 0
+After: [1, 3, 0, 2]
+
+Before: [0, 1, 2, 1]
+2 1 2 2
+After: [0, 1, 0, 1]
+
+Before: [2, 1, 3, 3]
+4 1 0 0
+After: [0, 1, 3, 3]
+
+Before: [2, 1, 3, 3]
+4 1 0 1
+After: [2, 0, 3, 3]
+
+Before: [3, 2, 1, 1]
+11 2 3 1
+After: [3, 0, 1, 1]
+
+Before: [0, 1, 2, 0]
+2 1 2 1
+After: [0, 0, 2, 0]
+
+Before: [2, 2, 0, 3]
+6 3 3 3
+After: [2, 2, 0, 1]
+
+Before: [2, 1, 2, 2]
+2 1 2 1
+After: [2, 0, 2, 2]
+
+Before: [0, 1, 3, 2]
+15 3 2 0
+After: [2, 1, 3, 2]
+
+Before: [0, 1, 2, 2]
+2 1 2 3
+After: [0, 1, 2, 0]
+
+Before: [1, 3, 2, 3]
+10 2 3 2
+After: [1, 3, 0, 3]
+
+Before: [1, 2, 3, 0]
+3 3 2 3
+After: [1, 2, 3, 1]
+
+Before: [0, 2, 1, 1]
+1 2 2 2
+After: [0, 2, 2, 1]
+
+Before: [2, 3, 2, 1]
+5 3 2 2
+After: [2, 3, 1, 1]
+
+Before: [1, 0, 0, 2]
+3 2 3 2
+After: [1, 0, 1, 2]
+
+Before: [2, 1, 0, 2]
+3 2 3 3
+After: [2, 1, 0, 1]
+
+Before: [0, 3, 3, 2]
+15 3 2 1
+After: [0, 2, 3, 2]
+
+Before: [3, 0, 3, 0]
+3 3 2 2
+After: [3, 0, 1, 0]
+
+Before: [0, 0, 2, 1]
+11 3 3 1
+After: [0, 0, 2, 1]
+
+Before: [0, 2, 0, 1]
+0 0 3 1
+After: [0, 0, 0, 1]
+
+Before: [2, 1, 0, 3]
+4 1 0 1
+After: [2, 0, 0, 3]
+
+Before: [2, 2, 1, 3]
+1 2 2 0
+After: [2, 2, 1, 3]
+
+Before: [0, 2, 2, 3]
+10 1 3 1
+After: [0, 0, 2, 3]
+
+Before: [1, 1, 1, 0]
+1 2 2 2
+After: [1, 1, 2, 0]
+
+Before: [0, 1, 2, 1]
+2 1 2 0
+After: [0, 1, 2, 1]
+
+Before: [2, 3, 2, 1]
+5 3 2 1
+After: [2, 1, 2, 1]
+
+Before: [1, 1, 3, 2]
+15 3 2 1
+After: [1, 2, 3, 2]
+
+Before: [3, 2, 2, 3]
+8 3 0 3
+After: [3, 2, 2, 1]
+
+Before: [2, 2, 2, 3]
+10 2 3 3
+After: [2, 2, 2, 0]
+
+Before: [0, 0, 1, 3]
+0 0 3 3
+After: [0, 0, 1, 0]
+
+Before: [0, 0, 2, 1]
+0 0 3 0
+After: [0, 0, 2, 1]
+
+Before: [3, 2, 2, 3]
+10 1 3 0
+After: [0, 2, 2, 3]
+
+Before: [0, 1, 2, 3]
+9 0 0 0
+After: [0, 1, 2, 3]
+
+Before: [0, 0, 2, 3]
+10 2 3 0
+After: [0, 0, 2, 3]
+
+Before: [3, 2, 3, 1]
+8 2 3 2
+After: [3, 2, 0, 1]
+
+Before: [0, 1, 3, 1]
+13 1 2 3
+After: [0, 1, 3, 0]
+
+Before: [2, 2, 3, 1]
+15 1 2 0
+After: [2, 2, 3, 1]
+
+Before: [2, 1, 2, 3]
+6 3 1 2
+After: [2, 1, 0, 3]
+
+Before: [0, 2, 3, 3]
+0 0 1 1
+After: [0, 0, 3, 3]
+
+Before: [0, 1, 0, 2]
+0 0 3 1
+After: [0, 0, 0, 2]
+
+Before: [2, 0, 1, 3]
+10 2 3 1
+After: [2, 0, 1, 3]
+
+Before: [1, 1, 2, 1]
+2 1 2 3
+After: [1, 1, 2, 0]
+
+Before: [2, 1, 3, 1]
+13 1 2 1
+After: [2, 0, 3, 1]
+
+Before: [1, 0, 2, 0]
+14 0 2 3
+After: [1, 0, 2, 0]
+
+Before: [0, 1, 2, 2]
+2 1 2 2
+After: [0, 1, 0, 2]
+
+Before: [1, 2, 0, 2]
+3 2 3 0
+After: [1, 2, 0, 2]
+
+Before: [2, 1, 1, 1]
+11 2 3 2
+After: [2, 1, 0, 1]
+
+Before: [1, 3, 3, 2]
+15 3 2 2
+After: [1, 3, 2, 2]
+
+Before: [1, 2, 3, 3]
+10 1 3 0
+After: [0, 2, 3, 3]
+
+Before: [0, 1, 3, 2]
+9 0 0 1
+After: [0, 0, 3, 2]
+
+Before: [2, 1, 2, 3]
+6 3 2 2
+After: [2, 1, 0, 3]
+
+Before: [0, 2, 1, 3]
+6 3 3 3
+After: [0, 2, 1, 1]
+
+Before: [0, 2, 2, 1]
+8 2 1 0
+After: [1, 2, 2, 1]
+
+Before: [0, 2, 3, 3]
+10 1 3 2
+After: [0, 2, 0, 3]
+
+Before: [0, 3, 2, 0]
+0 0 1 2
+After: [0, 3, 0, 0]
+
+Before: [1, 0, 3, 0]
+3 3 2 1
+After: [1, 1, 3, 0]
+
+Before: [0, 0, 1, 2]
+12 2 1 0
+After: [1, 0, 1, 2]
+
+Before: [0, 3, 3, 3]
+9 0 0 0
+After: [0, 3, 3, 3]
+
+Before: [1, 0, 2, 1]
+14 0 2 0
+After: [0, 0, 2, 1]
+
+Before: [2, 0, 3, 2]
+11 3 3 1
+After: [2, 0, 3, 2]
+
+Before: [0, 2, 2, 1]
+8 2 1 3
+After: [0, 2, 2, 1]
+
+Before: [0, 1, 1, 0]
+9 0 0 0
+After: [0, 1, 1, 0]
+
+Before: [1, 1, 2, 0]
+14 0 2 3
+After: [1, 1, 2, 0]
+
+Before: [0, 3, 0, 1]
+9 0 0 0
+After: [0, 3, 0, 1]
+
+Before: [1, 0, 3, 1]
+8 2 3 0
+After: [0, 0, 3, 1]
+
+Before: [3, 1, 2, 3]
+8 3 0 1
+After: [3, 1, 2, 3]
+
+Before: [0, 1, 2, 1]
+0 0 1 2
+After: [0, 1, 0, 1]
+
+Before: [2, 1, 2, 1]
+4 1 0 0
+After: [0, 1, 2, 1]
+
+Before: [2, 3, 3, 0]
+3 3 2 2
+After: [2, 3, 1, 0]
+
+Before: [0, 3, 2, 3]
+9 0 0 1
+After: [0, 0, 2, 3]
+
+Before: [3, 3, 1, 0]
+1 2 2 3
+After: [3, 3, 1, 2]
+
+Before: [3, 0, 1, 0]
+1 2 2 2
+After: [3, 0, 2, 0]
+
+Before: [0, 1, 2, 0]
+2 1 2 2
+After: [0, 1, 0, 0]
+
+Before: [2, 1, 0, 1]
+4 1 0 1
+After: [2, 0, 0, 1]
+
+Before: [0, 0, 1, 0]
+12 2 1 0
+After: [1, 0, 1, 0]
+
+Before: [2, 0, 0, 2]
+3 2 3 2
+After: [2, 0, 1, 2]
+
+Before: [2, 2, 3, 1]
+15 0 2 1
+After: [2, 2, 3, 1]
+
+Before: [0, 1, 1, 0]
+0 0 1 1
+After: [0, 0, 1, 0]
+
+Before: [1, 1, 1, 3]
+10 2 3 2
+After: [1, 1, 0, 3]
+
+Before: [0, 1, 2, 0]
+2 1 2 3
+After: [0, 1, 2, 0]
+
+Before: [2, 3, 3, 0]
+3 3 2 3
+After: [2, 3, 3, 1]
+
+Before: [3, 1, 3, 2]
+13 1 2 1
+After: [3, 0, 3, 2]
+
+Before: [0, 1, 1, 3]
+1 2 2 3
+After: [0, 1, 1, 2]
+
+Before: [2, 0, 3, 1]
+8 2 3 1
+After: [2, 0, 3, 1]
+
+Before: [0, 1, 1, 0]
+0 0 3 3
+After: [0, 1, 1, 0]
+
+Before: [1, 2, 3, 1]
+15 1 2 2
+After: [1, 2, 2, 1]
+
+Before: [1, 1, 2, 2]
+2 1 2 3
+After: [1, 1, 2, 0]
+
+Before: [1, 0, 2, 1]
+11 3 3 3
+After: [1, 0, 2, 0]
+
+Before: [2, 0, 2, 1]
+5 3 2 0
+After: [1, 0, 2, 1]
+
+Before: [1, 1, 2, 2]
+2 1 2 0
+After: [0, 1, 2, 2]
+
+Before: [1, 3, 1, 2]
+11 3 3 2
+After: [1, 3, 0, 2]
+
+Before: [1, 0, 2, 2]
+12 0 1 1
+After: [1, 1, 2, 2]
+
+Before: [2, 1, 3, 0]
+13 1 2 0
+After: [0, 1, 3, 0]
+
+Before: [2, 2, 2, 1]
+5 3 2 2
+After: [2, 2, 1, 1]
+
+Before: [3, 2, 3, 2]
+7 3 0 0
+After: [1, 2, 3, 2]
+
+Before: [1, 2, 3, 1]
+8 2 3 3
+After: [1, 2, 3, 0]
+
+Before: [3, 3, 0, 2]
+7 3 0 3
+After: [3, 3, 0, 1]
+
+Before: [0, 0, 3, 0]
+3 3 2 2
+After: [0, 0, 1, 0]
+
+Before: [1, 2, 2, 2]
+14 0 2 3
+After: [1, 2, 2, 0]
+
+Before: [3, 1, 1, 3]
+10 2 3 0
+After: [0, 1, 1, 3]
+
+Before: [1, 1, 3, 0]
+13 1 2 2
+After: [1, 1, 0, 0]
+
+Before: [0, 0, 2, 3]
+9 0 0 2
+After: [0, 0, 0, 3]
+
+Before: [0, 3, 2, 1]
+5 3 2 1
+After: [0, 1, 2, 1]
+
+Before: [2, 1, 0, 3]
+10 1 3 1
+After: [2, 0, 0, 3]
+
+Before: [0, 0, 3, 3]
+8 3 2 2
+After: [0, 0, 1, 3]
+
+Before: [2, 1, 2, 1]
+11 3 3 1
+After: [2, 0, 2, 1]
+
+Before: [3, 1, 2, 2]
+7 3 0 0
+After: [1, 1, 2, 2]
+
+Before: [0, 2, 1, 1]
+11 3 3 2
+After: [0, 2, 0, 1]
+
+Before: [2, 1, 2, 0]
+4 1 0 3
+After: [2, 1, 2, 0]
+
+Before: [3, 2, 3, 1]
+15 1 2 0
+After: [2, 2, 3, 1]
+
+Before: [2, 0, 3, 2]
+15 0 2 3
+After: [2, 0, 3, 2]
+
+Before: [2, 3, 1, 2]
+7 3 1 0
+After: [1, 3, 1, 2]
+
+Before: [2, 1, 2, 1]
+11 3 3 0
+After: [0, 1, 2, 1]
+
+Before: [0, 3, 2, 1]
+5 3 2 2
+After: [0, 3, 1, 1]
+
+Before: [0, 1, 3, 1]
+13 1 2 2
+After: [0, 1, 0, 1]
+
+Before: [3, 3, 3, 0]
+3 3 2 1
+After: [3, 1, 3, 0]
+
+Before: [0, 1, 2, 3]
+2 1 2 2
+After: [0, 1, 0, 3]
+
+Before: [2, 1, 1, 1]
+1 2 2 0
+After: [2, 1, 1, 1]
+
+Before: [2, 1, 1, 2]
+1 2 2 1
+After: [2, 2, 1, 2]
+
+Before: [0, 2, 2, 0]
+6 0 0 3
+After: [0, 2, 2, 1]
+
+Before: [0, 3, 3, 0]
+9 0 0 0
+After: [0, 3, 3, 0]
+
+Before: [2, 1, 3, 2]
+11 3 3 2
+After: [2, 1, 0, 2]
+
+Before: [0, 0, 0, 1]
+12 3 1 2
+After: [0, 0, 1, 1]
+
+Before: [2, 1, 3, 3]
+15 0 2 2
+After: [2, 1, 2, 3]
+
+Before: [0, 1, 3, 0]
+3 3 2 3
+After: [0, 1, 3, 1]
+
+Before: [2, 1, 2, 0]
+4 1 0 1
+After: [2, 0, 2, 0]
+
+Before: [0, 2, 0, 1]
+9 0 0 3
+After: [0, 2, 0, 0]
+
+Before: [1, 2, 2, 0]
+14 0 2 0
+After: [0, 2, 2, 0]
+
+Before: [0, 0, 2, 1]
+9 0 0 1
+After: [0, 0, 2, 1]
+
+Before: [3, 2, 2, 1]
+5 3 2 0
+After: [1, 2, 2, 1]
+
+Before: [1, 1, 2, 3]
+14 0 2 0
+After: [0, 1, 2, 3]
+
+Before: [0, 3, 2, 2]
+7 3 1 0
+After: [1, 3, 2, 2]
+
+Before: [2, 1, 3, 0]
+4 1 0 0
+After: [0, 1, 3, 0]
+
+Before: [2, 1, 0, 1]
+11 3 3 3
+After: [2, 1, 0, 0]
+
+Before: [2, 0, 3, 0]
+15 0 2 1
+After: [2, 2, 3, 0]
+
+Before: [3, 0, 0, 2]
+3 2 3 3
+After: [3, 0, 0, 1]
+
+Before: [3, 1, 2, 0]
+2 1 2 3
+After: [3, 1, 2, 0]
+
+Before: [0, 1, 2, 1]
+2 1 2 1
+After: [0, 0, 2, 1]
+
+Before: [1, 0, 2, 3]
+6 2 2 1
+After: [1, 1, 2, 3]
+
+Before: [2, 1, 3, 2]
+13 1 2 3
+After: [2, 1, 3, 0]
+
+Before: [2, 1, 1, 1]
+4 1 0 0
+After: [0, 1, 1, 1]
+
+Before: [0, 1, 1, 2]
+0 0 2 0
+After: [0, 1, 1, 2]
+
+Before: [3, 0, 0, 1]
+12 3 1 2
+After: [3, 0, 1, 1]
+
+Before: [0, 2, 1, 3]
+0 0 2 1
+After: [0, 0, 1, 3]
+
+Before: [1, 1, 2, 3]
+14 0 2 3
+After: [1, 1, 2, 0]
+
+Before: [1, 3, 2, 2]
+7 3 1 1
+After: [1, 1, 2, 2]
+
+Before: [0, 1, 3, 0]
+3 3 2 2
+After: [0, 1, 1, 0]
+
+Before: [1, 2, 3, 0]
+15 1 2 3
+After: [1, 2, 3, 2]
+
+Before: [1, 0, 1, 3]
+12 2 1 0
+After: [1, 0, 1, 3]
+
+Before: [3, 3, 1, 3]
+8 3 0 3
+After: [3, 3, 1, 1]
+
+Before: [0, 2, 2, 1]
+5 3 2 2
+After: [0, 2, 1, 1]
+
+Before: [1, 3, 2, 1]
+14 0 2 2
+After: [1, 3, 0, 1]
+
+Before: [3, 0, 3, 0]
+3 3 2 1
+After: [3, 1, 3, 0]
+
+Before: [0, 0, 2, 1]
+5 3 2 2
+After: [0, 0, 1, 1]
+
+Before: [1, 1, 2, 3]
+14 0 2 1
+After: [1, 0, 2, 3]
+
+Before: [2, 1, 2, 3]
+2 1 2 0
+After: [0, 1, 2, 3]
+
+Before: [2, 1, 2, 1]
+4 1 0 3
+After: [2, 1, 2, 0]
+
+Before: [0, 0, 1, 3]
+10 2 3 0
+After: [0, 0, 1, 3]
+
+Before: [2, 2, 1, 1]
+1 2 2 1
+After: [2, 2, 1, 1]
+
+Before: [2, 1, 3, 3]
+13 1 2 2
+After: [2, 1, 0, 3]
+
+Before: [0, 2, 2, 3]
+0 0 2 0
+After: [0, 2, 2, 3]
+
+Before: [2, 1, 2, 3]
+4 1 0 0
+After: [0, 1, 2, 3]
+
+Before: [2, 1, 3, 2]
+4 1 0 3
+After: [2, 1, 3, 0]
+
+Before: [0, 3, 0, 3]
+9 0 0 2
+After: [0, 3, 0, 3]
+
+Before: [2, 0, 1, 0]
+1 2 2 2
+After: [2, 0, 2, 0]
+
+Before: [1, 0, 3, 2]
+11 3 3 3
+After: [1, 0, 3, 0]
+
+Before: [1, 0, 2, 2]
+6 2 2 1
+After: [1, 1, 2, 2]
+
+Before: [0, 2, 0, 3]
+9 0 0 3
+After: [0, 2, 0, 0]
+
+Before: [2, 0, 1, 1]
+12 2 1 3
+After: [2, 0, 1, 1]
+
+Before: [2, 1, 0, 2]
+4 1 0 2
+After: [2, 1, 0, 2]
+
+Before: [0, 1, 2, 2]
+2 1 2 1
+After: [0, 0, 2, 2]
+
+Before: [3, 0, 3, 2]
+15 3 2 0
+After: [2, 0, 3, 2]
+
+Before: [3, 1, 3, 3]
+13 1 2 0
+After: [0, 1, 3, 3]
+
+Before: [1, 1, 2, 2]
+2 1 2 1
+After: [1, 0, 2, 2]
+
+Before: [1, 2, 1, 3]
+10 2 3 3
+After: [1, 2, 1, 0]
+
+Before: [0, 2, 2, 1]
+8 2 1 1
+After: [0, 1, 2, 1]
+
+Before: [0, 3, 2, 1]
+5 3 2 3
+After: [0, 3, 2, 1]
+
+Before: [3, 0, 2, 1]
+12 3 1 3
+After: [3, 0, 2, 1]
+
+Before: [1, 3, 3, 2]
+15 3 2 3
+After: [1, 3, 3, 2]
+
+Before: [2, 3, 0, 2]
+3 2 3 2
+After: [2, 3, 1, 2]
+
+Before: [3, 3, 2, 2]
+6 2 2 2
+After: [3, 3, 1, 2]
+
+Before: [3, 3, 2, 2]
+7 3 0 0
+After: [1, 3, 2, 2]
+
+Before: [2, 1, 0, 2]
+4 1 0 3
+After: [2, 1, 0, 0]
+
+Before: [1, 2, 2, 2]
+14 0 2 1
+After: [1, 0, 2, 2]
+
+Before: [0, 1, 0, 3]
+0 0 1 1
+After: [0, 0, 0, 3]
+
+Before: [2, 1, 1, 3]
+4 1 0 0
+After: [0, 1, 1, 3]
+
+Before: [2, 0, 1, 1]
+12 3 1 0
+After: [1, 0, 1, 1]
+
+Before: [2, 1, 2, 0]
+2 1 2 1
+After: [2, 0, 2, 0]
+
+Before: [3, 1, 2, 3]
+10 1 3 2
+After: [3, 1, 0, 3]
+
+Before: [2, 1, 1, 0]
+4 1 0 1
+After: [2, 0, 1, 0]
+
+Before: [2, 1, 3, 3]
+10 1 3 3
+After: [2, 1, 3, 0]
+
+Before: [1, 0, 0, 1]
+12 0 1 3
+After: [1, 0, 0, 1]
+
+Before: [3, 0, 1, 3]
+12 2 1 3
+After: [3, 0, 1, 1]
+
+Before: [1, 1, 3, 1]
+8 2 3 1
+After: [1, 0, 3, 1]
+
+Before: [1, 2, 2, 3]
+14 0 2 0
+After: [0, 2, 2, 3]
+
+Before: [0, 1, 1, 3]
+9 0 0 1
+After: [0, 0, 1, 3]
+
+Before: [0, 2, 2, 1]
+11 3 3 3
+After: [0, 2, 2, 0]
+
+Before: [2, 1, 2, 2]
+2 1 2 2
+After: [2, 1, 0, 2]
+
+Before: [0, 1, 3, 1]
+13 1 2 1
+After: [0, 0, 3, 1]
+
+Before: [1, 1, 3, 0]
+3 3 2 1
+After: [1, 1, 3, 0]
+
+Before: [3, 2, 0, 1]
+11 3 3 2
+After: [3, 2, 0, 1]
+
+Before: [2, 2, 3, 2]
+15 0 2 0
+After: [2, 2, 3, 2]
+
+Before: [1, 3, 2, 3]
+14 0 2 0
+After: [0, 3, 2, 3]
+
+Before: [1, 2, 3, 3]
+10 1 3 2
+After: [1, 2, 0, 3]
+
+Before: [1, 0, 1, 2]
+1 2 2 2
+After: [1, 0, 2, 2]
+
+Before: [3, 3, 1, 3]
+8 3 0 0
+After: [1, 3, 1, 3]
+
+Before: [1, 3, 3, 3]
+8 3 2 0
+After: [1, 3, 3, 3]
+
+Before: [3, 3, 2, 2]
+7 3 0 1
+After: [3, 1, 2, 2]
+
+Before: [1, 2, 3, 3]
+15 1 2 2
+After: [1, 2, 2, 3]
+
+Before: [3, 1, 2, 0]
+2 1 2 2
+After: [3, 1, 0, 0]
+
+Before: [2, 2, 2, 1]
+5 3 2 3
+After: [2, 2, 2, 1]
+
+Before: [0, 1, 1, 2]
+9 0 0 2
+After: [0, 1, 0, 2]
+
+Before: [0, 2, 0, 3]
+0 0 2 2
+After: [0, 2, 0, 3]
+
+Before: [0, 3, 1, 1]
+9 0 0 1
+After: [0, 0, 1, 1]
+
+Before: [3, 1, 2, 3]
+10 2 3 0
+After: [0, 1, 2, 3]
+
+Before: [3, 0, 3, 1]
+12 3 1 3
+After: [3, 0, 3, 1]
+
+Before: [1, 3, 2, 2]
+7 3 1 3
+After: [1, 3, 2, 1]
+
+Before: [0, 2, 3, 0]
+3 3 2 3
+After: [0, 2, 3, 1]
+
+Before: [3, 1, 1, 2]
+11 3 3 3
+After: [3, 1, 1, 0]
+
+Before: [1, 0, 2, 3]
+14 0 2 1
+After: [1, 0, 2, 3]
+
+Before: [1, 2, 3, 0]
+3 3 2 1
+After: [1, 1, 3, 0]
+
+Before: [3, 0, 1, 3]
+10 2 3 3
+After: [3, 0, 1, 0]
+
+Before: [2, 0, 3, 1]
+12 3 1 2
+After: [2, 0, 1, 1]
+
+Before: [3, 1, 3, 2]
+11 3 3 1
+After: [3, 0, 3, 2]
+
+Before: [0, 3, 2, 0]
+9 0 0 3
+After: [0, 3, 2, 0]
+
+Before: [1, 0, 2, 3]
+12 0 1 2
+After: [1, 0, 1, 3]
+
+Before: [3, 3, 1, 3]
+10 2 3 0
+After: [0, 3, 1, 3]
+
+Before: [3, 3, 2, 0]
+6 2 2 3
+After: [3, 3, 2, 1]
+
+Before: [0, 1, 3, 0]
+3 3 2 1
+After: [0, 1, 3, 0]
+
+Before: [1, 2, 2, 0]
+8 2 1 1
+After: [1, 1, 2, 0]
+
+Before: [1, 1, 3, 2]
+13 1 2 0
+After: [0, 1, 3, 2]
+
+Before: [2, 1, 2, 3]
+10 1 3 1
+After: [2, 0, 2, 3]
+
+Before: [1, 3, 2, 0]
+14 0 2 3
+After: [1, 3, 2, 0]
+
+Before: [0, 2, 3, 2]
+15 1 2 1
+After: [0, 2, 3, 2]
+
+Before: [1, 3, 0, 2]
+3 2 3 1
+After: [1, 1, 0, 2]
+
+Before: [3, 1, 2, 0]
+2 1 2 1
+After: [3, 0, 2, 0]
+
+Before: [1, 1, 2, 2]
+14 0 2 1
+After: [1, 0, 2, 2]
+
+Before: [1, 3, 3, 0]
+3 3 2 0
+After: [1, 3, 3, 0]
+
+Before: [0, 3, 0, 2]
+7 3 1 1
+After: [0, 1, 0, 2]
+
+Before: [3, 1, 3, 3]
+13 1 2 2
+After: [3, 1, 0, 3]
+
+Before: [3, 2, 1, 3]
+10 2 3 1
+After: [3, 0, 1, 3]
+
+Before: [1, 1, 3, 2]
+13 1 2 2
+After: [1, 1, 0, 2]
+
+Before: [1, 2, 2, 3]
+14 0 2 3
+After: [1, 2, 2, 0]
+
+Before: [0, 1, 1, 2]
+11 3 3 3
+After: [0, 1, 1, 0]
+
+Before: [3, 1, 3, 1]
+13 1 2 1
+After: [3, 0, 3, 1]
+
+Before: [2, 1, 1, 3]
+1 2 2 2
+After: [2, 1, 2, 3]
+
+Before: [0, 1, 1, 0]
+1 2 2 3
+After: [0, 1, 1, 2]
+
+Before: [1, 1, 3, 3]
+13 1 2 0
+After: [0, 1, 3, 3]
+
+Before: [1, 3, 1, 2]
+7 3 1 3
+After: [1, 3, 1, 1]
+
+Before: [1, 0, 3, 2]
+12 0 1 0
+After: [1, 0, 3, 2]
+
+Before: [2, 1, 3, 0]
+4 1 0 1
+After: [2, 0, 3, 0]
+
+Before: [2, 1, 1, 3]
+4 1 0 2
+After: [2, 1, 0, 3]
+
+Before: [2, 2, 3, 3]
+10 1 3 2
+After: [2, 2, 0, 3]
+
+Before: [2, 1, 3, 2]
+15 0 2 0
+After: [2, 1, 3, 2]
+
+Before: [2, 1, 0, 1]
+4 1 0 2
+After: [2, 1, 0, 1]
+
+Before: [3, 0, 0, 1]
+11 3 3 1
+After: [3, 0, 0, 1]
+
+Before: [1, 0, 2, 3]
+6 3 3 0
+After: [1, 0, 2, 3]
+
+Before: [1, 1, 2, 1]
+2 1 2 1
+After: [1, 0, 2, 1]
+
+Before: [2, 1, 0, 0]
+4 1 0 0
+After: [0, 1, 0, 0]
+
+Before: [0, 0, 0, 3]
+6 3 3 1
+After: [0, 1, 0, 3]
+
+Before: [1, 3, 0, 2]
+7 3 1 1
+After: [1, 1, 0, 2]
+
+Before: [2, 2, 1, 2]
+11 3 3 2
+After: [2, 2, 0, 2]
+
+Before: [1, 1, 2, 1]
+2 1 2 0
+After: [0, 1, 2, 1]
+
+Before: [0, 0, 0, 2]
+11 3 3 2
+After: [0, 0, 0, 2]
+
+Before: [2, 1, 3, 3]
+4 1 0 3
+After: [2, 1, 3, 0]
+
+Before: [2, 2, 0, 3]
+10 1 3 3
+After: [2, 2, 0, 0]
+
+Before: [2, 1, 2, 0]
+2 1 2 3
+After: [2, 1, 2, 0]
+
+Before: [1, 0, 2, 0]
+14 0 2 1
+After: [1, 0, 2, 0]
+
+Before: [2, 1, 2, 3]
+6 3 1 1
+After: [2, 0, 2, 3]
+
+Before: [0, 0, 3, 2]
+0 0 1 1
+After: [0, 0, 3, 2]
+
+Before: [0, 1, 3, 0]
+9 0 0 2
+After: [0, 1, 0, 0]
+
+Before: [0, 1, 3, 1]
+0 0 3 2
+After: [0, 1, 0, 1]
+
+Before: [0, 2, 3, 2]
+15 3 2 2
+After: [0, 2, 2, 2]
+
+Before: [3, 0, 1, 2]
+7 3 0 3
+After: [3, 0, 1, 1]
+
+Before: [3, 1, 1, 2]
+7 3 0 1
+After: [3, 1, 1, 2]
+
+Before: [2, 1, 2, 0]
+8 2 0 0
+After: [1, 1, 2, 0]
+
+Before: [2, 1, 3, 0]
+13 1 2 3
+After: [2, 1, 3, 0]
+
+Before: [0, 3, 0, 0]
+9 0 0 3
+After: [0, 3, 0, 0]
+
+Before: [3, 1, 1, 2]
+1 2 2 2
+After: [3, 1, 2, 2]
+
+Before: [0, 0, 1, 0]
+9 0 0 1
+After: [0, 0, 1, 0]
+
+Before: [0, 2, 2, 1]
+11 3 3 0
+After: [0, 2, 2, 1]
+
+Before: [2, 3, 1, 2]
+11 3 3 3
+After: [2, 3, 1, 0]
+
+Before: [3, 3, 3, 2]
+7 3 0 2
+After: [3, 3, 1, 2]
+
+Before: [2, 1, 3, 2]
+15 0 2 2
+After: [2, 1, 2, 2]
+
+Before: [3, 1, 1, 2]
+7 3 0 3
+After: [3, 1, 1, 1]
+
+Before: [0, 0, 3, 1]
+11 3 3 1
+After: [0, 0, 3, 1]
+
+Before: [0, 3, 2, 1]
+5 3 2 0
+After: [1, 3, 2, 1]
+
+Before: [2, 1, 3, 0]
+3 3 2 1
+After: [2, 1, 3, 0]
+
+Before: [2, 0, 0, 1]
+12 3 1 0
+After: [1, 0, 0, 1]
+
+Before: [1, 3, 2, 1]
+5 3 2 3
+After: [1, 3, 2, 1]
+
+Before: [1, 3, 2, 1]
+14 0 2 0
+After: [0, 3, 2, 1]
+
+Before: [1, 3, 1, 2]
+7 3 1 1
+After: [1, 1, 1, 2]
+
+Before: [2, 0, 2, 1]
+12 3 1 3
+After: [2, 0, 2, 1]
+
+Before: [3, 0, 1, 0]
+1 2 2 3
+After: [3, 0, 1, 2]
+
+Before: [1, 3, 0, 2]
+7 3 1 0
+After: [1, 3, 0, 2]
+
+Before: [0, 0, 3, 1]
+8 2 3 0
+After: [0, 0, 3, 1]
+
+Before: [2, 0, 3, 1]
+15 0 2 3
+After: [2, 0, 3, 2]
+
+Before: [0, 0, 0, 1]
+0 0 3 1
+After: [0, 0, 0, 1]
+
+Before: [0, 3, 1, 3]
+1 2 2 2
+After: [0, 3, 2, 3]
+
+Before: [2, 1, 1, 3]
+10 1 3 0
+After: [0, 1, 1, 3]
+
+Before: [0, 2, 1, 2]
+11 3 3 1
+After: [0, 0, 1, 2]
+
+Before: [3, 2, 2, 1]
+5 3 2 3
+After: [3, 2, 2, 1]
+
+Before: [3, 3, 2, 2]
+7 3 1 2
+After: [3, 3, 1, 2]
+
+Before: [0, 2, 2, 2]
+0 0 3 3
+After: [0, 2, 2, 0]
+
+Before: [2, 1, 2, 1]
+4 1 0 1
+After: [2, 0, 2, 1]
+
+Before: [3, 1, 2, 2]
+2 1 2 3
+After: [3, 1, 2, 0]
+
+Before: [1, 0, 1, 2]
+12 0 1 0
+After: [1, 0, 1, 2]
+
+Before: [0, 0, 3, 0]
+3 3 2 3
+After: [0, 0, 3, 1]
+
+Before: [1, 1, 2, 1]
+5 3 2 3
+After: [1, 1, 2, 1]
+
+Before: [3, 3, 1, 1]
+11 3 3 1
+After: [3, 0, 1, 1]
+
+Before: [1, 0, 0, 2]
+12 0 1 3
+After: [1, 0, 0, 1]
+
+Before: [1, 2, 1, 3]
+1 2 2 2
+After: [1, 2, 2, 3]
+
+Before: [3, 0, 2, 1]
+5 3 2 1
+After: [3, 1, 2, 1]
+
+Before: [0, 0, 0, 1]
+0 0 2 3
+After: [0, 0, 0, 0]
+
+Before: [3, 1, 3, 3]
+13 1 2 1
+After: [3, 0, 3, 3]
+
+Before: [1, 2, 1, 0]
+1 2 2 2
+After: [1, 2, 2, 0]
+
+Before: [0, 3, 2, 1]
+9 0 0 0
+After: [0, 3, 2, 1]
+
+Before: [0, 3, 3, 1]
+8 2 3 0
+After: [0, 3, 3, 1]
+
+Before: [2, 1, 2, 0]
+2 1 2 0
+After: [0, 1, 2, 0]
+
+Before: [2, 1, 1, 2]
+4 1 0 1
+After: [2, 0, 1, 2]
+
+Before: [1, 1, 1, 3]
+10 2 3 3
+After: [1, 1, 1, 0]
+
+Before: [3, 0, 1, 0]
+12 2 1 0
+After: [1, 0, 1, 0]
+
+Before: [3, 2, 1, 2]
+7 3 0 3
+After: [3, 2, 1, 1]
+
+Before: [1, 1, 3, 2]
+11 3 3 3
+After: [1, 1, 3, 0]
+
+Before: [0, 3, 3, 2]
+15 3 2 2
+After: [0, 3, 2, 2]
+
+Before: [0, 0, 0, 0]
+9 0 0 2
+After: [0, 0, 0, 0]
+
+Before: [1, 1, 3, 0]
+13 1 2 0
+After: [0, 1, 3, 0]
+
+Before: [0, 1, 3, 3]
+9 0 0 3
+After: [0, 1, 3, 0]
+
+Before: [0, 0, 1, 2]
+1 2 2 0
+After: [2, 0, 1, 2]
+
+Before: [1, 2, 3, 3]
+8 3 2 3
+After: [1, 2, 3, 1]
+
+Before: [3, 3, 3, 2]
+15 3 2 1
+After: [3, 2, 3, 2]
+
+Before: [0, 1, 3, 0]
+13 1 2 1
+After: [0, 0, 3, 0]
+
+Before: [2, 0, 2, 1]
+5 3 2 2
+After: [2, 0, 1, 1]
+
+Before: [3, 2, 0, 3]
+10 1 3 2
+After: [3, 2, 0, 3]
+
+Before: [3, 3, 1, 2]
+1 2 2 0
+After: [2, 3, 1, 2]
+
+Before: [3, 1, 2, 3]
+6 3 2 0
+After: [0, 1, 2, 3]
+
+Before: [0, 2, 2, 3]
+6 2 2 3
+After: [0, 2, 2, 1]
+
+Before: [3, 3, 3, 2]
+7 3 0 0
+After: [1, 3, 3, 2]
+
+Before: [0, 1, 1, 2]
+6 0 0 3
+After: [0, 1, 1, 1]
+
+Before: [0, 0, 3, 0]
+0 0 2 0
+After: [0, 0, 3, 0]
+
+Before: [3, 1, 2, 2]
+2 1 2 2
+After: [3, 1, 0, 2]
+
+Before: [0, 1, 2, 1]
+5 3 2 1
+After: [0, 1, 2, 1]
+
+Before: [1, 1, 1, 1]
+1 2 2 2
+After: [1, 1, 2, 1]
+
+Before: [1, 1, 2, 2]
+14 0 2 2
+After: [1, 1, 0, 2]
+
+Before: [2, 1, 1, 1]
+4 1 0 2
+After: [2, 1, 0, 1]
+
+Before: [2, 2, 2, 1]
+5 3 2 0
+After: [1, 2, 2, 1]
+
+Before: [1, 1, 2, 3]
+2 1 2 2
+After: [1, 1, 0, 3]
+
+Before: [3, 1, 2, 1]
+2 1 2 0
+After: [0, 1, 2, 1]
+
+Before: [0, 2, 3, 1]
+6 0 0 3
+After: [0, 2, 3, 1]
+
+Before: [0, 2, 3, 2]
+15 3 2 0
+After: [2, 2, 3, 2]
+
+Before: [2, 1, 3, 1]
+4 1 0 2
+After: [2, 1, 0, 1]
+
+Before: [3, 1, 3, 1]
+13 1 2 0
+After: [0, 1, 3, 1]
+
+Before: [2, 1, 3, 3]
+13 1 2 0
+After: [0, 1, 3, 3]
+
+Before: [1, 0, 2, 3]
+12 0 1 0
+After: [1, 0, 2, 3]
+
+Before: [3, 0, 2, 3]
+8 3 0 0
+After: [1, 0, 2, 3]
+
+Before: [0, 0, 1, 1]
+12 2 1 0
+After: [1, 0, 1, 1]
+
+Before: [0, 0, 3, 0]
+0 0 1 2
+After: [0, 0, 0, 0]
+
+Before: [0, 3, 1, 2]
+7 3 1 1
+After: [0, 1, 1, 2]
+
+Before: [2, 1, 1, 2]
+4 1 0 2
+After: [2, 1, 0, 2]
+
+Before: [0, 2, 3, 1]
+0 0 2 0
+After: [0, 2, 3, 1]
+
+Before: [3, 1, 2, 1]
+5 3 2 3
+After: [3, 1, 2, 1]
+
+Before: [3, 3, 1, 2]
+7 3 1 2
+After: [3, 3, 1, 2]
+
+Before: [0, 1, 0, 1]
+0 0 3 2
+After: [0, 1, 0, 1]
+
+Before: [2, 2, 2, 3]
+10 2 3 1
+After: [2, 0, 2, 3]
+
+Before: [0, 1, 1, 3]
+1 2 2 1
+After: [0, 2, 1, 3]
+
+Before: [3, 2, 2, 1]
+11 3 3 3
+After: [3, 2, 2, 0]
+
+Before: [0, 1, 0, 3]
+9 0 0 0
+After: [0, 1, 0, 3]
+
+Before: [2, 0, 2, 2]
+8 2 0 3
+After: [2, 0, 2, 1]
+
+Before: [3, 0, 1, 1]
+12 2 1 0
+After: [1, 0, 1, 1]
+
+Before: [3, 2, 2, 3]
+10 2 3 2
+After: [3, 2, 0, 3]
+
+Before: [1, 0, 3, 2]
+15 3 2 1
+After: [1, 2, 3, 2]
+
+Before: [1, 3, 1, 2]
+11 3 3 3
+After: [1, 3, 1, 0]
+
+Before: [3, 0, 2, 1]
+5 3 2 2
+After: [3, 0, 1, 1]
+
+Before: [2, 0, 1, 2]
+12 2 1 3
+After: [2, 0, 1, 1]
+
+Before: [2, 1, 3, 3]
+13 1 2 3
+After: [2, 1, 3, 0]
+
+Before: [2, 1, 2, 2]
+4 1 0 2
+After: [2, 1, 0, 2]
+
+Before: [0, 2, 2, 0]
+0 0 2 0
+After: [0, 2, 2, 0]
+
+Before: [3, 2, 2, 1]
+6 2 2 0
+After: [1, 2, 2, 1]
+
+Before: [1, 3, 2, 1]
+5 3 2 0
+After: [1, 3, 2, 1]
+
+Before: [1, 2, 2, 1]
+5 3 2 3
+After: [1, 2, 2, 1]
+
+Before: [3, 1, 3, 3]
+10 1 3 3
+After: [3, 1, 3, 0]
+
+Before: [0, 1, 1, 3]
+0 0 2 1
+After: [0, 0, 1, 3]
+
+Before: [3, 0, 3, 3]
+6 3 3 3
+After: [3, 0, 3, 1]
+
+Before: [1, 3, 3, 2]
+7 3 1 1
+After: [1, 1, 3, 2]
+
+Before: [2, 1, 3, 1]
+4 1 0 1
+After: [2, 0, 3, 1]
+
+Before: [3, 2, 2, 3]
+10 1 3 3
+After: [3, 2, 2, 0]
+
+Before: [2, 0, 3, 1]
+12 3 1 1
+After: [2, 1, 3, 1]
+
+Before: [0, 2, 0, 3]
+10 1 3 2
+After: [0, 2, 0, 3]
+
+Before: [2, 3, 1, 3]
+10 2 3 0
+After: [0, 3, 1, 3]
+
+Before: [1, 1, 2, 3]
+10 2 3 0
+After: [0, 1, 2, 3]
+
+Before: [2, 1, 2, 0]
+4 1 0 2
+After: [2, 1, 0, 0]
+
+Before: [2, 3, 3, 3]
+15 0 2 0
+After: [2, 3, 3, 3]
+
+Before: [2, 2, 3, 3]
+15 1 2 2
+After: [2, 2, 2, 3]
+
+Before: [0, 3, 1, 2]
+7 3 1 0
+After: [1, 3, 1, 2]
+
+Before: [0, 1, 1, 3]
+6 3 3 0
+After: [1, 1, 1, 3]
+
+Before: [1, 0, 1, 1]
+11 2 3 0
+After: [0, 0, 1, 1]
+
+Before: [2, 1, 2, 1]
+5 3 2 3
+After: [2, 1, 2, 1]
+
+Before: [0, 3, 0, 2]
+3 2 3 1
+After: [0, 1, 0, 2]
+
+Before: [2, 0, 1, 3]
+10 2 3 0
+After: [0, 0, 1, 3]
+
+Before: [0, 3, 0, 1]
+9 0 0 2
+After: [0, 3, 0, 1]
+
+Before: [3, 2, 2, 1]
+5 3 2 1
+After: [3, 1, 2, 1]
+
+Before: [0, 1, 1, 1]
+11 3 3 2
+After: [0, 1, 0, 1]
+
+Before: [2, 3, 3, 2]
+7 3 1 2
+After: [2, 3, 1, 2]
+
+Before: [2, 1, 2, 1]
+5 3 2 0
+After: [1, 1, 2, 1]
+
+Before: [2, 0, 2, 1]
+5 3 2 3
+After: [2, 0, 2, 1]
+
+Before: [3, 0, 1, 1]
+12 3 1 2
+After: [3, 0, 1, 1]
+
+Before: [3, 0, 1, 1]
+12 3 1 3
+After: [3, 0, 1, 1]
+
+Before: [3, 0, 1, 0]
+1 2 2 1
+After: [3, 2, 1, 0]
+
+Before: [3, 0, 2, 1]
+11 3 3 1
+After: [3, 0, 2, 1]
+
+Before: [2, 1, 1, 3]
+4 1 0 1
+After: [2, 0, 1, 3]
+
+Before: [0, 2, 2, 3]
+0 0 3 1
+After: [0, 0, 2, 3]
+
+Before: [0, 1, 2, 1]
+5 3 2 0
+After: [1, 1, 2, 1]
+
+Before: [0, 1, 3, 1]
+13 1 2 0
+After: [0, 1, 3, 1]
+
+Before: [1, 0, 1, 3]
+1 2 2 3
+After: [1, 0, 1, 2]
+
+Before: [1, 3, 2, 1]
+14 0 2 1
+After: [1, 0, 2, 1]
+
+Before: [3, 1, 2, 2]
+2 1 2 1
+After: [3, 0, 2, 2]
+
+Before: [0, 1, 3, 2]
+15 3 2 1
+After: [0, 2, 3, 2]
+
+Before: [2, 1, 0, 1]
+4 1 0 3
+After: [2, 1, 0, 0]
+
+Before: [0, 0, 2, 3]
+6 0 0 3
+After: [0, 0, 2, 1]
+
+Before: [1, 3, 0, 2]
+3 2 3 2
+After: [1, 3, 1, 2]
+
+Before: [2, 1, 1, 0]
+1 2 2 0
+After: [2, 1, 1, 0]
+
+Before: [0, 2, 0, 2]
+6 0 0 0
+After: [1, 2, 0, 2]
+
+Before: [3, 1, 3, 3]
+8 3 0 3
+After: [3, 1, 3, 1]
+
+Before: [2, 1, 3, 2]
+4 1 0 1
+After: [2, 0, 3, 2]
+
+Before: [2, 1, 1, 2]
+4 1 0 3
+After: [2, 1, 1, 0]
+
+Before: [0, 0, 2, 1]
+12 3 1 3
+After: [0, 0, 2, 1]
+
+Before: [3, 0, 1, 3]
+12 2 1 0
+After: [1, 0, 1, 3]
+
+Before: [2, 2, 2, 3]
+6 3 2 1
+After: [2, 0, 2, 3]
+
+Before: [1, 2, 2, 3]
+14 0 2 2
+After: [1, 2, 0, 3]
+
+Before: [2, 1, 2, 0]
+2 1 2 2
+After: [2, 1, 0, 0]
+
+Before: [0, 2, 2, 2]
+0 0 1 2
+After: [0, 2, 0, 2]
+
+Before: [1, 0, 1, 3]
+10 2 3 2
+After: [1, 0, 0, 3]
+
+Before: [1, 1, 3, 3]
+13 1 2 2
+After: [1, 1, 0, 3]
+
+Before: [2, 2, 3, 2]
+15 1 2 2
+After: [2, 2, 2, 2]
+
+Before: [0, 0, 0, 1]
+6 0 0 2
+After: [0, 0, 1, 1]
+
+Before: [1, 1, 0, 2]
+3 2 3 1
+After: [1, 1, 0, 2]
+
+Before: [2, 1, 0, 2]
+4 1 0 0
+After: [0, 1, 0, 2]
+
+Before: [1, 1, 3, 0]
+13 1 2 1
+After: [1, 0, 3, 0]
+
+Before: [1, 3, 3, 2]
+15 3 2 1
+After: [1, 2, 3, 2]
+
+Before: [1, 2, 1, 1]
+1 2 2 2
+After: [1, 2, 2, 1]
+
+Before: [1, 3, 2, 2]
+6 2 2 2
+After: [1, 3, 1, 2]
+
+Before: [0, 3, 3, 1]
+8 2 3 3
+After: [0, 3, 3, 0]
+
+Before: [3, 2, 3, 3]
+10 1 3 2
+After: [3, 2, 0, 3]
+
+Before: [1, 1, 3, 1]
+13 1 2 3
+After: [1, 1, 3, 0]
+
+Before: [2, 2, 2, 1]
+6 2 2 1
+After: [2, 1, 2, 1]
+
+Before: [1, 2, 2, 1]
+14 0 2 1
+After: [1, 0, 2, 1]
+
+Before: [0, 0, 1, 1]
+9 0 0 2
+After: [0, 0, 0, 1]
+
+Before: [0, 1, 2, 1]
+9 0 0 1
+After: [0, 0, 2, 1]
+
+Before: [0, 2, 2, 0]
+8 2 1 2
+After: [0, 2, 1, 0]
+
+Before: [3, 0, 0, 3]
+8 3 0 2
+After: [3, 0, 1, 3]
+
+Before: [2, 1, 2, 1]
+2 1 2 1
+After: [2, 0, 2, 1]
+
+Before: [1, 1, 1, 3]
+6 3 2 1
+After: [1, 0, 1, 3]
+
+Before: [0, 1, 2, 1]
+5 3 2 2
+After: [0, 1, 1, 1]
+
+Before: [3, 0, 0, 2]
+7 3 0 1
+After: [3, 1, 0, 2]
+
+Before: [2, 1, 0, 3]
+4 1 0 2
+After: [2, 1, 0, 3]
+
+Before: [0, 2, 1, 2]
+1 2 2 3
+After: [0, 2, 1, 2]
+
+Before: [2, 0, 1, 1]
+1 2 2 1
+After: [2, 2, 1, 1]
+
+Before: [1, 1, 2, 0]
+2 1 2 0
+After: [0, 1, 2, 0]
+
+Before: [0, 1, 2, 1]
+11 3 3 1
+After: [0, 0, 2, 1]
+
+Before: [2, 0, 1, 0]
+12 2 1 0
+After: [1, 0, 1, 0]
+
+Before: [2, 1, 0, 3]
+10 1 3 3
+After: [2, 1, 0, 0]
+
+Before: [2, 2, 2, 3]
+10 1 3 0
+After: [0, 2, 2, 3]
+
+Before: [0, 1, 2, 2]
+9 0 0 1
+After: [0, 0, 2, 2]
+
+Before: [1, 2, 2, 1]
+14 0 2 0
+After: [0, 2, 2, 1]
+
+Before: [3, 2, 0, 2]
+7 3 0 0
+After: [1, 2, 0, 2]
+
+Before: [3, 3, 0, 2]
+7 3 1 3
+After: [3, 3, 0, 1]
+
+Before: [1, 1, 2, 2]
+2 1 2 2
+After: [1, 1, 0, 2]
+
+Before: [3, 2, 3, 3]
+6 3 3 2
+After: [3, 2, 1, 3]
+
+Before: [1, 0, 3, 0]
+3 3 2 0
+After: [1, 0, 3, 0]
+
+Before: [2, 3, 0, 1]
+11 3 3 3
+After: [2, 3, 0, 0]
+
+Before: [1, 1, 1, 3]
+6 3 2 0
+After: [0, 1, 1, 3]
+
+Before: [2, 1, 3, 2]
+4 1 0 0
+After: [0, 1, 3, 2]
+
+Before: [0, 1, 1, 2]
+11 3 3 2
+After: [0, 1, 0, 2]
+
+Before: [1, 0, 1, 1]
+12 3 1 1
+After: [1, 1, 1, 1]
+
+Before: [2, 0, 0, 1]
+12 3 1 3
+After: [2, 0, 0, 1]
+
+Before: [3, 1, 3, 2]
+15 3 2 2
+After: [3, 1, 2, 2]
+
+Before: [2, 2, 3, 3]
+15 0 2 2
+After: [2, 2, 2, 3]
+
+Before: [0, 0, 2, 3]
+6 2 2 2
+After: [0, 0, 1, 3]
+
+Before: [3, 2, 2, 2]
+11 3 3 1
+After: [3, 0, 2, 2]
+
+Before: [2, 0, 3, 1]
+15 0 2 0
+After: [2, 0, 3, 1]
+
+Before: [3, 1, 3, 0]
+3 3 2 1
+After: [3, 1, 3, 0]
+
+Before: [2, 1, 2, 2]
+4 1 0 3
+After: [2, 1, 2, 0]
+
+Before: [2, 0, 3, 0]
+3 3 2 3
+After: [2, 0, 3, 1]
+
+Before: [1, 1, 0, 2]
+3 2 3 0
+After: [1, 1, 0, 2]
+
+Before: [0, 1, 0, 1]
+9 0 0 1
+After: [0, 0, 0, 1]
+
+Before: [3, 0, 1, 0]
+12 2 1 3
+After: [3, 0, 1, 1]
+
+Before: [2, 1, 0, 1]
+11 3 3 1
+After: [2, 0, 0, 1]
+
+Before: [3, 1, 2, 0]
+2 1 2 0
+After: [0, 1, 2, 0]
+
+Before: [2, 1, 2, 1]
+5 3 2 1
+After: [2, 1, 2, 1]
+
+Before: [0, 2, 2, 1]
+9 0 0 0
+After: [0, 2, 2, 1]
+
+Before: [3, 2, 3, 0]
+3 3 2 3
+After: [3, 2, 3, 1]
+
+Before: [0, 1, 3, 0]
+13 1 2 0
+After: [0, 1, 3, 0]
+
+Before: [3, 0, 3, 2]
+11 3 3 1
+After: [3, 0, 3, 2]
+
+Before: [1, 2, 2, 3]
+10 1 3 0
+After: [0, 2, 2, 3]
+
+Before: [2, 1, 3, 3]
+13 1 2 1
+After: [2, 0, 3, 3]
+
+Before: [1, 2, 2, 1]
+5 3 2 1
+After: [1, 1, 2, 1]
+
+Before: [0, 1, 2, 2]
+11 3 3 0
+After: [0, 1, 2, 2]
+
+Before: [0, 0, 0, 2]
+3 2 3 1
+After: [0, 1, 0, 2]
+
+Before: [1, 0, 2, 0]
+14 0 2 0
+After: [0, 0, 2, 0]
+
+Before: [2, 2, 1, 1]
+11 3 3 3
+After: [2, 2, 1, 0]
+
+Before: [0, 2, 1, 0]
+0 0 2 0
+After: [0, 2, 1, 0]
+
+Before: [2, 3, 3, 3]
+6 3 3 0
+After: [1, 3, 3, 3]
+
+Before: [1, 2, 3, 2]
+15 3 2 3
+After: [1, 2, 3, 2]
+
+Before: [2, 2, 2, 3]
+10 1 3 1
+After: [2, 0, 2, 3]
+
+Before: [3, 1, 2, 2]
+2 1 2 0
+After: [0, 1, 2, 2]
+
+Before: [3, 1, 1, 3]
+8 3 0 0
+After: [1, 1, 1, 3]
+
+Before: [3, 2, 3, 1]
+15 1 2 2
+After: [3, 2, 2, 1]
+
+Before: [2, 1, 2, 3]
+10 2 3 2
+After: [2, 1, 0, 3]
+
+Before: [2, 3, 1, 0]
+1 2 2 2
+After: [2, 3, 2, 0]
+
+Before: [0, 1, 3, 2]
+13 1 2 2
+After: [0, 1, 0, 2]
+
+Before: [0, 2, 0, 1]
+9 0 0 0
+After: [0, 2, 0, 1]
+
+Before: [0, 1, 3, 1]
+6 0 0 1
+After: [0, 1, 3, 1]
+
+Before: [1, 3, 1, 2]
+7 3 1 0
+After: [1, 3, 1, 2]
+
+Before: [0, 3, 1, 3]
+10 2 3 3
+After: [0, 3, 1, 0]
+
+Before: [2, 0, 1, 0]
+12 2 1 2
+After: [2, 0, 1, 0]
+
+Before: [1, 1, 2, 1]
+5 3 2 2
+After: [1, 1, 1, 1]
+
+Before: [1, 3, 2, 0]
+14 0 2 2
+After: [1, 3, 0, 0]
+
+Before: [0, 1, 3, 3]
+10 1 3 2
+After: [0, 1, 0, 3]
+
+Before: [1, 0, 2, 1]
+5 3 2 2
+After: [1, 0, 1, 1]
+
+Before: [2, 1, 0, 0]
+4 1 0 3
+After: [2, 1, 0, 0]
+
+Before: [0, 0, 2, 2]
+0 0 3 1
+After: [0, 0, 2, 2]
+
+Before: [0, 1, 0, 0]
+0 0 1 3
+After: [0, 1, 0, 0]
+
+Before: [0, 2, 3, 2]
+15 1 2 2
+After: [0, 2, 2, 2]
+
+Before: [0, 2, 2, 1]
+5 3 2 1
+After: [0, 1, 2, 1]
+
+Before: [0, 2, 2, 0]
+9 0 0 0
+After: [0, 2, 2, 0]
+
+Before: [3, 1, 3, 0]
+13 1 2 2
+After: [3, 1, 0, 0]
+
+Before: [0, 0, 3, 0]
+3 3 2 0
+After: [1, 0, 3, 0]
+
+Before: [0, 3, 2, 2]
+6 0 0 0
+After: [1, 3, 2, 2]
+
+Before: [3, 2, 3, 0]
+15 1 2 0
+After: [2, 2, 3, 0]
+
+Before: [3, 1, 3, 0]
+3 3 2 0
+After: [1, 1, 3, 0]
+
+Before: [2, 0, 2, 1]
+12 3 1 0
+After: [1, 0, 2, 1]
+
+Before: [0, 0, 0, 1]
+0 0 2 1
+After: [0, 0, 0, 1]
+
+Before: [0, 0, 3, 1]
+12 3 1 3
+After: [0, 0, 3, 1]
+
+Before: [3, 1, 3, 3]
+8 3 2 0
+After: [1, 1, 3, 3]
+
+Before: [2, 1, 0, 1]
+11 3 3 2
+After: [2, 1, 0, 1]
+
+Before: [0, 3, 1, 3]
+9 0 0 0
+After: [0, 3, 1, 3]
+
+Before: [1, 2, 1, 2]
+1 2 2 0
+After: [2, 2, 1, 2]
+
+Before: [0, 1, 2, 2]
+2 1 2 0
+After: [0, 1, 2, 2]
+
+Before: [3, 2, 0, 3]
+10 1 3 0
+After: [0, 2, 0, 3]
+
+Before: [1, 2, 0, 2]
+11 3 3 2
+After: [1, 2, 0, 2]
+
+Before: [0, 1, 1, 1]
+11 2 3 2
+After: [0, 1, 0, 1]
+
+Before: [3, 1, 2, 3]
+10 2 3 2
+After: [3, 1, 0, 3]
+
+Before: [2, 1, 2, 1]
+2 1 2 3
+After: [2, 1, 2, 0]
+
+Before: [0, 3, 1, 0]
+9 0 0 2
+After: [0, 3, 0, 0]
+
+Before: [2, 1, 3, 1]
+4 1 0 0
+After: [0, 1, 3, 1]
+
+Before: [1, 2, 3, 3]
+15 1 2 0
+After: [2, 2, 3, 3]
+
+Before: [0, 0, 2, 0]
+9 0 0 3
+After: [0, 0, 2, 0]
+
+Before: [2, 1, 3, 0]
+4 1 0 2
+After: [2, 1, 0, 0]
+
+Before: [0, 3, 1, 2]
+7 3 1 2
+After: [0, 3, 1, 2]
+
+Before: [0, 3, 0, 0]
+0 0 3 3
+After: [0, 3, 0, 0]
+
+Before: [3, 1, 2, 1]
+2 1 2 3
+After: [3, 1, 2, 0]
+
+Before: [2, 1, 1, 3]
+4 1 0 3
+After: [2, 1, 1, 0]
+
+Before: [2, 1, 2, 0]
+8 2 0 3
+After: [2, 1, 2, 1]
+
+Before: [0, 3, 2, 2]
+6 0 0 2
+After: [0, 3, 1, 2]
+
+Before: [1, 0, 1, 2]
+1 2 2 3
+After: [1, 0, 1, 2]
+
+Before: [3, 3, 3, 2]
+7 3 1 1
+After: [3, 1, 3, 2]
+
+Before: [2, 1, 2, 3]
+2 1 2 1
+After: [2, 0, 2, 3]
+
+Before: [1, 2, 3, 1]
+11 3 3 3
+After: [1, 2, 3, 0]
+
+Before: [1, 0, 2, 1]
+11 3 3 1
+After: [1, 0, 2, 1]
+
+Before: [0, 1, 3, 0]
+9 0 0 1
+After: [0, 0, 3, 0]
+
+Before: [3, 0, 2, 2]
+7 3 0 3
+After: [3, 0, 2, 1]
+
+Before: [2, 0, 3, 2]
+15 3 2 0
+After: [2, 0, 3, 2]
+
+Before: [3, 3, 3, 3]
+8 3 0 1
+After: [3, 1, 3, 3]
+
+Before: [1, 0, 2, 2]
+14 0 2 0
+After: [0, 0, 2, 2]
+
+Before: [2, 0, 2, 2]
+11 3 3 2
+After: [2, 0, 0, 2]
+
+Before: [2, 0, 3, 0]
+15 0 2 2
+After: [2, 0, 2, 0]
+
+Before: [2, 2, 3, 3]
+8 3 2 2
+After: [2, 2, 1, 3]
+
+Before: [1, 1, 2, 1]
+14 0 2 2
+After: [1, 1, 0, 1]
+
+Before: [2, 2, 3, 2]
+15 0 2 3
+After: [2, 2, 3, 2]
+
+Before: [2, 2, 2, 0]
+8 2 1 0
+After: [1, 2, 2, 0]
+
+Before: [3, 2, 0, 2]
+7 3 0 3
+After: [3, 2, 0, 1]
+
+Before: [0, 3, 1, 0]
+0 0 1 0
+After: [0, 3, 1, 0]
+
+Before: [3, 0, 0, 2]
+7 3 0 0
+After: [1, 0, 0, 2]
+
+Before: [3, 3, 0, 2]
+3 2 3 2
+After: [3, 3, 1, 2]
+
+Before: [2, 0, 2, 0]
+8 2 0 2
+After: [2, 0, 1, 0]
+
+Before: [2, 1, 0, 0]
+4 1 0 2
+After: [2, 1, 0, 0]
+
+Before: [1, 1, 2, 3]
+2 1 2 0
+After: [0, 1, 2, 3]
+
+Before: [2, 1, 3, 2]
+15 3 2 1
+After: [2, 2, 3, 2]
+
+Before: [3, 2, 0, 2]
+7 3 0 2
+After: [3, 2, 1, 2]
+
+Before: [1, 2, 2, 2]
+14 0 2 2
+After: [1, 2, 0, 2]
+
+Before: [2, 1, 3, 1]
+13 1 2 0
+After: [0, 1, 3, 1]
+
+Before: [1, 3, 3, 2]
+7 3 1 3
+After: [1, 3, 3, 1]
+
+Before: [1, 0, 0, 2]
+12 0 1 2
+After: [1, 0, 1, 2]
+
+Before: [0, 0, 3, 3]
+6 3 3 2
+After: [0, 0, 1, 3]
+
+Before: [3, 1, 3, 2]
+13 1 2 0
+After: [0, 1, 3, 2]
+
+Before: [1, 3, 2, 2]
+14 0 2 3
+After: [1, 3, 2, 0]
+
+Before: [2, 2, 3, 0]
+3 3 2 2
+After: [2, 2, 1, 0]
+
+Before: [3, 1, 3, 0]
+13 1 2 1
+After: [3, 0, 3, 0]
+
+Before: [2, 1, 1, 2]
+4 1 0 0
+After: [0, 1, 1, 2]
+
+Before: [0, 1, 3, 0]
+13 1 2 3
+After: [0, 1, 3, 0]
+
+Before: [0, 2, 3, 3]
+8 3 2 3
+After: [0, 2, 3, 1]
+
+Before: [0, 2, 2, 1]
+5 3 2 3
+After: [0, 2, 2, 1]
+
+Before: [0, 2, 2, 3]
+10 1 3 3
+After: [0, 2, 2, 0]
+
+Before: [1, 1, 2, 1]
+14 0 2 0
+After: [0, 1, 2, 1]
+
+Before: [2, 1, 3, 1]
+13 1 2 2
+After: [2, 1, 0, 1]
+
+Before: [0, 3, 3, 0]
+0 0 2 2
+After: [0, 3, 0, 0]
+
+Before: [2, 3, 1, 1]
+1 2 2 0
+After: [2, 3, 1, 1]
+
+Before: [2, 1, 2, 3]
+4 1 0 3
+After: [2, 1, 2, 0]
+
+Before: [2, 2, 2, 2]
+8 2 0 0
+After: [1, 2, 2, 2]
+
+Before: [1, 0, 0, 1]
+12 0 1 0
+After: [1, 0, 0, 1]
+
+Before: [2, 1, 3, 2]
+13 1 2 2
+After: [2, 1, 0, 2]
+
+Before: [0, 1, 2, 3]
+2 1 2 0
+After: [0, 1, 2, 3]
+
+Before: [2, 2, 1, 1]
+1 2 2 0
+After: [2, 2, 1, 1]
+
+Before: [3, 3, 1, 2]
+7 3 1 1
+After: [3, 1, 1, 2]
+
+Before: [3, 3, 1, 2]
+1 2 2 3
+After: [3, 3, 1, 2]
+
+Before: [0, 0, 2, 0]
+0 0 3 3
+After: [0, 0, 2, 0]
+
+Before: [1, 1, 3, 1]
+11 3 3 2
+After: [1, 1, 0, 1]
+
+Before: [3, 0, 3, 0]
+3 3 2 0
+After: [1, 0, 3, 0]
+
+Before: [2, 2, 3, 0]
+3 3 2 3
+After: [2, 2, 3, 1]
+
+Before: [0, 1, 0, 2]
+3 2 3 1
+After: [0, 1, 0, 2]
+
+Before: [3, 1, 2, 3]
+2 1 2 0
+After: [0, 1, 2, 3]
+
+Before: [0, 1, 3, 3]
+8 3 2 1
+After: [0, 1, 3, 3]
+
+Before: [0, 0, 3, 0]
+3 3 2 1
+After: [0, 1, 3, 0]
+
+Before: [3, 0, 3, 1]
+12 3 1 2
+After: [3, 0, 1, 1]
+
+Before: [3, 1, 3, 2]
+13 1 2 3
+After: [3, 1, 3, 0]
+
+Before: [2, 1, 2, 0]
+4 1 0 0
+After: [0, 1, 2, 0]
+
+Before: [3, 3, 3, 2]
+15 3 2 2
+After: [3, 3, 2, 2]
+
+Before: [3, 0, 3, 2]
+7 3 0 0
+After: [1, 0, 3, 2]
+
+Before: [3, 0, 2, 1]
+5 3 2 3
+After: [3, 0, 2, 1]
+
+Before: [2, 2, 3, 2]
+15 0 2 1
+After: [2, 2, 3, 2]
+
+Before: [0, 2, 2, 2]
+9 0 0 3
+After: [0, 2, 2, 0]
+
+Before: [3, 1, 3, 3]
+8 3 2 3
+After: [3, 1, 3, 1]
+
+Before: [0, 0, 1, 3]
+12 2 1 1
+After: [0, 1, 1, 3]
+
+Before: [1, 0, 1, 3]
+12 2 1 2
+After: [1, 0, 1, 3]
+
+Before: [2, 1, 2, 2]
+2 1 2 3
+After: [2, 1, 2, 0]
+
+Before: [2, 1, 3, 1]
+4 1 0 3
+After: [2, 1, 3, 0]
+
+Before: [3, 1, 2, 3]
+2 1 2 2
+After: [3, 1, 0, 3]
+
+Before: [1, 1, 3, 3]
+13 1 2 3
+After: [1, 1, 3, 0]
+
+Before: [2, 2, 3, 1]
+15 1 2 3
+After: [2, 2, 3, 2]
+
+Before: [3, 1, 2, 2]
+11 3 3 0
+After: [0, 1, 2, 2]
+
+Before: [3, 1, 3, 3]
+8 3 2 2
+After: [3, 1, 1, 3]
+
+Before: [0, 3, 3, 3]
+0 0 3 3
+After: [0, 3, 3, 0]
+
+Before: [0, 1, 2, 3]
+2 1 2 1
+After: [0, 0, 2, 3]
+
+Before: [0, 1, 3, 3]
+13 1 2 2
+After: [0, 1, 0, 3]
+
+Before: [3, 2, 3, 1]
+11 3 3 2
+After: [3, 2, 0, 1]
+
+Before: [0, 2, 3, 3]
+8 3 2 2
+After: [0, 2, 1, 3]
+
+Before: [3, 1, 3, 0]
+3 3 2 2
+After: [3, 1, 1, 0]
+
+Before: [3, 0, 0, 2]
+7 3 0 3
+After: [3, 0, 0, 1]
+
+Before: [0, 1, 3, 3]
+9 0 0 1
+After: [0, 0, 3, 3]
+
+Before: [2, 1, 2, 1]
+4 1 0 2
+After: [2, 1, 0, 1]
+
+Before: [2, 1, 3, 2]
+4 1 0 2
+After: [2, 1, 0, 2]
+
+Before: [0, 3, 3, 3]
+8 3 2 3
+After: [0, 3, 3, 1]
+
+Before: [1, 2, 0, 3]
+10 1 3 2
+After: [1, 2, 0, 3]
+
+Before: [1, 2, 2, 2]
+14 0 2 0
+After: [0, 2, 2, 2]
+
+Before: [0, 3, 2, 2]
+7 3 1 3
+After: [0, 3, 2, 1]
+
+Before: [1, 1, 2, 1]
+5 3 2 0
+After: [1, 1, 2, 1]
+
+Before: [1, 2, 1, 1]
+11 3 3 0
+After: [0, 2, 1, 1]
+
+Before: [2, 1, 0, 1]
+4 1 0 0
+After: [0, 1, 0, 1]
+
+Before: [3, 2, 2, 3]
+8 2 1 3
+After: [3, 2, 2, 1]
+
+Before: [3, 1, 2, 2]
+7 3 0 3
+After: [3, 1, 2, 1]
+
+Before: [2, 1, 1, 3]
+1 2 2 1
+After: [2, 2, 1, 3]
+
+Before: [0, 0, 2, 0]
+0 0 1 2
+After: [0, 0, 0, 0]
+
+Before: [0, 3, 0, 1]
+0 0 3 2
+After: [0, 3, 0, 1]
+
+Before: [0, 2, 1, 3]
+0 0 3 1
+After: [0, 0, 1, 3]
+
+Before: [1, 3, 3, 0]
+3 3 2 3
+After: [1, 3, 3, 1]
+
+Before: [0, 0, 3, 1]
+9 0 0 2
+After: [0, 0, 0, 1]
+
+Before: [0, 0, 2, 1]
+12 3 1 1
+After: [0, 1, 2, 1]
+
+Before: [0, 1, 2, 2]
+9 0 0 2
+After: [0, 1, 0, 2]
+
+Before: [2, 0, 3, 2]
+15 0 2 0
+After: [2, 0, 3, 2]
+
+Before: [0, 1, 2, 1]
+0 0 1 3
+After: [0, 1, 2, 0]
+
+Before: [1, 2, 2, 0]
+14 0 2 2
+After: [1, 2, 0, 0]
+
+Before: [0, 2, 0, 3]
+9 0 0 2
+After: [0, 2, 0, 3]
+
+Before: [1, 2, 2, 3]
+6 3 1 1
+After: [1, 0, 2, 3]
+
+Before: [1, 0, 2, 0]
+6 2 2 1
+After: [1, 1, 2, 0]
+
+Before: [0, 0, 2, 1]
+5 3 2 1
+After: [0, 1, 2, 1]
+
+Before: [0, 3, 0, 1]
+0 0 2 1
+After: [0, 0, 0, 1]
+
+Before: [3, 3, 2, 1]
+6 2 2 1
+After: [3, 1, 2, 1]
+
+Before: [1, 0, 3, 0]
+3 3 2 2
+After: [1, 0, 1, 0]
+
+Before: [1, 2, 2, 0]
+14 0 2 3
+After: [1, 2, 2, 0]
+
+Before: [3, 2, 2, 2]
+7 3 0 0
+After: [1, 2, 2, 2]
+
+Before: [0, 1, 3, 0]
+13 1 2 2
+After: [0, 1, 0, 0]
+
+Before: [1, 1, 3, 1]
+8 2 3 2
+After: [1, 1, 0, 1]
+
+Before: [2, 1, 1, 1]
+4 1 0 3
+After: [2, 1, 1, 0]
+
+Before: [0, 1, 2, 1]
+5 3 2 3
+After: [0, 1, 2, 1]
+
+Before: [0, 1, 0, 3]
+6 3 3 0
+After: [1, 1, 0, 3]
+
+Before: [0, 0, 3, 1]
+12 3 1 0
+After: [1, 0, 3, 1]
+
+Before: [0, 3, 0, 2]
+9 0 0 1
+After: [0, 0, 0, 2]
+
+Before: [2, 2, 2, 1]
+5 3 2 1
+After: [2, 1, 2, 1]
+
+Before: [2, 3, 3, 1]
+15 0 2 1
+After: [2, 2, 3, 1]
+
+Before: [2, 2, 2, 2]
+8 2 0 3
+After: [2, 2, 2, 1]
+
+Before: [1, 2, 3, 1]
+8 2 3 2
+After: [1, 2, 0, 1]
+
+Before: [0, 1, 3, 0]
+9 0 0 3
+After: [0, 1, 3, 0]
+
+Before: [1, 2, 3, 2]
+15 3 2 1
+After: [1, 2, 3, 2]
+
+Before: [1, 1, 2, 0]
+2 1 2 2
+After: [1, 1, 0, 0]
+
+Before: [3, 1, 1, 3]
+10 1 3 1
+After: [3, 0, 1, 3]
+
+Before: [3, 3, 2, 3]
+10 2 3 3
+After: [3, 3, 2, 0]
+
+Before: [2, 1, 3, 3]
+4 1 0 2
+After: [2, 1, 0, 3]
+
+Before: [0, 1, 0, 2]
+0 0 1 2
+After: [0, 1, 0, 2]
+
+Before: [2, 1, 1, 0]
+4 1 0 3
+After: [2, 1, 1, 0]
+
+Before: [3, 2, 1, 0]
+1 2 2 1
+After: [3, 2, 1, 0]
+
+Before: [2, 1, 0, 2]
+4 1 0 1
+After: [2, 0, 0, 2]
+
+Before: [0, 0, 3, 3]
+0 0 3 3
+After: [0, 0, 3, 0]
+
+Before: [3, 1, 3, 2]
+6 2 1 0
+After: [0, 1, 3, 2]
+
+Before: [3, 3, 1, 2]
+7 3 0 0
+After: [1, 3, 1, 2]
+
+Before: [1, 1, 3, 2]
+13 1 2 3
+After: [1, 1, 3, 0]
+
+
+
+14 3 3 2
+14 3 3 0
+14 2 2 1
+13 0 2 1
+4 1 2 1
+1 3 1 3
+14 2 3 1
+14 2 0 0
+6 0 2 0
+4 0 3 0
+1 0 3 3
+14 2 3 0
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 0 3 3
+4 3 2 3
+4 3 2 3
+1 2 3 2
+14 2 3 0
+14 1 1 3
+14 0 3 1
+11 0 3 1
+4 1 3 1
+1 1 2 2
+4 1 0 1
+9 1 0 1
+4 0 0 3
+9 3 3 3
+2 3 0 0
+4 0 3 0
+1 2 0 2
+5 2 2 3
+14 0 2 2
+14 3 0 1
+14 2 3 0
+7 0 1 1
+4 1 3 1
+1 3 1 3
+5 3 2 0
diff --git a/day16/part1 b/day16/part1
new file mode 100755
index 0000000..228d55a
--- /dev/null
+++ b/day16/part1
@@ -0,0 +1,116 @@
+#!/usr/bin/env ruby
+
+input = $stdin.readlines.map(&:strip).reject(&:empty?)
+
+class Machine
+ def initialize(rs)
+ @rs = rs
+ end
+
+ def addr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] + @rs[b]
+ nrs
+ end
+ def addi(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] + b
+ nrs
+ end
+ def mulr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] * @rs[b]
+ nrs
+ end
+ def muli(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] * b
+ nrs
+ end
+ def banr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] & @rs[b]
+ nrs
+ end
+ def bani(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] & b
+ nrs
+ end
+ def borr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] | @rs[b]
+ nrs
+ end
+ def bori(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] | b
+ nrs
+ end
+ def setr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a]
+ nrs
+ end
+ def seti(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = a
+ nrs
+ end
+ def gtir(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = a > @rs[b] ? 1 : 0
+ nrs
+ end
+ def gtri(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] > b ? 1 : 0
+ nrs
+ end
+ def gtrr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] > @rs[b] ? 1 : 0
+ nrs
+ end
+ def eqir(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = a == @rs[b] ? 1 : 0
+ nrs
+ end
+ def eqri(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] == @rs[b] ? 1 : 0
+ nrs
+ end
+ def eqrr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] == @rs[b] ? 1 : 0
+ nrs
+ end
+
+ def oprs(a, b, c)
+ [
+ addr(a, b, c), addi(a, b, c),
+ mulr(a, b, c), muli(a, b, c),
+ banr(a, b, c), bani(a, b, c),
+ borr(a, b, c), bori(a, b, c),
+ setr(a, b, c), seti(a, b, c),
+ gtir(a, b, c), gtri(a, b, c), gtrr(a, b, c),
+ eqir(a, b, c), eqri(a, b, c), eqrr(a, b, c)
+ ]
+ end
+end
+
+gt3 = 0
+
+input.each_slice(3) do |sample|
+ sample[0] =~ /Before: \[(\d+), (\d+), (\d+), (\d+)\]/
+ break if $1.nil?
+ m = Machine.new([$1.to_i, $2.to_i, $3.to_i, $4.to_i])
+ sample[1] =~ /\d+ (\d+) (\d+) (\d+)/
+ oprs = m.oprs($1.to_i, $2.to_i, $3.to_i)
+ sample[2] =~ /After: \[(\d+), (\d+), (\d+), (\d+)\]/
+ gt3 += 1 if oprs.count([$1.to_i, $2.to_i, $3.to_i, $4.to_i]) > 2
+end
+
+puts gt3
diff --git a/day16/whodawhatnow b/day16/whodawhatnow
new file mode 100755
index 0000000..337cec1
--- /dev/null
+++ b/day16/whodawhatnow
@@ -0,0 +1,141 @@
+#!/usr/bin/env ruby
+
+input = $stdin.readlines.map(&:strip).reject(&:empty?)
+
+class Machine
+ def initialize(rs)
+ @rs = rs
+ end
+
+ def addr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] + @rs[b]
+ nrs
+ end
+ def addi(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] + b
+ nrs
+ end
+ def mulr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] * @rs[b]
+ nrs
+ end
+ def muli(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] * b
+ nrs
+ end
+ def banr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] & @rs[b]
+ nrs
+ end
+ def bani(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] & b
+ nrs
+ end
+ def borr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] | @rs[b]
+ nrs
+ end
+ def bori(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] | b
+ nrs
+ end
+ def setr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a]
+ nrs
+ end
+ def seti(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = a
+ nrs
+ end
+ def gtir(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = a > @rs[b] ? 1 : 0
+ nrs
+ end
+ def gtri(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] > b ? 1 : 0
+ nrs
+ end
+ def gtrr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] > @rs[b] ? 1 : 0
+ nrs
+ end
+ def eqir(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = a == @rs[b] ? 1 : 0
+ nrs
+ end
+ def eqri(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] == @rs[b] ? 1 : 0
+ nrs
+ end
+ def eqrr(a, b, c)
+ nrs = @rs.dup
+ nrs[c] = @rs[a] == @rs[b] ? 1 : 0
+ nrs
+ end
+
+ def oprs(a, b, c)
+ [
+ addr(a, b, c), addi(a, b, c),
+ mulr(a, b, c), muli(a, b, c),
+ banr(a, b, c), bani(a, b, c),
+ borr(a, b, c), bori(a, b, c),
+ setr(a, b, c), seti(a, b, c),
+ gtir(a, b, c), gtri(a, b, c), gtrr(a, b, c),
+ eqir(a, b, c), eqri(a, b, c), eqrr(a, b, c)
+ ]
+ end
+end
+
+oprsorder = {
+ 1<<15 => "addr", 1<<14 => "addi",
+ 1<<13 => "mulr", 1<<12 => "muli",
+ 1<<11 => "banr", 1<<10 => "bani",
+ 1<<9 => "borr", 1<<8 => "bori",
+ 1<<7 => "setr", 1<<6 => "seti",
+ 1<<5 => "gtir", 1<<4 => "grri", 1<<3 => "gtrr",
+ 1<<2 => "eqir", 1<<1 => "eqri", 1<<0 => "eqrr"
+}
+
+ops = [
+ 0b1111111111111111, 0b1111111111111111,
+ 0b1111111111111111, 0b1111111111111111,
+ 0b1111111111111111, 0b1111111111111111,
+ 0b1111111111111111, 0b1111111111111111,
+ 0b1111111111111111, 0b1111111111111111,
+ 0b1111111111111111, 0b1111111111111111, 0b1111111111111111,
+ 0b1111111111111111, 0b1111111111111111, 0b1111111111111111
+]
+
+input.each_slice(3) do |sample|
+ sample[0] =~ /Before: \[(\d+), (\d+), (\d+), (\d+)\]/
+ break if $1.nil?
+ m = Machine.new([$1.to_i, $2.to_i, $3.to_i, $4.to_i])
+
+ sample[1] =~ /(\d+) (\d+) (\d+) (\d+)/
+ opc = $1.to_i
+ oprs = m.oprs($2.to_i, $3.to_i, $4.to_i)
+
+ sample[2] =~ /After: \[(\d+), (\d+), (\d+), (\d+)\]/
+ a = [$1.to_i, $2.to_i, $3.to_i, $4.to_i]
+
+ ops[opc] &= oprs.map{|opr|opr == a ? 1 : 0}.join.to_i(2)
+end
+
+(0..15).each do |opc|
+ puts "#{opc}: #{oprsorder[ops[opc]]}"
+end