#include using namespace std; #define readFile freopen("input","r",stdin) #define writeFile freopen("output","w",stdout) #define fastIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) typedef unsigned long long ull; typedef long long LL; typedef pair ii; const double eps = 1e-10; const long long mod = 1e9+7; const int INF = 1e9; const int N = 101; int n; ull dp[N][N],vis[N][N],cntr; string s; ull rec(int x,int y){ if (x==y) return s[x]-'0'; if (vis[x][y]==cntr) return dp[x][y]; vis[x][y] = cntr; ull num = s[y]-'0'; ull ret = 0; if (s[y-1]=='*'){ ret = rec(x,y-2)*num; for(int i=x+1;i>n; while(n--){ cin>>s; cntr++; cout<