Solution by Maxim Kolodyazhny
