Write infix->postfix method and add main method for testing.