Олимпиадный тренинг

Задача 38598. Postfix notation


Задача

Темы: Стек
In postfix notation (or reverse Polish notation), the operation is written after two operands. For example, the sum of two numbers A and B is written as A B +. The notation B C + D * means the usual (B + C) * D, and the notation A B C + D * + means A + (B + C) * D. The advantage of postfix notation is that it does not require brackets and additional precedence conventions operators for your reading.

Input
The single line contains an expression in postfix notation containing numbers and operations +, -, *. Numbers and operations are separated by spaces. There can be any number of spaces at the end of the line.

Imprint
It is necessary to display the value of the written expression.
Examples
# Input Output
1 8 9 + 1 7 - * -102