let a, b, c, d, e, f = Scanf.scanf " %d %d %d %d %d %d" @@ fun a b c d e f -> a, b, c, d, e, f
let ws = Array.make (f + 1) false
let ss = Array.make (f + 1) false
let (<=@) (w, s) (w2, s2) = (w2 + s2) * s <= (w + s) * s2
let ans = ref (f, 0)
let _ =
  for i = 0 to f / 100 do
    for j = 0 to f / 100 do let w = 100 * i * a + 100 * j * b in if w <= f then ws.(w) <- true done done;
  for i = 0 to f do
    for j = 0 to f do if i * c + j * d <= f then ss.(i * c + j * d) <- true done done;
  for i = 0 to f do
    for j = 0 to f do if ws.(i) && ss.(j) && i + j <= f && 100 * j <= i * e then (ans := if !ans <=@ (i, j) then i, j else !ans) done done;
  let w, s = !ans in Printf.printf "%d %d\n" (w + s) @@ s