import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.numeric, std.typecons;

double[3000][3000] RESULT;

void main()
{
    auto it = readln.split.to!(int[]);
    auto A = it[0];
    auto B = it[1];
    auto C = it[2];
    auto D = it[3];
    auto E = it[4];
    auto F = it[5];

    void solve(int a, int b) {
        if (a + b > F || !RESULT[a][b].isNaN || b > a * E / 100.0) return;
        RESULT[a][b] = a + b == 0 ? 0 : 100.0 * b / (a + b);

        solve(a + 100 * A, b);
        solve(a + 100 * B, b);
        solve(a, b + C);
        solve(a, b + D);
    }

    solve(0, 0);

    size_t max_a, max_b;
    double max_s = 0;
    foreach (a, rs; RESULT) {
        foreach (b, r; rs) {
            if (!r.isNaN && r > max_s) {
                max_a = a;
                max_b = b;
                max_s = r;
            }
        }
    }

    writefln("%s %s", max_a + max_b, max_b);
}