Codeforces Round #189 Problem ABCD