/+ dub.sdl:
	name "hello"
+/
import std.array;
import std.algorithm;
import std.conv;
import std.stdio;
import std.string;

void main()
{
    long A, B, C, D, E, F;
    readf("%s %s %s %s %s %s", &A, &B, &C, &D, &E, &F);
    long ws, s;
    double per = 0;
    foreach (a; 0 .. F / (100 * A) + 1)
        foreach (b; 0 .. F / (100 * B) + 1)
        {
            auto water = (A * 100 * a) + (B * 100 * b);
            if (F < water)
                continue;
            foreach (c; 0 .. (water * E / 100) / C + 1)
                foreach (d; 0 .. (water * E / 100) / D + 1)
                {
                    auto sugar = C * c + D * d;
                    if (F < water + sugar)
                        continue;
                    if (water * E / 100 < sugar)
                        continue;
                    if (water + suger == 0)
                        continue;
                    if (per < cast(double)(100 * sugar) / (water + sugar))
                    {
                        per = cast(double)(100 * sugar) / (water + sugar);
                        ws = sugar + water;
                        s = sugar;
                    }
                }
        }
    writefln("%s %s", ws, s);
}
