






from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowerCamelCase__							=     logging.get_logger(__name__)

lowerCamelCase__							=     {
    """microsoft/swin-tiny-patch4-window7-224""": (
        """https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json"""
    ),
    # See all Swin models at https://huggingface.co/models?filter=swin
}




class 			snake_case__   (							lowercase_	,    lowercase_):

       '''simple docstring'''
       lowerCamelCase							:				Tuple 				= "swin"

       lowerCamelCase							:				int 				= {
           "num_attention_heads": "num_heads",
           "num_hidden_layers": "num_layers",
       }



       def __init__(							self			,						a__=2_24			,						a__=4			,						a__=3			,						a__=96			,						a__=[2, 2, 6, 2]			,						a__=[3, 6, 12, 24]			,						a__=7			,						a__=4.0			,						a__=True			,						a__=0.0			,						a__=0.0			,						a__=0.1			,						a__="gelu"			,						a__=False			,						a__=0.02			,						a__=1e-5			,						a__=32			,						a__=None			,						a__=None			,						**a__			,						) ->      List[str]:






            '''simple docstring'''





            super().__init__(**a__    )

            __snake_case			:Optional[int]          =						image_size
            __snake_case			:List[Any]          =						patch_size
            __snake_case			:List[Any]          =						num_channels
            __snake_case			:Dict          =						embed_dim
            __snake_case			:Tuple          =						depths
            __snake_case			:Optional[int]          =						len(a__    )
            __snake_case			:Tuple          =						num_heads
            __snake_case			:List[Any]          =						window_size
            __snake_case			:Optional[Any]          =						mlp_ratio
            __snake_case			:Union[str, Any]          =						qkv_bias
            __snake_case			:List[Any]          =						hidden_dropout_prob
            __snake_case			:Tuple          =						attention_probs_dropout_prob
            __snake_case			:Union[str, Any]          =						drop_path_rate
            __snake_case			:List[Any]          =						hidden_act
            __snake_case			:int          =						use_absolute_embeddings
            __snake_case			:Tuple          =						layer_norm_eps
            __snake_case			:Optional[Any]          =						initializer_range
            __snake_case			:List[Any]          =						encoder_stride
            # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
            # this indicates the channel dimension after the last stage of the model
            __snake_case			:Dict          =						int(embed_dim * 2 ** (len(a__    ) - 1)    )
            __snake_case			:Optional[int]          =						["""stem"""] + [F'''stage{idx}''' for idx in range(1			,						len(a__    ) + 1    )]
            __snake_case       , __snake_case			:List[Any]          =						get_aligned_output_features_output_indices(
                out_features=a__			,						out_indices=a__			,						stage_names=self.stage_names    )




class 			snake_case__   (							lowercase_):

       '''simple docstring'''
       lowerCamelCase							:				List[Any] 				= version.parse("1.11")



       @property
       def 					__lowercase						(							self    ) ->      Mapping[str, Mapping[int, str]]:






            '''simple docstring'''





            return OrderedDict(
                [
                    ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
                ]    )



       @property
       def 					__lowercase						(							self    ) ->      float:






            '''simple docstring'''





            return 1e-4










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


