Rosetta Problems

とても長い文字列

https://atcoder.jp/contests/code-festival-2014-quala/tasks/code_festival_qualA_b