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