"""simple docstring"""




from typing import Optional, Union

import torch
from torch import nn

from ...configuration_utils import ConfigMixin, register_to_config
from ...models.modeling_utils import ModelMixin

class       a_      (     __UpperCamelCase ,		__UpperCamelCase			):




					@register_to_config
					def __init__(	self						:     Dict  ,						snake_case__						:     int = 768  ,						):
							super().__init__()

							lowerCAmelCase__        =   nn.Parameter(torch.zeros(1  ,						snake_case__     )     )
							lowerCAmelCase__        =   nn.Parameter(torch.ones(1  ,						snake_case__     )     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     List[Any]  ,						snake_case__						:     Optional[Union[str, torch.device]] = None  ,						snake_case__						:     Optional[torch.dtype] = None  ,						):
							lowerCAmelCase__        =   nn.Parameter(self.mean.to(snake_case__     ).to(snake_case__     )     )
							lowerCAmelCase__        =   nn.Parameter(self.std.to(snake_case__     ).to(snake_case__     )     )
							return self




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]  ,						snake_case__						:     Any     ):
							lowerCAmelCase__        =   (embeds - self.mean) * 1.0 / self.std
							return embeds




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[int]  ,						snake_case__						:     Dict     ):
							lowerCAmelCase__        =   (embeds * self.std) + self.mean
							return embeds





"""simple docstring"""




import os







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		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())




