#include <iostream>
#include <cstring>
using namespace std;
unsigned long long GCD (unsigned long long a, unsigned long long b) {
if (b == 0) return a;
else return GCD (b, a % b);
}
int main() {
char str[20];
int length = 0;
while (cin >> str[length]) length++;
unsigned long long numerator = 0, denominator = 1, gcd, fraction, remainder;
for (int i = 0; i < length; i++) {
if(str[i] != '.') numerator = numerator * 10 + (str[i] - '0');
}
while (--length > 1) denominator *= 10;
gcd = GCD(numerator, denominator);
numerator /= gcd;
denominator /= gcd;
remainder = numerator % denominator;
numerator -= remainder;
fraction = numerator / denominator;
cout << denominator << endl;
for (int i = 1; i <= 5; i++) {
if(i == fraction) {
i++;
cout << denominator - remainder << " ";
if(fraction != 5) cout << remainder << " ";
}
else cout << 0 << " ";
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4gCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp1bnNpZ25lZCBsb25nIGxvbmcgR0NEICh1bnNpZ25lZCBsb25nIGxvbmcgYSwgdW5zaWduZWQgbG9uZyBsb25nIGIpIHsKCWlmIChiID09IDApIHJldHVybiBhOwoJZWxzZSByZXR1cm4gR0NEIChiLCBhICUgYik7Cn0KCmludCBtYWluKCkgewoJY2hhciBzdHJbMjBdOwoJaW50IGxlbmd0aCA9IDA7Cgl3aGlsZSAoY2luID4+IHN0cltsZW5ndGhdKSBsZW5ndGgrKzsKCXVuc2lnbmVkIGxvbmcgbG9uZyBudW1lcmF0b3IgPSAwLCBkZW5vbWluYXRvciA9IDEsIGdjZCwgZnJhY3Rpb24sIHJlbWFpbmRlcjsKCWZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKCQlpZihzdHJbaV0gIT0gJy4nKSBudW1lcmF0b3IgPSBudW1lcmF0b3IgKiAxMCArIChzdHJbaV0gLSAnMCcpOwoJfQoJd2hpbGUgKC0tbGVuZ3RoID4gMSkgZGVub21pbmF0b3IgKj0gMTA7CglnY2QgPSBHQ0QobnVtZ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