#include using namespace std; typedef long long LL; const int MOD = 1e9+7; int N; char v[100010]; const int blk = 230; int bl[100010],L[100010],R[100010]; int S[blk*10],rv[blk*10],lv[blk*10],mv[blk*10],B; int fp[blk*10],lp[blk*10]; void upd(int &x) { if (x < 0) x += MOD; if (x >= MOD) x -= MOD; } int calc(int l,int r)//num---num { 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] = 0; for (int i=L[b];i