Codeforces Round #549 (Div. 2) D. The Beatles

NoSuchKey