Codeforces Round #164 (Div. 2) B. Buttons

NoSuchKey