#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including seg_tree_order_statistics_node_update
#include <stdio.h>
#include <cassert>
using namespace std;
//using namespace __gnu_pbds;
typedef int lo;
typedef pair<lo,lo> ll;//pair
typedef vector<lo> vl;  //vector of long
typedef vector<ll > vll;   //vector of pair
typedef priority_queue<lo>p_q;
typedef vector< vl > vvl;  //vector of vectors
#define X first
#define Y second
#define mp(a,b) make_pair((a),(b))
#define REP(a,b) for(lo i=(a);i<(lo)b;i++)//no need to declare variable i
#define REPE(a,b,c,d) REP(a,b)for(lo j=(c);j<(lo)d;j++)//no need to declare vaiables i,j
#define REPV(a,b,c) for(lo(a)=b;(a)<(c);(a)++)//a is the variable
#define IREP(a,b) for(lo i=(a);i>=(b);i--)
#define IREPV(a,b,c) for(lo(a)=b;(a)>=(c);(a)--)
#define all(v) (v).begin(),(v).end()
#define TRV(a) for(auto it : a)
#define INF 300100
#define MOD 1000000007
#define M 1000000007
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
#define pb(a) push_back((a))
#define endl "\n"
#define eps 1e-9
#define PI 3.141592653589793
template<typename T> ostream& operator<< ( ostream &o,vector<T> v ) {
    if ( v.size() >0 )o<<v[0];
    for ( unsigned   i=1; i<v.size(); i++ )o<<" "<<v[i];
    return o<<endl;
}
template<typename U,typename V> ostream& operator<< ( ostream &o,pair<U,V> p ) {
    return o<<"("<<p.first<<", "<<p.second<<") ";
}
template<typename T> istream& operator>> ( istream &in,vector<T> &v ) {
    for ( unsigned   i=0; i<v.size(); i++ )in>>v[i];
    return in;
}
template<typename T> istream& operator>> ( istream &in,pair <T,T> &p ) {
    in>>p.X;
    in>>p.Y;
    return in;
}
typedef complex<double> base;
void fft(vector<base> & a, bool invert) {
	lo n = (lo)a.size();
	for (lo i = 1, j = 0; i<n; ++i) {
		lo bit = n >> 1;
		for (; j >= bit; bit >>= 1)j -= bit;
		j += bit;
		if (i < j) swap(a[i], a[j]);
	}
	for (lo len = 2; len <= n; len <<= 1) {
		double ang = 2 * PI / len * (invert ? -1 : 1);
		base wlen(cos(ang), sin(ang));
		for (lo i = 0; i<n; i += len) {
			base w(1);
			for (lo j = 0; j<len / 2; ++j) {
				base u = a[i + j], v = a[i + j + len / 2] * w;
				a[i + j] = u + v;
				a[i + j + len / 2] = u - v;
				w *= wlen;
			}
		}
	}
	if (invert)for (lo i = 0; i<n; ++i)a[i] /= n;
}

vl mult(vl a,vl  b) {
	//cout << a.size() << "%" << b.size() << endl;
	vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
	size_t n = 1;
	while (n < max(a.size(), b.size()))  n <<= 1;
	n <<= 1;
	//cout << a.size() << " " << b.size() << endl;
	fa.resize(n), fb.resize(n);
	fft(fa, false), fft(fb, false);
	for (size_t i = 0; i<n; ++i)fa[i] *= fb[i];
	fft(fa, true);
	vl res;
	res.resize(n);
	for (size_t i = 0; i<n; ++i)res[i] = int(fa[i].real() + 0.5);
	return res;
}
vl power(vl base ,lo exp){
	vl res(1024,0);
	res[0]=1;
    while(exp>0){
       if(exp%2==1)res=mult(res,base);
       while(res.size()>(1<<20))res.pop_back();
       base=mult(base,base);
       while(base.size()>(1<<20))base.pop_back();
       exp/=2;
    }
    while(res.size()>(1<<20))res.pop_back();
    return res;
}

int main(){
    std::ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);cout.precision(20);
	lo a,b,c,d,e,f;
	cin>>a>>b>>c>>d>>e>>f;
	lo ans=0;
	lo ans2=0;
	long double res=-1;
	for(lo x=0;a*x*100<=f;x++)
        for(lo y=0;(a*x+b*y)*100<=f;y++){
            lo rem=f-(a*x+b*y)*100;
            lo p=(a*x+b*y)*100;
            rem=min(rem,(e*p)/100);
            //cout<<p<<" "<<rem<<" ";
            REP(0,rem/c+1){
                lo t=rem-c*i;
                lo z=(t/d);
                lo ans1=p+c*i+d*z;
                lo ans21=c*i+d*z;
                if(((ans21*100.0)/(ans1*1.0))>res){
                    res=(ans21*100.0)/(ans1*1.0);
                    ans=ans1;
                    ans2=ans21;
                }
            }
        }
    cout<<ans<<" "<<ans2;
	return 0;
}


Measured memory_bytes: 256