#include using namespace std; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; stack st; for(Int i=0;i>s; if(isdigit(s[0])){ st.emplace(stoll(s)); }else if(s[0]=='+'){ Int a=st.top();st.pop(); Int b=st.top();st.pop(); st.emplace(a+b); }else if(s[0]=='-'){ Int a=st.top();st.pop(); Int b=st.top();st.pop(); st.emplace(b-a); }else abort(); } cout<