x,*p={}, for l in open(0): k,v=l.split(':') if(k in x)<1:x[k]=1 x[k]*=int(v[2:],16) if(k in p)<1:p+=k, for k in p:print(k+": $"+hex(x[k])[2:])