Codeforces Round #460 (Div. 2) D. Substring(dfs/scc/topo)

NoSuchKey