import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Clue = Tuple!(long, "x", long, "y", long, "h");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long a, b, c, d, e, f;
    scan(a, b, c, d, e, f);
    long w, s;
    double density = 0;
    // ありえる組み合わせで総当りするナリ
    foreach (i; iota(f / (100 * a) + 1))
    {
        foreach (j; iota(f / (100 * b) + 1))
        {
            // 現在の水の量に溶ける砂糖の量を総当り的に求めるナリ
            auto water = 100 * (a * i + b * j);
            auto rest = f - water;
            foreach (k; iota(rest / c + 1))
            {
                // 驚きの4重ループ、計算上は間に合うはずだっちゃ
                foreach (l; iota(rest / d + 1))
                {
                    auto sugar = c * k + d * l;
                    // 100[g]にはe[g]までしか溶けないことに注意でござる
                    if ((a * i + b * j) * e < sugar)
                        break;

                    auto tmp_density = sugar / cast(double)(water + sugar);
                    if (tmp_density > density)
                    {
                        w = water;
                        s = sugar;
                        density = tmp_density;
                    }
                }
            }
        }
    }
    writefln("%s %s", w + s, s);
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}
