#include <iostream>
#include <string>
using namespace std;
unsigned long long GCD (unsigned long long a, unsigned long long b) {
while (b) {
a %= b;
swap (a, b);
}
return a;
}
int main() {
string str;
cin >> str;
int length = str.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 << " ";
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnVuc2lnbmVkIGxvbmcgbG9uZyBHQ0QgKHVuc2lnbmVkIGxvbmcgbG9uZyBhLCB1bnNpZ25lZCBsb25nIGxvbmcgYikgewoJd2hpbGUgKGIpIHsKCQlhICU9IGI7CgkJc3dhcCAoYSwgYik7Cgl9CglyZXR1cm4gYTsKfQoKaW50IG1haW4oKSB7CglzdHJpbmcgc3RyOwoJY2luID4+IHN0cjsKCWludCBsZW5ndGggPSBzdHIubGVuZ3RoKCk7Cgl1bnNpZ25lZCBsb25nIGxvbmcgbnVtZXJhdG9yID0gMCwgZGVub21pbmF0b3IgPSAxLCBnY2QsIGZyYWN0aW9uLCByZW1haW5kZXI7Cglmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CgkJaWYoc3RyW2ldICE9ICcuJykgbnVtZXJhdG9yID0gbnVtZXJhdG9yICogMTAgKyAoc3RyW2ldIC0gJzAnKTsKCX0KCXdoaWxlICgtLWxlbmd0aCA+IDEpIGRlbm9taW5hdG9yICo9IDEwOwoJZ2NkID0gR0NEIChudW1lcmF0b3IsIGRlbm9taW5hdG9yKTs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