

'''simple docstring'''
from __future__ import annotations

from typing import TypedDict


class   a__    (				__lowerCAmelCase    ):
   _SCREAMING_SNAKE_CASE       :	str
   _SCREAMING_SNAKE_CASE       :	int







def    _A						(      snake_case	)     ->      list[str]:




   if not isinstance(_UpperCamelCase						,				_UpperCamelCase	):
      raise TypeError("The parameter s type must be str."	)

   return [s[i:] + s[:i] for i in range(len(_UpperCamelCase	)	)]







def    _A						(      snake_case	)     ->      BWTTransformDict:




   if not isinstance(_UpperCamelCase						,				_UpperCamelCase	):
      raise TypeError("The parameter s type must be str."	)
   if not s:
      raise ValueError("The parameter s must not be empty."	)

   _lowercase     : Union[str, Any]     	=  all_rotations(_UpperCamelCase	)
   rotations.sort()  # sort the list of rotations in alphabetically order
   # make a string composed of the last char of each rotation
   _lowercase     : Optional[int]     	=  {
       "bwt_string": "".join([word[-1] for word in rotations]	),
       "idx_original_string": rotations.index(_UpperCamelCase	),
   }
   return response







def    _A						(      snake_case						,				snake_case	)     ->      str:




   if not isinstance(_UpperCamelCase						,				_UpperCamelCase	):
      raise TypeError("The parameter bwt_string type must be str."	)
   if not bwt_string:
      raise ValueError("The parameter bwt_string must not be empty."	)
   try:
      _lowercase     : Union[str, Any]     	=  int(_UpperCamelCase	)
   except ValueError:
      raise TypeError(
          "The parameter idx_original_string type must be int or passive"
          " of cast to int."	)
   if idx_original_string < 0:
      raise ValueError("The parameter idx_original_string must not be lower than 0."	)
   if idx_original_string >= len(_UpperCamelCase	):
      raise ValueError(
          "The parameter idx_original_string must be lower than" " len(bwt_string)."	)

   _lowercase     : Optional[int]     	=  [""] * len(_UpperCamelCase	)
   for _ in range(len(_UpperCamelCase	)	):
      for i in range(len(_UpperCamelCase	)	):
         _lowercase     : List[Any]     	=  bwt_string[i] + ordered_rotations[i]
      ordered_rotations.sort()
   return ordered_rotations[idx_original_string]


if __name__ == "__main__":
    _snake_case      =    '''Provide a string that I will generate its BWT transform: '''
    _snake_case      =    input(entry_msg).strip()
    _snake_case      =    bwt_transform(s)
    print(
        F'''Burrows Wheeler transform for string \'{s}\' results '''
        F'''in \'{result['bwt_string']}\''''
    )
    _snake_case      =    reverse_bwt(result['bwt_string'], result['idx_original_string'])
    print(
        F'''Reversing Burrows Wheeler transform for entry \'{result['bwt_string']}\' '''
        F'''we get original string \'{original_string}\''''
    )












'''simple docstring'''





from math import factorial





def       __a      (  _UpperCamelCase:       int = 100       )		->					int:

     """simple docstring"""




     return sum(map(_UpperCamelCase   ,		str(factorial(_UpperCamelCase       )       )       )       )


if __name__ == "__main__":
   print(solution(int(input('''Enter the Number: ''').strip())))


