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

#define endl '\n'

#define abs(a) ((a) < 0? -(a): (a))

// #if defined _WIN32 && !defined ONLINE_JUDGE
// #include <windows.h> //only works on windows
// long TimeBegin = GetTickCount();
// void timer() {cout<<endl<<"*** Execution time: "<<(GetTickCount()-TimeBegin)<<"ms ***"<<endl;}
// #endif

#define s(x) scanf("%d",&x)
#define s2(x,y) scanf("%d %d",&x,&y)
#define sd(x) scanf("%lf",&x)

#define fr(i,s) for(int i=0;i<(s);i++)
#define frl(i,s) for(long long i=0;i<(s);i++)
#define sarr(x,s) for(int i=0;i<(s);i++) scanf("%d",&x[i])

#define pb(x) push_back(x)
#define ppb() pop_back()
#define pf(x) push_front(x)
#define ppf() pop_front()
#define ff first
#define ss second

#ifndef ONLINE_JUDGE  //debugging
#define debug(x) cout<<(#x)<<" = "<<(x)<<endl
void test() {cout<<"meaow"<<endl;}
template <class T1> void test(T1 e) {cout<<"meaow\t"<<e<<endl;}
template <class T1,class T2> void test(T1 e1,T2 e2) {cout<<"meaow\t"<<e1<<"\t"<<e2<<endl;}
template <class T1,class T2,class T3> void test(T1 e1,T2 e2,T3 e3) {cout<<"meaow\t"<<e1<<"\t"<<e2<<"\t"<<e3<<endl;}
template <class T1,class T2,class T3,class T4> void test(T1 e1,T2 e2,T3 e3,T4 e4) {cout<<"meaow\t"<<e1<<"\t"<<e2<<"\t"<<e3<<"\t"<<e4<<endl;}
template <class T1,class T2,class T3,class T4,class T5> void test(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5) {cout<<"meaow\t"<<e1<<"\t"<<e2<<"\t"<<e3<<"\t"<<e4<<"\t"<<e5<<endl;}
#define parr(x,s) for(int i=0;i<(s);i++) {cout<<x[i]<<"\t";} cout<<endl //tab separated
#else
#define debug(x)
void test() {}
template <class T1> void test(T1 e) {}
template <class T1,class T2> void test(T1 e1,T2 e2) {}
template <class T1,class T2,class T3> void test(T1 e1,T2 e2,T3 e3) {}
template <class T1,class T2,class T3,class T4> void test(T1 e1,T2 e2,T3 e3,T4 e4) {}
template <class T1,class T2,class T3,class T4,class T5> void test(T1 e1,T2 e2,T3 e3,T4 e4,T5 e5) {}
#define parr(x, s)
#endif

const int MAX = (int)1e5 + 5;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

int maxfill(int a, int b, int c)
{
    int ans = c + 1;
    for (int i = 0; i <= c/a; i++)
    {
        for (int j = 0; i*a + j*b <= c; j++)
        {
            ans = min(c - i*a - j*b, ans);
        }
    }
    return c - ans;
}


// int main()
// {
//     // #ifndef ONLINE_JUDGE
//     // freopen("in.txt", "r", stdin);
//     // //freopen("out.txt", "w", stdout);
//     // #endif

//     int a, b, c, d, e, f;
//     ll water, sugar;
//     cin >> a >> b >> c >> d >> e >> f;

//     water = f / (e + 100);
//     water = maxfill(a, b, water);
    
//     sugar = water*e;
//     sugar = maxfill(c, d, sugar);
//     water *= 100;

//     if (water == 0) water = maxfill(a, b, f);

//     cout << water + sugar << " " <<  sugar << endl;

//     // #if defined _WIN32 && !defined ONLINE_JUDGE
//     // timer();
//     // #endif
    
//     return 0;
// }

int main()
{
    int a, b, c, d, e, f;
    ll water, sugar;
    double ans = 0;
    cin >> a >> b >> c >> d >> e >> f;
    for (int i = 0; 100*i*a <= f; i++)
    {
        for (int j = 0; (a*i+b*j)*100 <= f ; j++)
        {
            for (int p = 0; (a*i+b*j)*100+p*c <= f && (p*c) <= e*(a*i+b*j); p++)
            {
                for (int q = 0; (a*i+b*j)*100+p*c+q*d <= f && (p*c+q*d) <= e*(a*i+b*j); q++)
                {
                    if ((double)(p*c+q*d)/(a*i+b*j) >= ans)
                    {
                        water = (a*i+b*j)*100;
                        sugar = p*c+q*d;
                        ans = (double)(p*c+q*d)/(a*i+b*j);
                    }
                }
            }
        }
    }

    cout << water+sugar << " " << sugar << endl;
    return 0;
}


Measured memory_bytes: 256