http://informatics.mccme.ru; problem 2; WA test 10