#include<bits/stdc++.h>

using namespace std;

int
main(void){
	int a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;
	a *= 100;
	b *= 100;
	double cmp = -1;
	int ans1 = 0, ans2 = 0;
	for(int i = 0; i <= f; i += a){
		for(int j = 0; i + j <= f; j += b){
			if(i + j == 0) continue;
			int w = i + j;
			int maxs = (w * e)/100;
			for(int k = 0; k <= maxs; k += c){
				for(int l = 0; k + l <= maxs; l += d){
					int s = k + l;
					if(s + w > f) continue;
					double cur = (1000000 * s)/(s + w);
					if(cur > cmp){
						ans1 = s + w;
						ans2 = s;
						cmp = cur;
					}	
				}
			}
		}
	}
	cout << ans1 << " " << ans2;
}