






def 						_a    (      a :int )							->			Tuple:
 a		  =      []
 a		  =      set({'''(''', '''[''', '''{'''} )
 a		  =      set({''')''', ''']''', '''}'''} )
 a		  =      {'''{''': '''}''', '''[''': ''']''', '''(''': ''')'''}

 for i in range(len(a ) ):
  if s[i] in open_brackets:
   stack.append(s[i] )

  elif s[i] in closed_brackets and (
      len(a ) == 0 or (len(a ) > 0 and open_to_closed[stack.pop()] != s[i])
  ):
   return False

 return len(a ) == 0
def 						_a    (      )							->			int:
 a		  =      input('''Enter sequence of brackets: ''' )
 if is_balanced(a ):
  print(a	,							'''is balanced''' )
 else:
  print(a	,							'''is not balanced''' )


if __name__ == "__main__":
     main()









def 		A_				(     _lowerCAmelCase = 50     )						-> int:
 UpperCamelCase	:					List[Any]       	=   [[0] * 3 for _ in range(length + 1     )]

 for row_length in range(length + 1     ):
  for tile_length in range(2							,   5     ):
   for tile_start in range(row_length - tile_length + 1     ):
    different_colour_ways_number[row_length][tile_length - 2] += (
        different_colour_ways_number[row_length - tile_start - tile_length][
            tile_length - 2
        ]
        + 1
    )

 return sum(different_colour_ways_number[length]     )


if __name__ == "__main__":
    print(f"""{solution() = }""")
