printing paths in tree