Rosetta Problems

Eating Symbols Hard

https://atcoder.jp/contests/arc099/tasks/arc099_d