'''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       UpperCAmelCase  (						SCREAMING_SNAKE_CASE__   ,						SCREAMING_SNAKE_CASE__   ,						SCREAMING_SNAKE_CASE__ ):





       '''simple docstring'''



       @register_to_config
       def __init__(						self     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase     ,       __lowerCAmelCase = False     ,       )  ->  int:
        super().__init__()

        lowercase__    :   Tuple						= nn.Embedding(a_     ,       a_			)

        lowercase__    :   int						= nn.Embedding(a_     ,       a_			)
        lowercase__    :   str						= False

        lowercase__    :   str						= nn.Dropout(p=a_			)

        lowercase__    :   List[Any]						= TaConfig(
            vocab_size=a_     ,       d_model=a_     ,       num_heads=a_     ,       d_kv=a_     ,       d_ff=a_     ,       dropout_rate=a_     ,       feed_forward_proj=a_     ,       is_decoder=a_     ,       is_encoder_decoder=a_     ,       )

        lowercase__    :   str						= nn.ModuleList()
        for lyr_num in range(a_			):
         lowercase__    :   Optional[Any]						= TaBlock(a_			)
         self.encoders.append(a_			)

        lowercase__    :   Optional[int]						= TaLayerNorm(a_			)
        lowercase__    :   Tuple						= nn.Dropout(p=a_			)


       def _lowerCAmelCase(						self     ,       __lowerCAmelCase     ,       __lowerCAmelCase			)  ->  Optional[int]:
        lowercase__    :   Optional[int]						= self.token_embedder(a_			)

        lowercase__    :   List[str]						= encoder_input_tokens.shape[1]
        lowercase__    :   str						= torch.arange(a_     ,       device=encoder_input_tokens.device			)
        x += self.position_encoding(a_			)

        lowercase__    :   List[Any]						= self.dropout_pre(a_			)

        # inverted the attention mask
        lowercase__    :   Optional[Any]						= encoder_input_tokens.size()
        lowercase__    :   List[Any]						= self.get_extended_attention_mask(a_     ,       a_			)

        for lyr in self.encoders:
         lowercase__    :   List[Any]						= lyr(a_     ,       a_			)[0]
        lowercase__    :   Tuple						= self.layer_norm(a_			)

        return self.dropout_post(a_			), encoder_inputs_mask


'''simple docstring'''

def       __UpperCamelCase	(       UpperCAmelCase					):

 def merge(UpperCAmelCase		,					UpperCAmelCase					) -> list:

  def _merge():
   while left and right:
    yield (left if left[0] <= right[0] else right).pop(0					)
   yield from left
   yield from right

  return list(_merge()					)

 if len(UpperCAmelCase					) <= 1:
  return collection
 lowercase__    :   int						= len(UpperCAmelCase					) // 2
 return merge(merge_sort(collection[:mid]					)		,					merge_sort(collection[mid:]					)					)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  __a:			str	       =       input("""Enter numbers separated by a comma:\n""").strip()
  __a:			Optional[int]	       =       [int(item) for item in user_input.split(""",""")]
  print(*merge_sort(unsorted), sep=""",""")

