Array.(Scanf.scanf" %d %d %d %d %d %d"@@fun a b c d e f->
	let r=ref (0.,(100*a,0)) in
	for i=0 to 32 do
		for j=0 to 32 do
			for k=0 to 103 do
				for l=0 to 103 do
					let w,s=100*a*i+100*b*j,c*k+d*l in
					if w+s<=f && w/100*e>=s && w+s<>0 then
						let d=100. *. (float s) /. (float w +. float s) in
						if d>fst !r then r:=(d,(w+s,s)) done;done;done;done;
	Printf.printf "%d %d\n" (fst@@snd !r) (snd@@snd !r))