object Main {
  def main(args: Array[String]): Unit = {
    val factors                     = scala.io.StdIn.readLine.split(" ").map{_.toInt}
    var amount_of_waters: Array[Int] = Array.empty

    (0 to 30).foreach{ i =>
      (0 to 30).foreach{ j =>
        val water = ( factors(0)*i + factors(1)*j )*100
        if( !amount_of_waters.contains( water ) && water < factors(5) ) amount_of_waters = amount_of_waters :+ water

      }
    }

    var suger_rate            = 0.0
    var amount_of_suger       = 0
    var amount_of_suger_water = 0

    amount_of_waters.foreach { water =>
      ( 0 to ( water*factors(4)/100/factors(2) ).toInt + 1 ).foreach{ i =>
        ( 0 to ( water*factors(4)/100/factors(3) ).toInt + 1 ).foreach{ j =>
          val suger = ( factors(2)*i + factors(3)*j )
          val suger_water = water + suger
          if( suger_water <= factors(5) && water*factors(4)/100 >= suger ) {
                val rate = suger/suger_water.toDouble
                if( suger_rate < rate ) {
                amount_of_suger       = suger
                amount_of_suger_water = suger_water
                suger_rate            = rate
                }
                  }
        }
      }
    }

    if( amount_of_suger_water == 0 ) amount_of_suger_water = amount_of_waters( 1 )

    println( amount_of_suger_water + " " + amount_of_suger )
  }
}