data class Satoumizu(val water:Int, val sugar:Int):Comparable<Satoumizu>{
    override fun compareTo(other: Satoumizu): Int {
        return (this.sugar * other.water).compareTo(this.water * other.sugar)
    }

}
fun main(args:Array<String>):Unit{
    val arg = readLine()!!.split(' ').map(String::toInt).toIntArray()
    val a = arg[0] * 100
    val b = arg[1] * 100
    val c = arg[2]
    val d = arg[3]
    val e = arg[4]
    val f = arg[5]
    var max = Satoumizu(1, 0)
    for (aNum in 0 .. (f / a)){
        for (bNum in 0 .. ((f - a * aNum) / b)){
            val sugarWeight = maxSugar(minOf(f - aNum * a - bNum * b, (aNum * a + bNum * b) * e / 100), c, d)
            if (max <= Satoumizu(aNum * a + bNum * b, sugarWeight)){
                max = Satoumizu(aNum * a + bNum * b, sugarWeight)
            }
        }
    }
    println("${max.water + max.sugar} ${max.sugar}")
}
fun maxSugar(rest:Int, c:Int, d:Int):Int{
    return (0 .. (rest / c)).map{cNum -> cNum * c + (rest - cNum * c) / d * d}.max() ?: 0
}
fun minOf(a:Int, b:Int):Int = if (a < b) a else b