"""simple docstring"""







import os



def 			A__						(  )     ->       int:
   __lowerCamelCase								=				os.path.dirname(os.path.realpath(lowercase_	)	)
   __lowerCamelCase								=				os.path.join(lowercase_			,   'triangle.txt'	)

   with open(lowercase_	) as in_file:
      __lowerCamelCase								=				[[int(lowercase_	) for i in line.split()] for line in in_file]

   while len(lowercase_	) != 1:
      __lowerCamelCase								=				triangle.pop()
      __lowerCamelCase								=				triangle[-1]
      for j in range(len(lowercase_	) - 1	):
         curr_row[j] += max(last_row[j]			,   last_row[j + 1]	)
   return triangle[0][0]


if __name__ == "__main__":
     print(solution())







"""simple docstring"""







_SCREAMING_SNAKE_CASE  :		Optional[Any]        =      {
    0: '''underwear''',
    1: '''pants''',
    2: '''belt''',
    3: '''suit''',
    4: '''shoe''',
    5: '''socks''',
    6: '''shirt''',
    7: '''tie''',
    8: '''watch''',
}

_SCREAMING_SNAKE_CASE  :		List[str]        =      [[1, 4], [2, 4], [3], [], [], [4], [2, 7], [3], []]

_SCREAMING_SNAKE_CASE  :		Optional[Any]        =      [0 for x in range(len(graph))]
_SCREAMING_SNAKE_CASE  :		List[Any]        =      []



def 			A__						(  lowercase_    :  Optional[int]			,   lowercase_    :  List[str]	)     ->       List[str]:
   __lowerCamelCase								=				1
   while stack:
      __lowerCamelCase								=				stack.pop()
      print(lowercase_			,   clothes[current_clothing]	)
      order += 1



def 			A__						(  lowercase_    :  List[Any]			,   lowercase_    :  List[str]			,   lowercase_    :  Union[str, Any]	)     ->       List[Any]:
   __lowerCamelCase								=				1
   for v in graph[u]:
      if not visited[v]:
         depth_first_search(lowercase_			,   lowercase_			,   lowercase_	)

   stack.append(lowercase_	)



def 			A__						(  lowercase_    :  Dict			,   lowercase_    :  Optional[Any]	)     ->       Union[str, Any]:
   for v in range(len(lowercase_	)	):
      if not visited[v]:
         depth_first_search(lowercase_			,   lowercase_			,   lowercase_	)


if __name__ == "__main__":
     topological_sort(graph, visited)
     print(stack)
     print_stack(stack, clothes)






