import sys
z="s m kg A K mol cd".split()
x,y=dict(zip("Hz N Pa J W C V F Ω S Wb T H °C lm lx Bq Gy Sv kat g".split(),"s^-1,kg m s^-2,kg m^-1 s^-2,kg m^2 s^-2,kg m^2 s^-3,A s,kg m^2 s^-3 A^-1,kg^-1 m^-2 s^4 A^2,kg m^2 s^-3 A^-2,kg^-1 m^-2 s^3 A^2,kg m^2 s^-2 A^-1,kg s^-2 A^-1,kg m^2 s^-2 A^-2,K,cd,cd m^-2,s^-1,m^2 s^-2,m^2 s^-2,mol s^-1,kg".split(",")))|dict(zip(z,z))|{"rad":"","sr":""},dict(zip("qryzafpnμm_kMGTPEZYRQ",range(-30,31,3)))|{"c":-2,"d":-1,"da":1,"h":2}
for a in sys.argv[1:]:print((["1 ","10^-3 "][a=="g"])*(a in x)+({v+u:"10"+("^"+str(z))*(z!=1)+" "+x[u]for u in x for v in y for z in[y[v]-3*(u=="g")]}|x)[a])