Rosetta Problems

Gym with Many Rules

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