Rosetta Problems

Free Contest 27 - GEARS

https://oj.vnoi.info/problem/fc027_gears