char*p,s[];main(){for(gets(s);gets(s);puts(s))for(;s[1];*p=0)for(p=s;p[1];*p-=*p++/58*9)*p+=p[1]-48;}