basic function that prints out constants found in a traversal