

import os
def       UpperCAmelCase__    (      )			->			Optional[Any]:
       A_						=      os.path.dirname(os.path.realpath(UpperCamelCase__				)				)
       A_						=      os.path.join(UpperCamelCase__,       """triangle.txt"""				)

       with open(UpperCamelCase__				) as f:
              A_						=      f.readlines()

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

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


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



'''simple docstring'''







import warnings

from diffusers import StableDiffusionImgaImgPipeline  # noqa F401


warnings.warn(
    '''The `image_to_image.py` script is outdated. Please use directly `from diffusers import'''
    ''' StableDiffusionImg2ImgPipeline` instead.'''
)
