open System
open System.Collections.Generic

module InputUtility =
    let InputTokens = new Queue<string>()

    let EnsureInput () =
        if InputTokens.Count = 0 then
            let input = Console.ReadLine ()
            let s = input.Split ([|' '|], StringSplitOptions.RemoveEmptyEntries)
            if s.Length > 0 then
                for x in s do InputTokens.Enqueue(x)
                true
            else false
        else true

    let rec ReadNext () =
        if EnsureInput () then InputTokens.Dequeue ()
        else ReadNext ()

    let ReadNextInt () = ReadNext () |> int

    let Read2Int () = ReadNextInt (), ReadNextInt ()

    let Read3Int () = ReadNextInt (), ReadNextInt (), ReadNextInt ()

    let ReadListOf f n =
        let rec loop acc = function
            | 0 -> List.rev acc
            | c -> loop ((ReadNext () |> f) :: acc) (c-1)
        loop [] n

    let MultipleCaseWithId f =
        let caseNum = ReadNextInt ()
        let rec loop index =
            if index = caseNum then ()
            else
                f index
                loop (index + 1)
        loop 0

    let MultipleCase f = MultipleCaseWithId (fun _ -> f ())

    let ReadList n =
        let rec loop acc = function
            | 0 -> List.rev acc
            | c -> loop (ReadNext () :: acc) (c-1)
        loop [] n

open InputUtility

module ARC083 =
    let private Mod = 1000000007L

    let private SugerWater () =
        let a, b, c = Read3Int ()
        let d, e, f = Read3Int ()
        let generate u x y =
            let arr = Array.create (u + 1) false
            let up d = if d <= u then arr.[d] <- true
            arr.[0] <- true
            for i in [0..u] do
                if arr.[i] then
                    up (i + x)
                    up (i + y)
            [0..u] |> Seq.where (fun i -> arr.[i]) |> Seq.toList
        let water = generate (f / 100) a b
        let suger = generate f c d |> Set.ofSeq
        let rec loop (n, d as r) = function
            | [] -> r
            | w :: h ->
                let cs = f - w * 100
                let ce = w * e
                let js =
                    [min cs ce .. -1 .. 0]
                    |> Seq.where suger.Contains
                    |> Seq.toArray
                let nr =
                    if js.Length = 0 then n, d
                    else
                        let s = js.[0]
                        let t = w * 100 + s
                        if s * n > d * t then t, s else n, d
                loop nr h
        let n, d = loop (100, 0) water
        printfn "%d %d" n d

    let Entry = SugerWater

ARC083.Entry ()