Suffix Tree Builder (ukkonens construction algorithm)

Input a string to see its suffix tree ($ is reserved for termination symbol)