s=0 System.in.eachLine{s=it-~/\D+/?!s?:println((c=it as int)>0?s*c:s[-1..0]*-c):it}