#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;
typedef long long ll;

int low, fract;
ll result[6];
ll n = 1;

int main(void) {
  string str;
  char tmp[16];
  
  scanf("%d.%s", &low, tmp); str = tmp;
  while ( str.size() < 9 ) str += '0';
  sscanf( str.c_str(), "%d", &fract );

  int dec = fract;  
  while ( dec > 0 ) {
    sprintf( tmp, "%d", dec );
    int k = strlen( tmp ) - 1;
    while ( tmp[k] == '0' ) --k;
    if ( tmp[k] == '5' ) {
      n *= 2;
      dec = ( (ll)dec * 2 ) % 1000000000;
    } else {
      n *= 5;
      dec = ( (ll)dec * 5 ) % 1000000000;
    }
  }  
  
  
  /* a + b = n */
  /* low*a + low*b = low * n; */
  /* low*a + (low+1)*b = (low.fract) * n */
  /* b = .fract * n */
  ll b = (ll)fract * n / 1000000000;
  ll a = n - b;
  
  result[low] = a;
  result[low+1] = b;
  
  for ( int i = 1; i <= 5; ++i )
    printf("%lld ", result[i]);
  printf("\n");
  
  return 0;
}
