input: Write a function to convert infix expression to postfix expression.
  assert infix_to_postfix("A * B + C * D") == "A B * C D * +"
  assert infix_to_postfix("( A + B ) * C - ( D - E ) * ( F + G )") == "A B + C * D E - F G + * -"
  assert infix_to_postfix("A + B * C") == "A B C * +"
output: def infix_to_postfix(expression):
      precedence = {'+': 1, '-': 1, '*': 2, '/': 2, '^': 3}
      def get_precedence(op):
          return precedence[op] if op in precedence else 0
      
      def is_operator(c):
          return c in precedence
      
      def infix_to_postfix_conversion(expression):
          stack = []
          postfix = []
          tokens = expression.split()
          
          for token in tokens:
              if token.isalnum():
                  postfix.append(token)
              elif token == '(':
                  stack.append(token)
              elif token == ')':
                  while stack and stack[-1] != '(':
                      postfix.append(stack.pop())
                  stack.pop()
              else:
                  while stack and get_precedence(stack[-1]) >= get_precedence(token):
                      postfix.append(stack.pop())
                  stack.append(token)
          
          while stack:
              postfix.append(stack.pop())
          
          return ' '.join(postfix)
      
      return infix_to_postfix_conversion(expression)