



'''simple docstring'''





import os

def        a_     (							)      ->      str:
  __lowerCamelCase       :       Any           = os.path.dirname(os.path.realpath(_lowerCAmelCase       )       )
  __lowerCamelCase       :       Any           = os.path.join(_lowerCAmelCase       ,'triangle.txt'       )

  with open(_lowerCAmelCase       ) as f:
    __lowerCamelCase       :       List[Any]           = f.readlines()

  __lowerCamelCase       :       List[str]           = []
  for line in triangle:
    __lowerCamelCase       :       Dict           = []
    for number in line.strip().split(' '       ):
      numbers_from_line.append(int(_lowerCAmelCase       )       )
    a.append(_lowerCAmelCase       )

  for i in range(1       ,len(_lowerCAmelCase       )       ):
    for j in range(len(a[i]       )       ):
      __lowerCamelCase       :       List[Any]           = a[i - 1][j] if j != len(a[i - 1]       ) else 0
      __lowerCamelCase       :       str           = a[i - 1][j - 1] if j > 0 else 0
      a[i][j] += max(_lowerCAmelCase       ,_lowerCAmelCase       )
  return max(a[-1]       )


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











'''simple docstring'''





def        a_     (							_lowerCAmelCase       )      ->      str:
  if not all(char in '01' for char in bin_string       ):
    raise ValueError('Non-binary value was passed to the function'       )
  if not bin_string:
    raise ValueError('Empty string was passed to the function'       )
  __lowerCamelCase       :       int           = ''
  while len(_lowerCAmelCase       ) % 3 != 0:
    __lowerCamelCase       :       str           = '0' + bin_string
  __lowerCamelCase       :       Union[str, Any]           = [
      bin_string[index : index + 3]
      for index in range(len(_lowerCAmelCase       )       )
      if index % 3 == 0
  ]
  for bin_group in bin_string_in_3_list:
    __lowerCamelCase       :       Tuple           = 0
    for index, val in enumerate(_lowerCAmelCase       ):
      oct_val += int(2 ** (2 - index) * int(_lowerCAmelCase       )       )
    oct_string += str(_lowerCAmelCase       )
  return oct_string


if __name__ == "__main__":
   from doctest import testmod

   testmod()






