Codeforces Round #503 (by SIS, Div. 2)-B. Badge

NoSuchKey