import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;


void main() {
    int A, B, C, D, E, F;
    scan(A, B, C, D, E, F);

    int ans_w = 100*A, ans_s = 0;

    foreach (x ; 0 .. 31) {
        foreach (y ; 0 .. 31) {
            int water = 100 * (A * x + B * y);

            if (water == 0) continue;

            int L = min((A*x + B*y) * E, F - 100*(A*x + B*y));
            if (L < 0) break;

            foreach (w ; 0 .. 3001) {
                if (L - C*w < 0) break;
                
                int z = (L - C*w) / D;

                //if (z < 0) break;

                int sugar = C*w + D*z;

                if (ans_s * (water + sugar) < sugar * (ans_w + ans_s)) {
                    ans_w = water;
                    ans_s = sugar;

                    debug {
                        writeln(ans_w, " ", ans_s);
                    }
                }
            }
        }
    }

    writeln(ans_w + ans_s, " ", ans_s);
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}