Solution of 2012 exam by Andrei Zubanov