


'''simple docstring'''







def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     list[int]  )  ->      list[int]:
       if len(_UpperCAmelCase  ) > 1:
              _a   :			Dict					 =len(_UpperCAmelCase  ) // 2  # Finds the middle of the array
              _a   :			str					 =arr[
                  :middle_length
              ]  # Creates an array of the elements in the first half.
              _a   :			Optional[Any]					 =arr[
                  middle_length:
              ]  # Creates an array of the elements in the second half.
              _a   :			Optional[int]					 =len(_UpperCAmelCase  )
              _a   :			Optional[Any]					 =len(_UpperCAmelCase  )
              merge(_UpperCAmelCase  )  # Starts sorting the left.
              merge(_UpperCAmelCase  )  # Starts sorting the right
              _a   :			Tuple					 =0  # Left Counter
              _a   :			List[Any]					 =0  # Right Counter
              _a   :			List[Any]					 =0  # Position Counter
              while (
                  left_index < left_size and right_index < right_size
              ):  # Runs until the lowers size of the left and right are sorted.
                     if left_array[left_index] < right_array[right_index]:
                            _a   :			Tuple					 =left_array[left_index]
                            left_index += 1
                     else:
                            _a   :			List[str]					 =right_array[right_index]
                            right_index += 1
                     index += 1
              while (
                  left_index < left_size
              ):  # Adds the left over elements in the left half of the array
                     _a   :			Optional[Any]					 =left_array[left_index]
                     left_index += 1
                     index += 1
              while (
                  right_index < right_size
              ):  # Adds the left over elements in the right half of the array
                     _a   :			List[Any]					 =right_array[right_index]
                     right_index += 1
                     index += 1
       return arr


if __name__ == "__main__":
   import doctest

   doctest.testmod()






'''simple docstring'''







import math


def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     int  )  ->      int:
       return sum(int(_UpperCAmelCase  ) for digit in str(_UpperCAmelCase  )  )


def      SCREAMING_SNAKE_CASE_ (  _UpperCAmelCase     :     int = 30  )  ->      int:
       _a   :			List[Any]					 =[]
       for digit in range(2   ,100  ):
              for power in range(2   ,100  ):
                     _a   :			Optional[Any]					 =int(math.pow(_UpperCAmelCase   ,_UpperCAmelCase  )  )
                     if digit == digit_sum(_UpperCAmelCase  ):
                            digit_to_powers.append(_UpperCAmelCase  )

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


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


