Rosetta Problems

Can you solve this?

https://atcoder.jp/contests/abc121/tasks/abc121_b