Codeforces Round #461 (Div. 2) B. Magic Forest

NoSuchKey