while 1: i=raw_input();v=0 for z in i.split('='): t=0 for c in map(int,z.split()): if t-c:t-=cmp(t-c,0)*c else:t*=c v+=t if v-2*t:print i