Rosetta Problems

Love Permutation, Run run run!

https://onlinejudge.u-aizu.ac.jp/problems/2822