'''simple docstring'''

from math import pow







def __UpperCamelCase(   _A					:				int  ,			_A					:				int  ,			_A					:				int  ,			_A					:				int  ,			_A					:				int  ,			):
   '''simple docstring'''
   if current_sum == needed_sum:
      # If the sum of the powers is equal to needed_sum, then we have a solution.
      solutions_count += 1
      return current_sum, solutions_count

   UpperCAmelCase__							:				str   				=  int(pow(_A  ,			_A    )    )
   if current_sum + i_to_n <= needed_sum:
      # If the sum of the powers is less than needed_sum, then continue adding powers.
      current_sum += i_to_n
      UpperCAmelCase__							:				Tuple   				=  backtrack(
          _A  ,			_A  ,			current_number + 1  ,			_A  ,			_A    )
      current_sum -= i_to_n
   if i_to_n < needed_sum:
      # If the power of i is less than needed_sum, then try with the next power.
      UpperCAmelCase__							:				Dict   				=  backtrack(
          _A  ,			_A  ,			current_number + 1  ,			_A  ,			_A    )
   return current_sum, solutions_count







def __UpperCamelCase(   _A					:				int  ,			_A					:				int    ):
   '''simple docstring'''
   if not (1 <= needed_sum <= 10_00 and 2 <= power <= 10):
      raise ValueError(
          '''Invalid input\n'''
          '''needed_sum must be between 1 and 1000, power between 2 and 10.'''    )

   return backtrack(_A  ,			_A  ,			1  ,			0  ,			0    )[1]  # Return the solutions_count


if __name__ == "__main__":
  import doctest

  doctest.testmod()





'''simple docstring'''

def __UpperCamelCase(   _A					:				str  ,			_A					:				str    ):
   '''simple docstring'''
   UpperCAmelCase__							:				int   				=  len(_A    )
   UpperCAmelCase__							:				int   				=  len(_A    )
   UpperCAmelCase__							:				int   				=  (
       first_str_length if first_str_length > second_str_length else second_str_length
   )
   UpperCAmelCase__							:				list   				=  []
   for char_count in range(_A    ):
      if char_count < first_str_length:
         output_list.append(first_str[char_count]    )
      if char_count < second_str_length:
         output_list.append(second_str[char_count]    )
   return "".join(_A    )


if __name__ == "__main__":
  print(alternative_string_arrange('AB', 'XYZ'), end=' ')




