Rosetta Problems

Snuke and Spells

https://atcoder.jp/contests/agc017/tasks/agc017_c