text: # """
  # This is the ImmutableListNode's API interface.
  # You should not implement it, or speculate about its implementation.
  # """
  # class ImmutableListNode:
  #     def printValue(self) -> None: # print the value of this node.
  #     def getNext(self) -> 'ImmutableListNode': # return the next node.
  
  class Solution:
      def printLinkedListInReverse(self, head: 'ImmutableListNode') -> None:
          if head is None:
              return
          nextNode = head.getNext()
          if nextNode is not None:
              self.printLinkedListInReverse(nextNode)
          head.printValue()