program prosjek;

var
   p : extended;
   i : integer;
   y, x, x1, y1, a, b, c, d, e, des, dj : int64;

function gcd (x, y : int64) : int64;
var
   t : int64;
begin
   repeat
      if x>y then x := x mod y
      else y := y mod x;
   until (x=0) or (y=0);
   if x=0 then gcd := y else gcd := x;
end;

begin
   y1 := 1; for i := 1 to 10 do y1 := y1*10;
   readln (p);
   x1 := trunc(p*y1);
   dj := gcd(x1, y1);
   x1 := x1 div dj; y1 := y1 div dj;
   repeat
      x := x+x1; y := y+y1;
      des := 5*y-x;
      a := des div 4;
      b := (des-a*4) div 3;
      b := (des-a*4-b*3) div 2;
      d := des-a*4-b*3-c*2;
      e := y-a-b-c-d;
   until (a>=0) and (b>=0) and (c>=0) and (d>=0) and (e>=0);
   writeln (a, ' ', b, ' ', c, ' ', d, ' ', e);
end.
