val a=""++io.Source.stdin split' 'map(_ split'$') for(s<-a map(_(0))distinct)printf(s+"$%x\n",a filter(_(0)==s)map(b=>BigInt(b(1),16))product)