Solution for Beta 2010 task