

'''simple docstring'''



import torch
import torch.nn as nn
from transformers.modeling_utils import ModuleUtilsMixin
from transformers.models.ta.modeling_ta import (
    TaBlock,
    TaConfig,
    TaLayerNorm,
)

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







class 		lowerCAmelCase__     (   a				,      a				,      a      ):



 """simple docstring"""



 @register_to_config
 def __init__(	self      : Union[str, Any]      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : float      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : str      ,							__SCREAMING_SNAKE_CASE      : bool = False      ,							)						->				Optional[int]:


      """simple docstring"""




      super().__init__()

      __SCREAMING_SNAKE_CASE						     =   nn.Linear(__SCREAMING_SNAKE_CASE      ,							__SCREAMING_SNAKE_CASE      ,							bias=__SCREAMING_SNAKE_CASE    )

      __SCREAMING_SNAKE_CASE						     =   nn.Embedding(__SCREAMING_SNAKE_CASE      ,							__SCREAMING_SNAKE_CASE    )
      __SCREAMING_SNAKE_CASE						     =   False

      __SCREAMING_SNAKE_CASE						     =   nn.Dropout(p=__SCREAMING_SNAKE_CASE    )

      __SCREAMING_SNAKE_CASE						     =   TaConfig(
          d_model=__SCREAMING_SNAKE_CASE      ,							num_heads=__SCREAMING_SNAKE_CASE      ,							d_kv=__SCREAMING_SNAKE_CASE      ,							d_ff=__SCREAMING_SNAKE_CASE      ,							feed_forward_proj=__SCREAMING_SNAKE_CASE      ,							dropout_rate=__SCREAMING_SNAKE_CASE      ,							is_decoder=__SCREAMING_SNAKE_CASE      ,							is_encoder_decoder=__SCREAMING_SNAKE_CASE      ,							)
      __SCREAMING_SNAKE_CASE						     =   nn.ModuleList()
      for lyr_num in range(__SCREAMING_SNAKE_CASE    ):
           __SCREAMING_SNAKE_CASE						     =   TaBlock(__SCREAMING_SNAKE_CASE    )
           self.encoders.append(__SCREAMING_SNAKE_CASE    )

      __SCREAMING_SNAKE_CASE						     =   TaLayerNorm(__SCREAMING_SNAKE_CASE    )
      __SCREAMING_SNAKE_CASE						     =   nn.Dropout(p=__SCREAMING_SNAKE_CASE    )


 def    UpperCAmelCase__	(	self      : str      ,							__SCREAMING_SNAKE_CASE      : Optional[Any]      ,							__SCREAMING_SNAKE_CASE      : Optional[int]    )						->				List[str]:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE						     =   self.input_proj(__SCREAMING_SNAKE_CASE    )

      # terminal relative positional encodings
      __SCREAMING_SNAKE_CASE						     =   encoder_inputs.shape[1]
      __SCREAMING_SNAKE_CASE						     =   torch.arange(__SCREAMING_SNAKE_CASE      ,							device=encoder_inputs.device    )

      __SCREAMING_SNAKE_CASE						     =   encoder_inputs_mask.sum(-1    )
      __SCREAMING_SNAKE_CASE						     =   torch.roll(input_positions.unsqueeze(0    )      ,							tuple(seq_lens.tolist()    )      ,							dims=0    )
      x += self.position_encoding(__SCREAMING_SNAKE_CASE    )

      __SCREAMING_SNAKE_CASE						     =   self.dropout_pre(__SCREAMING_SNAKE_CASE    )

      # inverted the attention mask
      __SCREAMING_SNAKE_CASE						     =   encoder_inputs.size()
      __SCREAMING_SNAKE_CASE						     =   self.get_extended_attention_mask(__SCREAMING_SNAKE_CASE      ,							__SCREAMING_SNAKE_CASE    )

      for lyr in self.encoders:
           __SCREAMING_SNAKE_CASE						     =   lyr(__SCREAMING_SNAKE_CASE      ,							__SCREAMING_SNAKE_CASE    )[0]
      __SCREAMING_SNAKE_CASE						     =   self.layer_norm(__SCREAMING_SNAKE_CASE    )

      return self.dropout_post(__SCREAMING_SNAKE_CASE    ), encoder_inputs_mask









'''simple docstring'''



def      a__ (						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE						     =   1

     while True:
          if (
              sorted(str(a__		)		)
              == sorted(str(2 * i		)		)
              == sorted(str(3 * i		)		)
              == sorted(str(4 * i		)		)
              == sorted(str(5 * i		)		)
              == sorted(str(6 * i		)		)
          ):
               return i

          i += 1


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






