// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)

#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)

#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)

#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)

#define all(x) (x).begin(), (x).end()

#define sz(x) ((int)(x).size())

#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())



int A, B, C, D, E, F;



bool create_water(int g) {

    bool res = false;

    int amax = F / (A * 100);

    int bmax = F / (B * 100);

    

    rep(a, amax + 1) {

        rep(b, bmax + 1) {

            if ((a * A * 100 + b * B * 100) == g) {

                res = true;

                break;

            }

        }

    }

    

    return res;

}



bool create_sugar(int g) {

    bool res = false;

    int cmax = F * E / 100 / C;

    int dmax = F * E / 100 / D;

    

    rep(c, cmax + 1) {

        rep(d, dmax + 1) {

            if ((c * C + d * D) == g) {

                res = true;

                break;

            }

        }

    }

    

    return res;

}



int main() {

    cin.tie(0);

    ios::sync_with_stdio(false);

    

    cin >> A >> B >> C >> D >> E >> F;

    double score = -1;

    int answ = 0, anss = 0;

    double limit_per = 100.0 * E / (100.0 + E);

    

    rep(s, F + 1) {

        rep(w, F - s + 1) {

            if (!create_water(w)) {

                continue;

            }

            

            if (!create_sugar(s)) {

                continue;

            }

            

            double ts = 100.0 * s / (s + w);

            

            if (ts > limit_per) {

                continue;

            }

            

            if (ts > score) {

                score = ts;

                answ = w;

                anss = s;

            }

        }

    }

    

    cout << (answ + anss) << " " << anss << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.757807215165043x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)

#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)

#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)

#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)

#define all(x) (x).begin(), (x).end()

#define rall(x) (x).rbegin(), (x).rend()

#define sz(x) ((ll)(x).size())

#define len(x) ((ll)(x).length())

#define endl "\n"



bool check(ll e, ll sum, ll sugar) {

    return ((sugar * (100 + e)) <= (e * sum));

}



int main() {

    cin.tie(0);

    ios::sync_with_stdio(false);

    // ifstream in("input.txt");

    // cin.rdbuf(in.rdbuf());

    const ll inf = LONG_LONG_MIN / 2 + 1;

    ll a, b, c, d, e, f;

    cin >> a >> b >> c >> d >> e >> f;

    vector<ll> dp(f + 1, inf);

    dp[0] = 0;

    double per = -100;

    ll answs = 0, anss = 0;

    reps(i, 1, f + 1) {

        if ((i >= (100 * a)) && (dp[i - (100 * a)] != inf)) {

            dp[i] = max(dp[i], dp[i - (100 * a)]);

        }

        if ((i >= (100 * b)) && (dp[i - (100 * b)] != inf)) {

            dp[i] = max(dp[i], dp[i - (100 * b)]);

        }

        if ((i >= c) && (dp[i - c] != inf) && (check(e, i, dp[i - c] + c))) {

            dp[i] = max(dp[i], dp[i - c] + c);

        }

        if ((i >= d) && (dp[i - d] != inf) && (check(e, i, dp[i - d] + d))) {

            dp[i] = max(dp[i], dp[i - d] + d);

        }

        if (dp[i] == inf) continue;

        double tmp = (double)dp[i] / i;

        if (per < tmp) {

            per = tmp;

            answs = i;

            anss = dp[i];

        }

    }

    printf("%lld %lld\n", answs, anss);

    return 0;

}