Tre nary tree and string to long conversion