Rosetta Problems

Decoding Ancient Messages

https://atcoder.jp/contests/JAG2014Spring/tasks/icpc2014spring_c