def 						UpperCAmelCase							(		lowerCAmelCase_							)						->						int:
     if not isinstance(lowerCAmelCase_    ,   lowerCAmelCase_							):
          raise ValueError('''double_factorial() only accepts integral values'''							)
     if num < 0:
          raise ValueError('''double_factorial() not defined for negative values'''							)
     a	:     int						      =    1
     for i in range(lowerCAmelCase_    ,   0    ,   -2							):
          value *= i
     return value


if __name__ == "__main__":
  import doctest

  doctest.testmod()
import math







def 						UpperCAmelCase							(		lowerCAmelCase_							)						->						int:
     return sum(int(lowerCAmelCase_							) for digit in str(lowerCAmelCase_							)							)







def 						UpperCAmelCase							(		lowerCAmelCase_ = 3_0							)						->						int:
     a	:     Optional[int]						      =    []
     for digit in range(2    ,   1_0_0							):
          for power in range(2    ,   1_0_0							):
               a	:     List[str]						      =    int(math.pow(lowerCAmelCase_    ,   lowerCAmelCase_							)							)
               if digit == digit_sum(lowerCAmelCase_							):
                    digit_to_powers.append(lowerCAmelCase_							)

     digit_to_powers.sort()
     return digit_to_powers[n - 1]


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