char s[9];main(i,j,k,t){for(;gets(s);){t=0;for(j=0;j<8;j++)t=t*2+s[j]-48;printf("%s %d\n",s,t);}}