Suffix Automaton

some codes and problems about suffix automaton