Rosetta Problems

Decryption of the Rotation Cipher

https://atcoder.jp/contests/awc0146/tasks/awc0146_d