import os


def      a__ (		):
      SCREAMING_SNAKE_CASE_          =  os.path.dirname(os.path.realpath(__SCREAMING_SNAKE_CASE				)				)
      SCREAMING_SNAKE_CASE_          =  os.path.join(__SCREAMING_SNAKE_CASE     ,      "triangle.txt"				)

      with open(__SCREAMING_SNAKE_CASE				) as f:
            SCREAMING_SNAKE_CASE_          =  f.readlines()

      SCREAMING_SNAKE_CASE_          =  []
      for line in triangle:
            SCREAMING_SNAKE_CASE_          =  []
            for number in line.strip().split(" "				):
                  numbers_from_line.append(int(__SCREAMING_SNAKE_CASE				)				)
            a.append(__SCREAMING_SNAKE_CASE				)

      for i in range(1     ,      len(__SCREAMING_SNAKE_CASE				)				):
            for j in range(len(a[i]				)				):
                  SCREAMING_SNAKE_CASE_          =  a[i - 1][j] if j != len(a[i - 1]				) else 0
                  SCREAMING_SNAKE_CASE_          =  a[i - 1][j - 1] if j > 0 else 0
                  a[i][j] += max(__SCREAMING_SNAKE_CASE     ,      __SCREAMING_SNAKE_CASE				)
      return max(a[-1]				)


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



from collections.abc import Callable


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  a
      SCREAMING_SNAKE_CASE_          =  b
      if function(__UpperCamelCase				) == 0:  # one of the a or b is a root for the function
            return a
      elif function(__UpperCamelCase				) == 0:
            return b
      elif (
          function(__UpperCamelCase				) * function(__UpperCamelCase				) > 0
      ):  # if none of these are root and they are both positive or negative,
            # then this algorithm can't find the root
            raise ValueError("could not find root in given interval."				)
      else:
            SCREAMING_SNAKE_CASE_          =  start + (end - start) / 2.0
            while abs(start - mid				) > 1_0**-7:  # until precisely equals to 10^-7
                  if function(__UpperCamelCase				) == 0:
                        return mid
                  elif function(__UpperCamelCase				) * function(__UpperCamelCase				) < 0:
                        SCREAMING_SNAKE_CASE_          =  mid
                  else:
                        SCREAMING_SNAKE_CASE_          =  mid
                  SCREAMING_SNAKE_CASE_          =  start + (end - start) / 2.0
            return mid


def      a__ (		__UpperCamelCase				):
      return x**3 - 2 * x - 5


if __name__ == "__main__":
      print(bisection(f, 1, 10_00))

      import doctest

      doctest.testmod()


