Codeforce 1494B. Berland Crossword(思维)

NoSuchKey