Think about how you could index the intermediate visits of a node between its first and last visits.