// Try AtCoder
// author: Leonardone @ NEETSDKASU
import std.stdio      : readln, writeln;
import std.array      : split;
import std.string     : chomp;
import std.conv       : to;

auto gets() { return readln.chomp; }
auto getVals(T)() { return gets.split.to!(T[]); }

void main() {
    auto xs = getVals!int;
    auto A = xs[0];
    auto B = xs[1];
    auto C = xs[2];
    auto D = xs[3];
    auto E = xs[4];
    auto F = xs[5];
    int ansSugar = 0, ansWater = 100 * A;
    for (int a = 0; 100 * A * a <= F; a++) {
        int sizeA = 100 * A * a;
        for (int b = 0; sizeA + 100 * B * b <= F; b++) {
            int water = sizeA + 100 * B * b;
            for (int c = 0; water + C * c <= F; c++) {
                int sizeC = C * c;
                if (sizeC * 100 > E * water) { break; }
                for (int d = 0; water + sizeC + D * d <= F; d++) {
                    int sugar = sizeC + D * d;
                    if (sugar * 100 > E * water) { break; }
                    if (ansWater == 0) {
                        ansSugar = sugar;
                        ansWater = water;
                    } else if (sugar*(ansWater+ansSugar) > ansSugar*(water+sugar)) {
                        ansSugar = sugar;
                        ansWater = water;
                    }
                }
            }
        }
    }
    writeln(ansWater+ansSugar, " ", ansSugar);
}