Rosetta Problems

Three Permutations

https://atcoder.jp/contests/abc214/tasks/abc214_g