






import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
       import ctypes
       import msvcrt  # noqa







       class  _lowercase   (   ctypes.Structure						):
             _a							:						Dict										=							[('size', ctypes.c_int), ('visible', ctypes.c_byte)]







def 			A__							(      ):





 '''simple docstring'''







 if os.name == "nt":
  snake_case__  :    Optional[Any]							       =CursorInfo()
  snake_case__  :    Tuple							       =ctypes.windll.kernelaa.GetStdHandle(-11	)
  ctypes.windll.kernelaa.GetConsoleCursorInfo(__SCREAMING_SNAKE_CASE		,  ctypes.byref(__SCREAMING_SNAKE_CASE	)	)
  snake_case__  :    Any							       =False
  ctypes.windll.kernelaa.SetConsoleCursorInfo(__SCREAMING_SNAKE_CASE		,  ctypes.byref(__SCREAMING_SNAKE_CASE	)	)
 elif os.name == "posix":
  sys.stdout.write("""\033[?25l"""	)
  sys.stdout.flush()







def 			A__							(      ):





 '''simple docstring'''







 if os.name == "nt":
  snake_case__  :    str							       =CursorInfo()
  snake_case__  :    Tuple							       =ctypes.windll.kernelaa.GetStdHandle(-11	)
  ctypes.windll.kernelaa.GetConsoleCursorInfo(__SCREAMING_SNAKE_CASE		,  ctypes.byref(__SCREAMING_SNAKE_CASE	)	)
  snake_case__  :    Dict							       =True
  ctypes.windll.kernelaa.SetConsoleCursorInfo(__SCREAMING_SNAKE_CASE		,  ctypes.byref(__SCREAMING_SNAKE_CASE	)	)
 elif os.name == "posix":
  sys.stdout.write("""\033[?25h"""	)
  sys.stdout.flush()







@contextmanager
def 			A__							(      ):





 '''simple docstring'''







 try:
  hide_cursor()
  yield
 finally:
  show_cursor()













from string import ascii_uppercase

__lowerCamelCase	:		List[Any]										=   {str(ord(c) - 55): c for c in ascii_uppercase}







def 			A__							(      _a  :					int		,  _a  :					int	):





 '''simple docstring'''







 if isinstance(_a		,  _a	):
  raise TypeError("""int() can't convert non-string with explicit base"""	)
 if num < 0:
  raise ValueError("""parameter must be positive int"""	)
 if isinstance(_a		,  _a	):
  raise TypeError("""'str' object cannot be interpreted as an integer"""	)
 if isinstance(_a		,  _a	):
  raise TypeError("""'float' object cannot be interpreted as an integer"""	)
 if base in (0, 1):
  raise ValueError("""base must be >= 2"""	)
 if base > 36:
  raise ValueError("""base must be <= 36"""	)
 snake_case__  :    Union[str, Any]							       =""""""
 snake_case__  :    List[str]							       =0
 snake_case__  :    List[Any]							       =0
 while div != 1:
  snake_case__       ,   snake_case__  :    Union[str, Any]							       =divmod(_a		,  _a	)
  if base >= 11 and 9 < mod < 36:
   snake_case__  :    Dict							       =ALPHABET_VALUES[str(_a	)]
  else:
   snake_case__  :    Optional[Any]							       =str(_a	)
  new_value += actual_value
  snake_case__  :    Dict							       =num // base
  snake_case__  :    Tuple							       =div
  if div == 0:
   return str(new_value[::-1]	)
  elif div == 1:
   new_value += str(_a	)
   return str(new_value[::-1]	)

 return new_value[::-1]


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       for base in range(2, 37):
              for num in range(10_00):
                     assert int(decimal_to_any(num, base), base) == num, (
                         num,
                         base,
                         decimal_to_any(num, base),
                         int(decimal_to_any(num, base), base),
                     )





