/+ 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);
    double per = 0.0;
    long sw, s;
    foreach (x; 0 .. F + 1)
        foreach (y; 0 .. F + 1)
        {
            auto water = (100 * A * x) + (100 * B * y);
            if (F < water)
                continue;
            foreach (i; 0 .. F + 1)
                foreach (j; 0 .. F + 1)
                {

                    auto sugar = (C * i) + (D * j);
                    if (F < water + sugar)
                        continue;
                    if (water * E < 100 * sugar)
                        continue;
                    if (water + sugar == 0)
                        continue;
                    double _per = cast(double)(100 * sugar) / (sugar + water);
                    if (per < _per)
                    {
                        per = _per;
                        sw = sugar + water;
                        s = sugar;
                    }

                }
        }

    writefln("%s %s", sw, s);
}
