rp = input().split()
n = len(rp)-1
i = 1
while n:
    if rp[i] in ('+', '-', '*'):
        i -= 1
        rp[i], rp[i+1] = rp[i+1], rp[i]
        rp[i-1] = str(eval(''.join(rp[i-1:i+2])))
        del rp[i:i+2]
        n -= 2
    else:
        i += 1
print(*rp) rp = input().split() rp input().split() ().split () input split n = len(rp)-1 n len(rp)-1 len(rp) len rp 1 i = 1 i 1 while n:
    if rp[i] in ('+', '-', '*'):
        i -= 1
        rp[i], rp[i+1] = rp[i+1], rp[i]
        rp[i-1] = str(eval(''.join(rp[i-1:i+2])))
        del rp[i:i+2]
        n -= 2
    else:
        i += 1 n if rp[i] in ('+', '-', '*'):
        i -= 1
        rp[i], rp[i+1] = rp[i+1], rp[i]
        rp[i-1] = str(eval(''.join(rp[i-1:i+2])))
        del rp[i:i+2]
        n -= 2
    else:
        i += 1 rp[i] in ('+', '-', '*') rp[i] rp i ('+', '-', '*') '+' '-' '*' i -= 1 i 1 rp[i], rp[i+1] = rp[i+1], rp[i] rp[i] rp i rp[i+1] rp i+1 i 1 rp[i+1] rp i+1 i 1 rp[i] rp i rp[i-1] = str(eval(''.join(rp[i-1:i+2]))) rp[i-1] rp i-1 i 1 str(eval(''.join(rp[i-1:i+2]))) str eval(''.join(rp[i-1:i+2])) eval ''.join(rp[i-1:i+2]) ''.join '' join rp[i-1:i+2] rp i-1:i+2 i-1 i 1 i+2 i 2 del rp[i:i+2] rp[i:i+2] rp i:i+2 i i+2 i 2 n -= 2 n 2 i += 1 i 1 print(*rp) print *rp rp i = 1 1 i rp = input().split() input().split() rp i -= 1 1 i i += 1 1 i n -= 2 2 n n = len(rp)-1 len(rp)-1 n
rp = input().split()
n = len(rp)-1
i = 1
while n:
    if rp[i] in ('+', '-', '*'):
        i -= 1
        rp[i], rp[i+1] = rp[i+1], rp[i]
        rp[i-1] = str(eval(''.join(rp[i-1:i+2])))
        del rp[i:i+2]
        n -= 2
    else:
        i += 1
print(*rp)