fun main(args: Array<String>) {
  val inputs = readLine()!!.split(" ").map { it.toInt() }
  val a = inputs[0]
  val b = inputs[1]
  val c = inputs[2]
  val d = inputs[3]
  val e = inputs[4]
  val f = inputs[5]

  var maxRatio = -1.0
  var ansW = 0
  var ansS = 0
  for (aCount in 0..(f / (100 * a))) {
    for (bCount in 0..(f / (100 * b))) {
      val w = 100 * a * aCount + 100 * b * bCount
      if (w > f) continue
      for (cCount in 0..(f / c)) {
        for (dCount in 0..(f / d)) {
          val s = c * cCount + d * dCount
          if (s * 100 > e * w) continue
          if (w + s > f) continue
          val ratio = s.toDouble() / (w.toDouble() + s.toDouble())
          if (ratio > maxRatio) {
            maxRatio = ratio
            ansW = w
            ansS = s
          }
        }
      }
    }
  }

  println("${ansW + ansS} $ansS")
}
