Codeforces Round #565 (Div. 3) C. Lose it!

NoSuchKey