implicit none
integer,parameter :: PREC=8
integer :: a,b,c,d,e,f
integer :: sol, sugar
integer :: maxsol,maxsug
integer :: waters(30)
integer :: water,water_a
integer :: na,nb,nc,nd,nw
integer :: maxc,maxd
integer :: i,j,k
logical :: flg
real(PREC) :: water_req,conc,maxconc

read *,a,b,c,d,e,f

waters(:) = 0
nw = 0
do_a: do na = 0, 30
   water_a = na * a * 100
   if (water_a > f) then
      exit do_a
   endif
   do_b: do nb = 0, 30
      if (na == 0 .and. nb == 0) then
         cycle do_b
      endif
      water = water_a + nb * b * 100
      if (water > f) then
         cycle do_a
      endif
      flg = .false.
      do_k: do k = 1, nw
         if (water == waters(k)) then
            flg = .true.
            exit do_k
         endif
      enddo do_k
      if (flg) then
         cycle do_b
      endif
      nw = nw + 1
      waters(nw) = water
   enddo do_b
enddo do_a

i = nw
flg = .false.
do while (i > 1 .or. flg)
   i = (i * 10) / 13
   if (i < 1) then
      i = 1
   else if (i == 9 .or. i == 10) then 
      i = 11
   endif
   flg = .false.
   do j = 1, nw-i
      if (waters(j) > waters(j+i)) then
         k = waters(j) 
         waters(j) = waters(j+i)
         waters(j+i) = k
         flg = .true.
      endif
   enddo
enddo

maxc = ceiling(f*e/real(c*(100+e),kind=PREC))
maxd = ceiling(f*e/real(d*(100+e),kind=PREC))

maxconc = 0.0
maxsol = 0
maxsug = 0
do nc = 0, maxc
   do nd = 0, maxd
      sugar = nc * c + nd * d
      water_req = sugar / real(e,kind=PREC) * 100.0
      if (water_req > real(f)) then
         exit
      endif
      water = 0
      do k = 1, nw
         if (water_req <= real(waters(k),kind=PREC)) then
            water = waters(k)
            exit
         endif
      enddo
      if (water == 0) then
         exit
      endif
      
      sol = water + sugar
      if (sol > f) then
         cycle
      endif
      
      conc = 100 * sugar / real(sol,kind=PREC)
      if (conc > maxconc) then
         maxconc = conc
         maxsol = sol
         maxsug = sugar
      endif
   enddo
enddo

print '(i0,1x,i0)',maxsol,maxsug
end