#include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i > (b); --i)
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#define rep_re(i,n) FOR_RE(i,n,0)

#define DEBUG_VARIABLE(variable) cout << #variable << ":" << variable << endl

#define WHITE 1//（未訪問）
#define GRAY 2//（訪問）未だに訪問していない頂点への辺を持っている。スタックに退避。
#define BLACK 3//（訪問完了）未訪問への頂点への辺を持たない
#define N 100
#define INFTY (1 << 21) //10^21
int M[N][N];//隣接行列
int color[N];

//1個上から時計周り
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//上右下左
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
static const int NIL = -1;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> Vector;
typedef vector<Vector>	DVector;
int n;

void printArray(int *array, int);
void printVector(Vector);
void printDimention(DVector);

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    
    int z;
    Vector water;
    water.push_back(0);
    rep(i, 30){
        rep(j, 30){
            bool flg = false;
            z = a * i + b * j;
            if(z > 30)  break;
            //DEBUG_VARIABLE(z);
            //DEBUG_VARIABLE(suger[suger.size() - 1]);
            rep(i, water.size()){
                if(water[i] == z){
                    flg = true;
                    break;
                }
            }
            if(flg) continue;
            water.push_back(z);
        }
    }
    sort(water.begin(), water.end());
    //water.erase(water.begin());
    //printVector(water);
    
    double con = 0, con_max = -10;
    int res_sw, res_suger;
    
    rep(k, water.size()){
        if(k == 0)  continue;
        int suger_lim = water[k] * e;
        for(int i = 0; i <= 3000/c; i++){
            for(int j = 0; j <= 3000/d; j++){
                int suger = c * i + d * j;
                if(suger <= suger_lim){
                    if(water[k] * 100 + suger <= f){
                        con = (double)suger / (double)(suger + water[k] * 100);
                        if(con > con_max){
                            con_max = con;
                            res_sw = suger + water[k] * 100;
                            res_suger = suger;
                        }
                    }else{
                        break;
                    }
                }else{
                    break;
                }
            }
        }
    }
    cout << res_sw << " " << res_suger << endl;
}

//配列の表示
void printArray(int array[], int n){
    rep(i, n){
        if(i)   cout << " ";
        cout << array[i];
    }
    cout << endl;
}

//Vectorの表示
void printVector(Vector &v){
    rep(i, (int)v.size()){
        if(i)   cout << " ";
        cout << v[i];
    }
    cout << endl;
}

//二次元配列の表示
void printDimention(DVector &dv){
    rep(i, (int)dv.size()){
        rep(j, (int)dv[i].size()){
            if(j)   cout << " ";
            cout << dv[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256