main() { char s[8]; for(int i=0;i<50;i++) { gets(s); int x=0; for(int j=0; j<8;j++) { x *= 2; x += (s[i]=='1'); } printf("%d", x); } }