Problem author: MikeMirzayanov.

Problem author: MikeMirzayanov, Kniaz.

Problem author: Kniaz.

Problem author: MikeMirzayanov, Kniaz.

Problem author: Kniaz.

Problem author: Kniaz.

I want to thank Mikhail Piklyaev (PikMike) for translation of tutorial!