hopcroft
some template maybe not correct^-^