






import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format




class 			snake_case__   :

       '''simple docstring'''
       lowerCamelCase							:				Optional[int] 				= None



       def 					__lowercase						(							self    ) ->      Union[str, Any]:






            '''simple docstring'''





            __snake_case			:Tuple          =						self.feature_extraction_class(**self.feat_extract_dict    )
            __snake_case			:int          =						json.loads(feat_extract.to_json_string()    )
            for key, value in self.feat_extract_dict.items():
                 self.assertEqual(obj[key]			,						a__    )



       def 					__lowercase						(							self    ) ->      Dict:






            '''simple docstring'''





            __snake_case			:str          =						self.feature_extraction_class(**self.feat_extract_dict    )

            with tempfile.TemporaryDirectory() as tmpdirname:
                 __snake_case			:Dict          =						os.path.join(a__			,						"""feat_extract.json"""    )
                 feat_extract_first.to_json_file(a__    )
                 __snake_case			:str          =						self.feature_extraction_class.from_json_file(a__    )

            self.assertEqual(feat_extract_second.to_dict()			,						feat_extract_first.to_dict()    )



       def 					__lowercase						(							self    ) ->      Optional[int]:






            '''simple docstring'''





            __snake_case			:List[Any]          =						self.feature_extraction_class(**self.feat_extract_dict    )

            with tempfile.TemporaryDirectory() as tmpdirname:
                 __snake_case			:Optional[Any]          =						feat_extract_first.save_pretrained(a__    )[0]
                 check_json_file_has_correct_format(a__    )
                 __snake_case			:Any          =						self.feature_extraction_class.from_pretrained(a__    )

            self.assertEqual(feat_extract_second.to_dict()			,						feat_extract_first.to_dict()    )



       def 					__lowercase						(							self    ) ->      List[str]:






            '''simple docstring'''





            __snake_case			:Optional[int]          =						self.feature_extraction_class()
            self.assertIsNotNone(a__    )










import os






def   UpperCamelCase  (       ):




     '''simple docstring'''






     __snake_case			:List[str]          =						os.path.dirname(os.path.realpath(snake_case__  )  )
     __snake_case			:Union[str, Any]          =						os.path.join(snake_case__	,"""triangle.txt"""  )

     with open(snake_case__  ) as f:
          __snake_case			:int          =						f.readlines()

     __snake_case			:int          =						[]
     for line in triangle:
          __snake_case			:List[Any]          =						[]
          for number in line.strip().split(""" """  ):
               numbers_from_line.append(int(snake_case__  )  )
          a.append(snake_case__  )

     for i in range(1	,len(snake_case__  )  ):
          for j in range(len(a[i]  )  ):
               __snake_case			:Union[str, Any]          =						a[i - 1][j] if j != len(a[i - 1]  ) else 0
               __snake_case			:Dict          =						a[i - 1][j - 1] if j > 0 else 0
               a[i][j] += max(snake_case__	,snake_case__  )
     return max(a[-1]  )


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


