Codeforces Beta Round #9 (Div. 2 Only) D