Transform the Expression

http://www.spoj.com/problems/ONP/

Transform the algebraic expression with brackets into RPN form (Reverse
Polish Notation). Two-argument operators: +, -, *, /, ^ (priority from
the lowest to the highest), brackets ( ). Operands: only letters:
a,b,...,z. Assume that there is only one RPN form (no expressions like
a*b*c).