
from typing import List

from .keymap import KEYMAP, get_character

def 		UpperCamelCase	(      lowercase_   )		->	List[Any]:


  '''simple docstring'''






  def decorator(lowercase_   ):
    lowercase__  :   str    		=      getattr(lowercase_ , """handle_key""" , []   )
    handle += [key]
    setattr(lowercase_ , """handle_key""" , lowercase_   )
    return func

  return decorator

def 		UpperCamelCase	(      *lowercase_   )		->	Optional[Any]:


  '''simple docstring'''






  def decorator(lowercase_   ):
    lowercase__  :   int    		=      getattr(lowercase_ , """handle_key""" , []   )
    handle += keys
    setattr(lowercase_ , """handle_key""" , lowercase_   )
    return func

  return decorator





class       _snake_case   (	UpperCAmelCase_							):


 def __new__(					cls					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      super().__new__(cls					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_)
   if not hasattr(SCREAMING_SNAKE_CASE_					,  """key_handler"""):
     setattr(SCREAMING_SNAKE_CASE_					,  """key_handler"""					,  {})
   setattr(SCREAMING_SNAKE_CASE_					,  """handle_input"""					,  KeyHandler.handle_input)

   for value in attrs.values():
     lowercase__  :   Dict    		=      getattr(SCREAMING_SNAKE_CASE_					,  """handle_key"""					,  [])
     for key in handled_keys:
       lowercase__  :   Optional[Any]    		=      value
   return new_cls



 @staticmethod
 def      lowercase__     (					cls):


   '''simple docstring'''




   lowercase__  :   Any    		=      get_character()
   if char != KEYMAP["undefined"]:
     lowercase__  :   str    		=      ord(SCREAMING_SNAKE_CASE_)
   lowercase__  :   Union[str, Any]    		=      cls.key_handler.get(SCREAMING_SNAKE_CASE_)
   if handler:
     lowercase__  :   Any    		=      char
     return handler(cls)
   else:
     return None

def 		UpperCamelCase	(      cls   )		->	List[str]:


  '''simple docstring'''






  return KeyHandler(cls.__name__ , cls.__bases__ , cls.__dict__.copy()   )








def 		UpperCamelCase	(      lowercase_ = 10_00   )		->	int:


  '''simple docstring'''






  return sum(2 * a * ((a - 1) // 2) for a in range(3 , n + 1   )   )


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






