object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val a, b, c, d, e = sc.nextInt()
  val f = sc.nextInt() / 100

  var ansSum = a*100
  var ansSugar = 0
  for {
    ac <- 0 to f / a
    bc <- 0 to (f - a*ac) / b
  } {
    val water = (a*ac + b*bc) * 100
    val limit = (f * 100 - water).min((water / 100) * e)
    for (cc <- 0 to limit / c) {
      val dc = (limit - c*cc) / d
      val sugar = c*cc + d*dc
      val sum = water + sugar
      if (ansSugar * sum < sugar * ansSum) {
        ansSugar = sugar
        ansSum = sum
      }
    }
  }

  println(s"$ansSum $ansSugar")
}
