text: """
  # Definition for a Node.
  class Node:
      def __init__(self, val=None, children=None):
          self.val = val
          self.children = children
  """
  
  class Solution:
      def levelOrder(self, root: 'Node') -> List[List[int]]:
          if not root: return []
          queue = deque([root])
          res = []
          
          while queue:
              N = len(queue)
              tmp = []
              while N:
                  node = queue.popleft()
                  for child in node.children:
                      queue.append(child)
                  tmp.append(node.val)
                  N -= 1
              res.append(tmp)
              
          return res
              
  