
# Python3 Program to print binary tree in 2D 
COUNT = [10] 
  
def print2DUtil(root, space) :
  
    # Base case 
    if (root == None) :
        return
  
    # Increase distance between levels 
    space += COUNT[0]
  
    # Process right child first 
    print2DUtil(root.right, space) 
  
    # Print current node after space 
    # count 
    print() 
    for i in range(COUNT[0], space):
        print(end = " ") 
    print('{' + str(root.z) + ', ' + str(root.fixed_vars) + '}') 
  
    # Process left child 
    print2DUtil(root.left, space) 
  
# Wrapper over print2DUtil() 
def print2D(root) :
      
    # space=[0]
    # Pass initial space count as 0 
    print2DUtil(root, 0) 