#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 << " ";
	}
}