Codeforces -1012B Chemical table (思维+并查集)

NoSuchKey