




'''simple docstring'''







from itertools import permutations







def 	_A			(   UpperCAmelCase = 5	):






   '''simple docstring'''







   if gon_side < 3 or gon_side > 5:
      raise ValueError('gon_side must be in the range [3, 5]'	)

   # Since it's 16, we know 10 is on the outer ring
   # Put the big numbers at the end so that they are never the first number
   A__         =    list(range(gon_side + 1			,0			,-1	)	)
   A__         =    list(range(gon_side + 2			,gon_side * 2 + 1	)	)

   for perm in permutations(small_numbers + big_numbers	):
      A__         =    generate_gon_ring(UpperCAmelCase			,list(UpperCAmelCase	)	)
      if is_magic_gon(UpperCAmelCase	):
         return int(''.join(str(UpperCAmelCase	) for n in numbers	)	)

   A__         =    F"""Magic {gon_side}-gon ring is impossible"""
   raise ValueError(UpperCAmelCase	)







def 	_A			(   UpperCAmelCase			,UpperCAmelCase	):






   '''simple docstring'''







   A__         =    [0] * (gon_side * 3)
   A__         =    perm[0:3]
   perm.append(perm[1]	)

   A__         =    1 if gon_side < 5 else 2

   for i in range(1			,len(UpperCAmelCase	) // 3 + magic_number	):
      A__         =    perm[2 * i + 1]
      A__         =    result[3 * i - 1]
      A__         =    perm[2 * i + 2]

   return result







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   if len(UpperCAmelCase	) % 3 != 0:
      raise ValueError('a gon ring should have a length that is a multiple of 3'	)

   if min(numbers[::3]	) != numbers[0]:
      return False

   A__         =    sum(numbers[:3]	)

   return all(sum(numbers[i : i + 3]	) == total for i in range(3			,len(UpperCAmelCase	)			,3	)	)


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








'''simple docstring'''







from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
lowerCAmelCase_    	=							TypeVar('''T''', bound='''Enum''')

@unique
class   _snake_case( UpperCAmelCase			):
 __snake_case:       List[Any]									=				80
 __snake_case:       Optional[int]									=				70
 __snake_case:       Optional[int]									=				60
 __snake_case:       int									=				50
 __snake_case:       Dict									=				40
 __snake_case:       Dict									=				30
 __snake_case:       str									=				20
 __snake_case:       Optional[int]									=				10




@unique
class   _snake_case( UpperCAmelCase			):
 __snake_case:       List[Any]									=				24
 __snake_case:       Union[str, Any]									=				21
 __snake_case:       Dict									=				18
 __snake_case:       List[str]									=				15
 __snake_case:       Union[str, Any]									=				12
 __snake_case:       Tuple									=				9
 __snake_case:       int									=				6
 __snake_case:       Tuple									=				3
 __snake_case:       List[Any]									=				2
 __snake_case:       int									=				1
 __snake_case:       List[str]									=				-1
 __snake_case:       Union[str, Any]									=				-2
 __snake_case:       List[str]									=				-3
 __snake_case:       Any									=				-6
 __snake_case:       Tuple									=				-9
 __snake_case:       List[str]									=				-12
 __snake_case:       Dict									=				-15
 __snake_case:       Optional[int]									=				-18
 __snake_case:       str									=				-21
 __snake_case:       Any									=				-24






 @classmethod
 def 	_UpperCamelCase   (cls					:     type[T]						)					->      dict:






    """simple docstring"""


    return {unit.name: unit.value for unit in cls if unit.value > 0}






 @classmethod
 def 	_UpperCamelCase   (cls					:     type[T]						)					->      dict:






    """simple docstring"""


    return {unit.name: unit.value for unit in cls if unit.value < 0}







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   A__         =    SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
   for name_prefix, value_prefix in prefixes.items():
      A__         =    value / (10**value_prefix)
      if numerical_part > 1:
         return F"""{numerical_part!s} {name_prefix}"""
   return str(UpperCAmelCase	)







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   for prefix in BinaryUnit:
      A__         =    value / (2**prefix.value)
      if numerical_part > 1:
         return F"""{numerical_part!s} {prefix.name}"""
   return str(UpperCAmelCase	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()


