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

alias sread = () => readln.chomp();
ulong MOD = 1_000_000_007;
ulong INF = 1_000_000_000_000;
alias Side = Tuple!(long, "from", long, "to");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

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

long n, m;
long[][] graph;

void main()
{
    long a, b, c, d, e, f;
    scan(a, b, c, d, e, f);
    a *= 100, b *= 100;
    auto water = new long[](0);
    auto sugar = new long[](0);
    foreach (i; iota(f / a + 1))
        foreach (j; iota(f / b + 1))
            if (a * i + b * j <= f)
                water ~= [a * i + b * j];
    foreach (i; iota(f / c + 1))
        foreach (j; iota(f / d + 1))
            if (c * i + d * j <= f)
                sugar ~= [c * i + d * j];

    double max_dens = -114514;
    long ans_w, ans_s;
    foreach (w; water.dropOne())
    {
        foreach (s; sugar.dropOne())
        {
            long include = s <= e * w / 100 ? s : 0;
            double dens = include / w + include;
            
            if (w + include <= f && dens > max_dens)
            {
                max_dens = dens;
                ans_w = w + include, ans_s = include;
            }
        }
    }
    writefln("%s %s", ans_w, ans_s);
}
