fun main(args: Array<String>) {
    val inputs = readInputLine().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 maxDensity = 0.0
    
    var water = 0
    var sugar = 0
    
    for (i in 0..(f / 100 / a)) {
        for (j in 0..((f / 100 - i) / b)) {
            if (i == 0 && j == 0) {
                continue
            }
            for (k in 0..(f / c)) {
                for (l in 0..((f - c * k) / d)) {
                    if (i * a * 100 + j * b * 100 + k * c + l * d <= f && k * c + l * d <= e * (i * a + j * b)) {
                        val density = (100 * (k * c + l * d)).toDouble() / (i * a * 100 + j * b * 100 + k * c + l * d)
                        if (density > maxDensity) {
                            maxDensity = density
                            water = i * a * 100 + j * b * 100
                            sugar = k * c + l * d
                        }
                    }
                }
            }
        }
    }
    
    if (water == 0) {
        println("${100 * a} 0")
    } else {
        println("${water + sugar} $sugar")
    }
}
 
fun readInputLine(): String {
    return readLine()!!
}
