object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val A, B, C, D, E, F = sc.nextInt()
    // 砂糖の濃度を水 100g あたり Eg に近づけたい
    // 全体としてFg以下かつビーカーの中に佐藤と溶け残らせてはいけない
    // a + b <= F
    // b / (a + b) <= E / (100 + E)
    // 物質を抜く, という選択肢は無い
    // F <= 3000 なので, 全探索できそう, <= 大嘘

    def solve(): (Int, Int) = {
      def upperBoundsC(a: Int, b: Int, upperC: Int): Int = {
        val base = (100 * A * a + 100 * B * b).toDouble
        val MAX = E.toDouble / (100F + E.toDouble)
        def loop(left: Int, right: Int): Int =
          if (right - left > 1) {
            val c = left + (right - left) / 2
            if ((c / base) > MAX) loop(left, c)
            else loop(c, right)
          } else left
        loop(0, upperC + 1)
      }
      def upperBoundsD(a: Int, b: Int, c: Int, upperD: Int): Int = {
        val base = (100 * A * a + 100 * B * b + c).toDouble
        val MAX = E.toDouble / (100F + E.toDouble)
        def loop(left: Int, right: Int): Int =
          if (right - left > 1) {
            val d = left + (right - left) / 2
            if (((c + d) / (base + d)) > MAX) loop(left, d)
            else loop(d, right)
          } else left
        loop(0, upperD + 1)
      }

      (for {
        a <- 0 to (F / (100 * A))
        b <- 0 to ((F - (100 * A) * a) / (100 * B))
        if !(a == 0 && b == 0)
        c <- 0 to upperBoundsC(a, b, (F - (100 * A) * a - (100 * B) * b) / C)
        d = upperBoundsD(a, b, c, (F - (100 * A) * a - (100 * B) * b - C * c) / D)
      } yield (100 * A * a + 100 * B * b + c + d, c + d)).maxBy{ case (a, b) => b / (a + b).toDouble }
    }

    val (a, b) = solve()
    println(s"$a $b")
  }

}
