Rosetta Problems

Dangerous Chemicals

https://atcoder.jp/contests/past202012-open/tasks/past202012_f