import Data.List

main=do
    [a,b,c,d,e,f]<-map read.words<$>getLine::IO[Int]
    let ws = [w | w<-[100*a..f], w `mod` (gcd (100*a) (100*b)) == 0]
    let ss = [s | s<-[0..f], s `mod` (gcd c d) == 0]
    let (mw,ms) = maximumBy fc [(w+s,s)|w<-ws, s<-ss, w+s<=f && s<=w*e`div`100]
    putStrLn $ show mw ++ " " ++ show ms

fc (ws1,s1) (ws2,s2) = compare (s1*ws2) (s2*ws1)