program change;
var
    a,b,p,t,i: longint;
    c: array[1..4] of record
	o,n: integer;
	end;
begin
    c[1].n:=1;
    c[2].n:=5;
    c[3].n:=10;
    c[4].n:=25;
    while true do begin
        ReadLn(p,c[1].o,c[2].o,c[3].o,c[4].o);
	if p+c[1].o+c[2].o+c[3].o+c[4].o=0 then break;
	t:=0;
	for a:=1 to 4 do t:=t+c[a].n*c[a].o;

	for b:=4 downto 1 do
	begin
	    i:=(t-p) div c[b].n;
	    if i<0 then i:=0;
	    if i>c[b].o then i:=c[b].o;
	    c[b].o:=c[b].o-i;
	    t:=t-c[b].n*i;
	end;
	
	if t<>p then writeln('Charlie cannot buy coffee.')
	else 
	begin
        writeln('Throw in ',c[1].o,' cents, ', c[2].o,' nickels, ',c[3].o,' dimes, and ',c[4].o,' quarters.'); 

{	writeln(c[1].n*c[1].o+c[2].o*c[2].n+c[3].o*c[3].n+c[4].o*c[4].n);
	writeln(p);}

	end;

    end;
end.
