Rosetta Problems

Everlasting -One-

https://atcoder.jp/contests/jag2013autumn/tasks/icpc2013autumn_d