Codeforces 1196D2. RGB Substring (hard version)

NoSuchKey