





import os

def     a_       (					):
   __lowerCAmelCase				      =      os.path.dirname(os.path.realpath(lowerCAmelCase_      )      )
   __lowerCAmelCase				      =      os.path.join(lowerCAmelCase_,      'triangle.txt'      )

   with open(lowerCAmelCase_      ) as f:
      __lowerCAmelCase				      =      f.readlines()

   __lowerCAmelCase				      =      []
   for line in triangle:
      __lowerCAmelCase				      =      []
      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				      =      a[i - 1][j] if j != len(a[i - 1]      ) else 0
         __lowerCAmelCase				      =      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())





import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
	from transformers import AutoModelForSeqaSeqLM, AutoTokenizer




@require_torch
@require_sentencepiece
@require_tokenizers
class       lowercase_					(unittest.TestCase   ):





				@slow
				def 						__UpperCamelCase    (				self)  -> Optional[int]:
											a__      =AutoModelForSeqaSeqLM.from_pretrained('google/mt5-small'       ,  return_dict=lowercase_).to(lowercase_)
											a__      =AutoTokenizer.from_pretrained('google/mt5-small')

											a__      =tokenizer('Hello there'       ,  return_tensors='pt').input_ids
											a__      =tokenizer('Hi I am'       ,  return_tensors='pt').input_ids

											a__      =model(input_ids.to(lowercase_)       ,  labels=labels.to(lowercase_)).loss
											a__      =-(labels.shape[-1] * loss.item())

											a__      =-84.91_27
											self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 1e-4)

