

"""simple docstring"""




import os



def 						__a      (  ):





       """simple docstring"""







       _a          =				os.path.dirname(os.path.realpath(a					)					)
       _a          =				os.path.join(a,		"triangle.txt"					)

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

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


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




"""simple docstring"""




from __future__ import annotations



def 						__a      (  a,		a					):





       """simple docstring"""







       assert len(a					) == len(a					)

       _a          =				len(a					)
       _a          =				list(range(a					)					)
       _a          =				[-1] * n  # who the donor has donated to
       _a          =				[-1] * n  # who the recipient has received from
       _a          =				[0] * n

       while unmatched_donors:
              _a          =				unmatched_donors[0]
              _a          =				donor_pref[donor]
              _a          =				donor_preference[num_donations[donor]]
              num_donations[donor] += 1
              _a          =				recipient_pref[recipient]
              _a          =				rec_record[recipient]

              if prev_donor != -1:
                     if rec_preference.index(a					) > rec_preference.index(a					):
                            _a          =				donor
                            _a          =				recipient
                            unmatched_donors.append(a					)
                            unmatched_donors.remove(a					)
              else:
                     _a          =				donor
                     _a          =				recipient
                     unmatched_donors.remove(a					)
       return donor_record
