fun main(args: Array<String>) {
    val L = readLine()!!.split(' ').map(String::toInt)
    val A = L[0]
    val B = L[1]
    val C = L[2]
    val D = L[3]
    val E = L[4]
    val F = L[5]

    var mttl:Int = 0
    var msug: Int = 0
    for (ai in 0..30) {
        val a = 100 * A * ai
        if (a > F) {
            break
        }
        for (bi in 0..30) {
            val b = 100 * B * bi
            if (a + b > F) {
                break
            }
            for (ci in 0..100) {
                val c = C * ci
                if (a + b + c > F) {
                    break
                }
                for (di in 0..100) {
                    val d = D * di
                    if (a + b + c + d > F) {
                        break
                    }
                    if ((a + b) * E / 100 < c + d) {
                        break
                    }
                    val ttl = a + b + c + d
                    val sug = c + d
                    if (msug * ttl <= sug * mttl) {
                        mttl = ttl
                        msug = sug
                    }
                }
            }
        }
    }
    println("$mttl $msug")
}