#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>

using namespace std;

/* template */

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

void debug_out() { std::cout << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rrep(i, a, n) for (int i = ((int)(n)-1); i >= (int)(a); i--)
#define Rep(i, a, n) for (long long i = (long long)(a); i< (long long)(n); i++)
#define RRep(i, a, n) for (long long i = ((long long)(n)-1); i>=(long long)(a); i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    int weight;
    edge(int f,int t,int w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

template <class T>
inline bool chmin(T &a, T b){
    if (a > b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b){
    if (a < b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

bool isPalindrome(string s){
    string t = s;
    reverse(all(t));
    return s==t;
}

constexpr ll INF = 1e9+7;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

/* template */

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    vector<int> a(6);
    rep(i,0,6) cin >> a[i];
    vector<int> water;
    int f = a[5]/100;
    int n = f/a[0];
    int m = f/a[1];
    rep(i,0,n+1){
        rep(j,0,m+1){
            int s = a[0]*i + a[1]*j;
            if(s==0) continue;
            if(s<=f){
                water.emplace_back(s*100);
            }
        }
    }
    vector<int> sugar;
    rep(i,0,a[4]*f){
        rep(j,0,a[4]*f){
            if(a[2]*i + a[3]*j >= f*a[4]) continue;
            sugar.emplace_back(a[2]*i + a[3]*j);
        }
    }
    sort(all(sugar));
    pair<int,int> ans = make_pair(0,0);
    rep(i,0,water.size()){
        int w = water[i]*a[4]/100;
        if(w+water[i]>=a[5]){
            w = a[5]-water[i];
        }
        w++;
        auto it = lower_bound(all(sugar),w);
        if(it == sugar.begin()) continue;
        it--;
        if(water[i]+*it>a[5]){
            continue;
        }
        if(ans == make_pair(0,0)) ans = make_pair(water[i],*it);
        else{
            int x = ans.second * water[i];
            int y = ans.first *(*it);
            if(x<y){
                ans = make_pair(water[i],*it);
            }
        }
    }
    cout << (ans.first+ans.second) << " " << ans.second << endl;
}

Measured memory_bytes: 1400