fun main(args: Array<String>) {
    val input = readLine()!!.split(' ').map(String::toInt)
    val a = input[0]
    val b = input[1]
    val c = input[2]
    val d = input[3]
    val e = input[4]
    val f = input[5]
    var maxconc = 0.0
    var maxt = a * 100
    var maxs = 0
    for (an in 0..f step 100 * a) {
        for (bn in 0..f step 100 * b) {
            val water = an + bn
            if (water == 0) continue
            for (cn in 0..f step c) {
                for (dn in 0..f step d) {
                    val sugar = cn + dn
                    val total = water + sugar
                    if (f < total || e < sugar * 100.0 / water) break
                    val conc = sugar * 100.0 / total
                    if (maxconc < conc) {
                        maxconc = conc
                        maxt = total
                        maxs = sugar
                    }
                }
            }
        }
    }
    println("$maxt $maxs")
}
