Data structures problems, UF, ST, Trie