Codeforces AIM 4 D2D