while 1: x=raw_input().split().count for k in'm kg s A K mol cd'.split(): \x09a=x(k)+2*x(k+'2') \x09if a:print k+`a`*(a>1), print
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page