Codeforces Global Round 3:B. Born This Way

NoSuchKey