import std.stdio, std.string, std.conv, std.bigint, std.typecons, std.algorithm, std.array, std.math, std.range;
 
void main() {
    auto tmp = readln.split.to!(uint[]);
    auto A = tmp[0];
    auto B = tmp[1];
    auto C = tmp[2];
    auto D = tmp[3];
    auto E = tmp[4];
    auto F = tmp[5];

    real rateMax = 0;
    int waterMax = 0;
    int sugarMax = 0;
    foreach (a; 0..cast(int)(F / (100 * A))+1) {
        foreach (b; 0..cast(int)((F - 100 * A * a) / (100 * B))+1) {
            foreach (c; 0..cast(int)((F - 100 * (A * a + B * b)) / C)+1) {
                foreach (d; 0..cast(int)((F - 100 * (A * a + B * b) - C * c) / D)+1) {
                    auto water = 100 * (A * a + B * b);
                    auto sugar = C * c + D * d;
                    if (100 * sugar > water * E) continue;
                    auto rate = cast(real)sugar / water;
                    if (rate <= rateMax) continue;
                    rateMax = rate;
                    waterMax = water;
                    sugarMax = sugar;
                }
            }
        }
    }
    writeln(waterMax+sugarMax, " ", sugarMax);
}
