#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define int long long
int ans1, ans2;
double dl = 0;
signed main() {
	int a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;
	ans1 = a * 100;
	for (int i = 0; i <= f; i += a * 100) {
		for (int j = 0; i + j <= f; j += b * 100) {
			int g = (i + j) / 100 * e;
			for (int k = 0; k <= g && i + j + k <= f; k += c) {
				for (int l = 0; k + l <= g && i + j + k + l <= f; l += d) {
					if (dl < (double)(k + l) / (i + j + k + l)) {
						dl = (double)(k + l) / (i + j + k + l);
						ans1 = i + j + k + l;
						ans2 = k + l;
					}
				}
			}
		}
	}
	cout << ans1 << ' ' << ans2 << endl;
}