#include <stdio.h>

// 求最大公约数
int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}

int main() {
    char str[20];
    scanf("%s", str);

    // 提取整数部分和小数部分
    int integerPart = 0, decimalPart = 0, decimalLength = 0;
    int i = 0;
    while (str[i] != '.') {
        integerPart = integerPart * 10 + (str[i] - '0');
        i++;
    }
    i++;
    while (str[i] != '\0') {
        decimalPart = decimalPart * 10 + (str[i] - '0');
        decimalLength++;
        i++;
    }

    // 将小数部分化为最简分数
    int numerator = decimalPart;
    int denominator = 1;
    int j;
    for (j = 0; j < decimalLength; j++) {
        denominator *= 10;
    }
    int commonDivisor = gcd(numerator, denominator);
    numerator /= commonDivisor;
    denominator /= commonDivisor;

    // 输出结果
    if (integerPart == 0) {
        printf("0 %d %d\n", numerator, denominator);
    } else {
        printf("%d %d %d\n", integerPart, numerator, denominator);
    }

    return 0;
}
