

from itertools import permutations





def 	snake_case_      (__A     :						int = 5     )			->	int:
   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
   __lowerCAmelCase  :			Optional[int]					    =						list(range(gon_side + 1					,   0					,   -1     )     )
   __lowerCAmelCase  :			Any					    =						list(range(gon_side + 2					,   gon_side * 2 + 1     )     )

   for perm in permutations(small_numbers + big_numbers     ):
      __lowerCAmelCase  :			Optional[int]					    =						generate_gon_ring(__A					,   list(__A     )     )
      if is_magic_gon(__A     ):
         return int("""""".join(str(__A     ) for n in numbers     )     )

   __lowerCAmelCase  :			str					    =						f'''Magic {gon_side}-gon ring is impossible'''
   raise ValueError(__A     )





def 	snake_case_      (__A     :						int					,   __A     :						list[int]     )			->	list[int]:
   __lowerCAmelCase  :			Optional[Any]					    =						[0] * (gon_side * 3)
   __lowerCAmelCase  :			Any					    =						perm[0:3]
   perm.append(perm[1]     )

   __lowerCAmelCase  :			Dict					    =						1 if gon_side < 5 else 2

   for i in range(1					,   len(__A     ) // 3 + magic_number     ):
      __lowerCAmelCase  :			Tuple					    =						perm[2 * i + 1]
      __lowerCAmelCase  :			Any					    =						result[3 * i - 1]
      __lowerCAmelCase  :			Optional[Any]					    =						perm[2 * i + 2]

   return result





def 	snake_case_      (__A     :						list[int]     )			->	bool:
   if len(__A     ) % 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

   __lowerCAmelCase  :			Optional[Any]					    =						sum(numbers[:3]     )

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


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





from math import sqrt





def 	snake_case_      (__A     :						int     )			->	list[int]:
   __lowerCAmelCase  :			List[str]					    =						[1]
   for i in range(2					,   int(sqrt(__A     )     ) + 1					,   1     ):
      if number % i == 0:
         values.append(__A     )
         if int(number // i     ) != i:
            values.append(int(number // i     )     )
   return sorted(__A     )





def 	snake_case_      (__A     :						int     )			->	bool:
   return sum(factors(__A     )     ) > n





def 	snake_case_      (__A     :						int     )			->	bool:
   __lowerCAmelCase  :			Any					    =						factors(__A     )
   __lowerCAmelCase  :			Union[str, Any]					    =						len(__A     )
   __lowerCAmelCase  :			str					    =						[[0 for i in range(number + 1     )] for j in range(r + 1     )]
   for i in range(r + 1     ):
      __lowerCAmelCase  :			Tuple					    =						True

   for i in range(1					,   number + 1     ):
      __lowerCAmelCase  :			List[str]					    =						False

   for i in range(1					,   r + 1     ):
      for j in range(1					,   number + 1     ):
         if j < values[i - 1]:
            __lowerCAmelCase  :			Dict					    =						subset[i - 1][j]
         else:
            __lowerCAmelCase  :			Dict					    =						subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

   return subset[r][number] != 0





def 	snake_case_      (__A     :						int     )			->	bool:
   return abundant(__A     ) and not semi_perfect(__A     )


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   for number in (69, 70, 71):
      print(F'{number} is {"" if weird(number) else "not "}weird.')


