object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datA, datB, datC, datD, datE, datF) = readLine.split(" ").map(_.toInt)

    val water = for(
      i <- 0 to datF / 100 / datA;
      j <- 0 to datF / 100 / datB;
      k = datA * i + datB * j;
      if((k > 0) && (k <= datF / 100))
    ) yield k
    val sugar = for(
      i <- 0 to datF / 2 / datC;
      j <- 0 to datF / 2 / datD;
      k = datC * i + datD * j;
      if(k <= datF / 2)
    ) yield k

    val ans = water.map(w =>
      sugar.map(s => {
        val total = w * 100 + s
        if((w * datE < s) || (total > datF)) (0.0, 0, 0)
        else ((100.0 * s / total), (w * 100 + s), s)
      } ).maxBy(_._1)
    ).maxBy(_._1)

    println(ans._2 + " " + ans._3)
  }
}
