i;x;k;main(j){for(;j=~scanf("%d",&x);puts(""))for(k=i=500;k;i+=.5-500.*k/j,j*=2)k=ix,printf("%d %c\n",i,61-k);}