fun main(arg: Array<String>) {
    val input = listOfInt()
    val (A, B, C, D) = input
    val (E, F) = input.subList(4, 6)
    var z = 0.0
    var x = A * 100
    var y = 0
    for (a in 0 .. F step 100 * A) {
        for (b in 0 .. F step 100 * B) {
            val w = a + b
            if (w == 0) continue
            for (c in 0 .. F step C) {
                for (d in 0 .. F step D) {
                    val s = c + d
                    val t = w + s
                    if (F < t || E < s * 100.0 / w) break
                    val conc = s * 100.0 / t
                    if (z < conc) {
                        z = conc; x = t; y = s
                    }
                }
            }
        }
    }
    println("$x $y")
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfInt(D: Int = 0) = listOfString().map { Integer.parseInt(it) + D }
fun listOfLong() = listOfString().map(String::toLong)
fun listOfDouble() = listOfString().map { it.toDouble() }
