




import os






def 				UpperCAmelCase__  (							):






  """simple docstring"""


  a_		    =  os.path.dirname(os.path.realpath(_A			)			)
  a_		    =  os.path.join(_A      ,      '''triangle.txt'''			)

  with open(_A			) as f:
    a_		    =  f.readlines()

  a_		    =  [[int(_A			) for y in x.rstrip('''\r\n'''			).split(''' '''			)] for x in triangle]

  for i in range(1      ,      len(_A			)			):
    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(_A      ,      _A			)
  return max(a[-1]			)


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






import io
import json
import subprocess


UpperCamelCase__       				=	[
    ['''en''', '''ru'''],
    ['''ru''', '''en'''],
    ['''en''', '''de'''],
    ['''de''', '''en'''],
]

UpperCamelCase__       				=	8






def 				UpperCAmelCase__  (							_A      ,      _A			):






  """simple docstring"""


  a_		    =  {}
  for src, tgt in pairs:
    a_		    =  f"{src}-{tgt}"
    a_		    =  f"sacrebleu -t wmt19 -l {pair} --echo src".split()
    a_		    =  subprocess.run(_A      ,      stdout=subprocess.PIPE			).stdout.decode('''utf-8'''			).splitlines()
    a_		    =  f"sacrebleu -t wmt19 -l {pair} --echo ref".split()
    a_		    =  subprocess.run(_A      ,      stdout=subprocess.PIPE			).stdout.decode('''utf-8'''			).splitlines()
    a_		    =  {'''src''': src_lines[:n_objs], '''tgt''': tgt_lines[:n_objs]}
  return text


UpperCamelCase__       				=	get_all_data(pairs, n_objs)
UpperCamelCase__       				=	'''./fsmt_val_data.json'''
with io.open(filename, '''w''', encoding='''utf-8''') as f:
  UpperCamelCase__       				=	json.dump(text, f, indent=2, ensure_ascii=False)
