Codeforces Round #210 Problem E Levko and Game