




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a__		    =    {
    '''configuration_musicgen''': [
        '''MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''MusicgenConfig''',
        '''MusicgenDecoderConfig''',
    ],
    '''processing_musicgen''': ['''MusicgenProcessor'''],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a__		    =    [
     '''MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''MusicgenForConditionalGeneration''',
     '''MusicgenForCausalLM''',
     '''MusicgenModel''',
     '''MusicgenPreTrainedModel''',
 ]

if TYPE_CHECKING:
 from .configuration_musicgen import (
     MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP,
     MusicgenConfig,
     MusicgenDecoderConfig,
 )
 from .processing_musicgen import MusicgenProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_musicgen import (
      MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST,
      MusicgenForCausalLM,
      MusicgenForConditionalGeneration,
      MusicgenModel,
      MusicgenPreTrainedModel,
  )

else:
 import sys

 a__		    =    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)












import os





def 							A__   ()    ->	int:
					__UpperCamelCase				:  int								=			os.path.dirname(os.path.realpath(snake_case							)							)
					__UpperCamelCase				:  List[str]								=			os.path.join(snake_case		,  """triangle.txt"""							)

					with open(snake_case							) as in_file:
										__UpperCamelCase				:  Optional[Any]								=			[[int(snake_case							) for i in line.split()] for line in in_file]

					while len(snake_case							) != 1:
										__UpperCamelCase				:  Union[str, Any]								=			triangle.pop()
										__UpperCamelCase				:  List[str]								=			triangle[-1]
										for j in range(len(snake_case							) - 1							):
															curr_row[j] += max(last_row[j]		,  last_row[j + 1]							)
					return triangle[0][0]


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






