


"""simple docstring"""






from __future__ import annotations
def       A_   (   _lowerCAmelCase     :					List[Any],     _lowerCAmelCase     :					Union[str, Any]       ):






     """simple docstring"""

     if b == 0:
          return (1, 0)
     (_a)    	=				extended_euclid(_lowerCAmelCase,     a % b       )
     _a    	=				a // b
     return (y, x - k * y)
def       A_   (   _lowerCAmelCase     :					Optional[Any],     _lowerCAmelCase     :					Tuple,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					Tuple       ):






     """simple docstring"""

     (_a)    	=				extended_euclid(_lowerCAmelCase,     _lowerCAmelCase       )
     _a    	=				na * na
     _a    	=				ra * x * na + ra * y * na
     return (n % m + m) % m
def       A_   (   _lowerCAmelCase     :					Dict,     _lowerCAmelCase     :					Dict       ):






     """simple docstring"""

     (_a)    	=				extended_euclid(_lowerCAmelCase,     _lowerCAmelCase       )
     if b < 0:
          _a    	=				(b % n + n) % n
     return b
def       A_   (   _lowerCAmelCase     :					List[Any],     _lowerCAmelCase     :					Optional[int],     _lowerCAmelCase     :					Union[str, Any],     _lowerCAmelCase     :					Optional[int]       ):






     """simple docstring"""

     _a    	=				invert_modulo(_lowerCAmelCase,     _lowerCAmelCase       ), invert_modulo(_lowerCAmelCase,     _lowerCAmelCase       )
     _a    	=				na * na
     _a    	=				ra * x * na + ra * y * na
     return (n % m + m) % m


if __name__ == "__main__":
   from doctest import testmod

   testmod(name='''chinese_remainder_theorem''', verbose=True)
   testmod(name='''chinese_remainder_theorem2''', verbose=True)
   testmod(name='''invert_modulo''', verbose=True)
   testmod(name='''extended_euclid''', verbose=True)



"""simple docstring"""






from typing import Any
def       A_   (   _lowerCAmelCase     :					list       ):






     """simple docstring"""

     if not input_list:
          return []
     _a    	=				[input_list.count(_lowerCAmelCase       ) for value in input_list]
     _a    	=				max(_lowerCAmelCase       )  # Gets the maximum count in the input list.
     # Gets values of modes
     return sorted({input_list[i] for i, value in enumerate(_lowerCAmelCase       ) if value == y}       )


if __name__ == "__main__":
   import doctest

   doctest.testmod()