Codeforces 987C. Three displays(o(n^2))

NoSuchKey