Codeforces 1080B. Margarite and the best present

NoSuchKey