Rosetta Problems

Teleporter Takahashi

https://atcoder.jp/contests/abc289/tasks/abc289_f