#include<iostream> #include<cstring> #include<cstdio> using namespace std; int main(){ int n,ans[4],t,i,j; char a[35]; scanf("%d",&n); while(n--){ scanf("%s",a); memset(ans,0,sizeof(ans)); for(i=0;i<4;i++){ t = 128; for(j=0;j<8;j++){ ans[i] += t*(a[i*8+j]-‘0‘); t /= 2; } } for(i=0;i<3;i++){ printf("%d.",ans[i]); } printf("%d\n",ans[i]); } return 0; }