parameters: (self)
return_statement: return res.val
docstring: @return the next smallest number
function: def next(self) -> int:
          """
          @return the next smallest number
          """
          while self.p:
              self.stk.append(self.p)
              self.p = self.p.left
  
          res = self.stk.pop()
          self.p = res.right
  
          return res.val
function_tokens: def next ( self ) -> int : while self . p : self . stk . append ( self . p ) self . p = self . p . left res = self . stk . pop ( ) self . p = res . right return res . val