#include<bits/stdc++.h>
using namespace std;


int main() {
	
	int a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;
	double mconc = 0;
	int msugar = 0, mmass = 0; 
	for(int i=0; a*i*100<=f; i++){
		for(int j=0; (a*i+b*j)*100<=f; j++){
			for(int k=(a*i+b*j)*e/c; k>=0; k--){
				for(int l=((a*i+b*j)*e - c*k)/d; l>=0; l--){
					int mass = 100*a*i+100*b*j+c*k+d*l;
					int sugar = c*k+d*l;
					if(mass){
						if(mass <= f){
							double conc = (double)sugar / mass;
							if(mconc < conc){
								mconc = conc;
								mmass = mass;
								msugar = sugar;
							}
						}
					}
					
				}
			}
		}
	}
	if (mmass) cout << mmass << ' ' << msugar << endl;
	else cout << 100*a << ' ' << 0 << endl;
	
	
	return 0;
}