Rosetta Problems

Yet Another mod M

https://atcoder.jp/contests/abc272/tasks/abc272_g