fun main(args: Array<String>) = yorukatsu22e()

fun yorukatsu22e() {
    operator fun List<Int>.component6() = this[5]
    val (a, b, c, d, e, f) = readLine()!!.split(' ').map { it.toInt() }

    val sugarSet = mutableSetOf<Int>()
    for (cw in 0..f step c) for (dw in 0..f step d) sugarSet.add(cw + dw)

    val sugarPatterns = sugarSet.sorted().toIntArray()

    fun upperBound(list: IntArray, key: Int): Int {
        var ng = -1
        var ok = list.size

        while (ok - ng > 1) {
            val mid = (ok + ng) / 2
            if (list[mid] > key) ok = mid else ng = mid
        }
        return ok
    }


    var pair = a * 100 to 0
    var maxPercentage = 0.0

    for (aw in 0..f step a * 100) for (bw in 0..f step b * 100) {
        val waterWeight = aw + bw
        val maxOfSugarWeight = Math.min(e * waterWeight / 100, f - waterWeight)
        if (maxOfSugarWeight < 0) continue

        val ub = upperBound(sugarPatterns, maxOfSugarWeight) - 1
        if (ub !in sugarPatterns.indices) continue

        val sugarWeight = sugarPatterns[ub]
        val sumWeight = sugarWeight + waterWeight

        val percentage = sugarWeight.toDouble() * 100 / sumWeight.toDouble()

        if (percentage > maxPercentage) {
            maxPercentage = percentage
            pair = sumWeight to sugarWeight
        }
    }

    val answer = "${pair.first} ${pair.second}"

    println(answer)
}
