import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

T RD(T = string)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto A = RD!long;
	auto B = RD!long;
	auto C = RD!long;
	auto D = RD!long;
	auto E = RD!long;
	auto F = RD!long;

	double bestP = 0.0;
	long bestQ, bestSQ;
	foreach (ai; 0..31)
	{
		auto aq = A * ai;
		foreach (bi; 0..31)
		{
			if (ai + bi == 0) continue;

			auto bq = B * bi;
			auto wq = aq + bq;
			auto remain = F - wq * 100;
			if (remain < 0) continue;

			auto limit = min(remain, wq * E);
			long sq;
			foreach_reverse (i; 0..limit+1)
			{
				bool isDone = false;
				long s = i;
				while (s >= 0)
				{
					if (s % C == 0 || s % D == 0)
					{
						sq = i;
						isDone = true;
						break;
					}
					s -= C;
				}
				if (isDone) break;
			}
			//auto sq1   = ((limit / C) * C) + ((limit % C) / D) * D;
			//auto sq2   = ((limit / D) * D) + ((limit % D) / C) * C;
			//auto sq    = max(sq1, sq2);
			auto q     = wq * 100 + sq;
			auto p     = sq * 100.0 / q;

			if (p >= bestP)
			{
				bestP  = p;
				bestQ  = q;
				bestSQ = sq;
				stderr.writeln(remain, " ", wq * E, " ", limit);
			}
		}
	}
	
	writeln(bestQ, " ", bestSQ);
	stdout.flush();
}