main(S){char s[]={0,'K','M'};float p;while(~scanf("%f",&p)){S=0;while(p>1023)p/=1024,S++;printf(S?"%0.2f %cB\n":"%.0f\n",p,s[S]);}}