#include using namespace std; typedef long long LL; const int MOD = 1e9+7; int N; char v[200010]; const int blk = 200; int bl[200010],L[200010],R[200010]; int S[200010],rv[200010],lv[200010],mv[200010],B; int fp[200010],lp[200010]; void upd(int &x) { if (x < 0) x += MOD; if (x >= MOD) x -= MOD; } int calc(int l,int r)//num---num { assert(!(l==1 && r==100000)); int sum = 0,nowv = 1; //printf("calc %d %d\n",l,r); for (int i=l;i<=r;i+=2) { nowv = (1LL * nowv * (v[i] - '0')) % MOD; //printf("%d %d\n",i,nowv); if (v[i+1] == '+' || i==r) { upd(sum += nowv); nowv = 1; } } //printf("calc %d %d=%d\n",l,r,sum); return sum; } void build(int b) { fp[b] = lp[b] = L[b]; for (int i=L[b]+1;i