#include
int main()
{
__int64 n,sum;
int IP[32],i,x1,x2,x3,x4;
while(scanf("%I64d",&n)!=EOF)
{
for(sum=1,i=0;i<32;i++)
{
if(sum<=n+2)
IP[i]=0;
else
IP[i]=1;
sum = sum * 2;
}
x1=x2=x3=x4=0;
for(i=31;i>=0;i--)
{
if(i>=24)
x1=2*x1+IP[i];
else if(i>=16)
x2=2*x2+IP[i];
else if(i>=8)
x3=2*x3+IP[i];
else
x4=2*x4+IP[i];
}
printf("%d.%d.%d.%d\n",x1,x2,x3,x4);
}
return 0;
}