Codeforces Round #460 (Div. 2) D. Substring(拓扑排序)

NoSuchKey