#include<iostream>
#include<cmath>
#include<sstream>
using namespacestd;
long long E[20][40];
double M[20][40];
int main()
{
for(int i=0;i<10;i++)
{
for(int j=1;j<=30;j++)
{
double m=1-pow(2,-i-1);
int e=pow(2,j)-1;
double t=log10(m)+e*log10(2);
E[i][j]=t;
M[i][j]=pow(10,t-E[i][j]);
}
}
string s;
while(cin>>s&&s!="0e0")
{
for(string::iterator i=s.begin();i!=s.end();i++)
if(*i=='e') {*i=' ';break;}
istringstream ss(s);
double A,B;
int cnt=0;
ss>>A>>B;
while(A<1) {A*=10;B-=1;}
for(int i=0;i<10;i++)
{
for(int j=1;j<=30;j++)
{
if(B==E[i][j]&&(fabs(A-M[i][j])<1e-4))
{
cout<<i<<" "<<j<<endl;
cnt++;
break;
}
if(cnt)break;
}
}
}
return0;
}