Evaluate arithmetic expressions given in the so-called reverse Polish notation. For instance, the expression in reverse Polish notation is given as That is, the two operands are given first, and afterwards comes the corresponding operator. A more complicated expression like
is given as
Input consists of several arithmetic expressions in reverse Polish
notation, one per line. The operands are natural numbers. The possible
operators, all binary, are ‘+’, ‘-’, and
‘’.
For every expression, print the result of its evaluation.
Input
3 154 + 3 4 + 2 8 - * 2 5 + + 99
Output
157 -35 99