#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*int main()
{
long long int n, m;
scanf("%lld%lld", &n, &m);
long long int arr[31] = {0}; //30회 안에 해결
long long int l = 1;
arr[0] = n;
arr[1] = (n * n)%1000000007;
for(int i=2;i<30;i++){
arr[i] = (arr[i-1] * arr[i-1])%1000000007;
}
int count = 0;
while(m!=0){
if(m%2==1){
l = (l * arr[count])%1000000007;
}
count++;
m = m/2;
}
printf("%lld",l);
return 0;
}*/
/*int main()
{
int n,i,sum=0;
scanf("%d", &n);
for(i=1; i<n+1; i++)
{
if(n%i==0)
{
sum = sum+i;
}
}
printf("%d ", sum);
}*/
char s[7];
int a[7];
int main (void)
{
int n=0,m = 1, b = 0, d = 0, max = 0;
scanf("0.%s", s);
for(int i = 0; s[i] != NULL; i++)
{
if(s[i] >= 48 && s[i] <= 57)
a[i] = s[i] - 48;
n++;
}
for(int i = n-1; i >= 0; i--)
{
d = 1;
for(int j = 0;j < i; j++)
d *= 10;
d *= a[n-1-i];
b += d;
}
for(int i = 0;i < n; i++)
m *= 10;
max = b;
if(max < m) max = m;
for(int j= 0; j < 5; j++)
{
for(int i = 1; i <= max; i++)
{
if((!(b % i)) && (!(m % i)))
{
b /= i, m /= i;
}
}
}
printf("%d %d", b, m);
return 0;
}