Rosetta Problems

Ninja of Train

https://atcoder.jp/contests/autumn_fest/tasks/autumn_fest_10