#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<bitset>
// #include<unordered_map> 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #include "boost/algorithm/string.hpp"
#define fio ios_base::sync_with_stdio(false)
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
#define li long long int
#define ll li
#define readi(x) scanf("%d",&x)
#define  reads(x)  scanf("%s", x)
#define readl(x) scanf("%I64d",&x)
#define rep(i,n) for(i=0;i<n;i++)
#define revp(i,n) for(i=(n-1);i>=0;i--)
#define myrep1(i,a,b) for(i=a;i<=b;i++)
#define myrep2(i,a,b) for(i=b;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define MAXN 1000000000000000000
#define MINN -1000000000000000000
#define pii pair<ll,ll> 
#define pdd pair<double,double>
#define pic pair<int,char>
#define N 100100
#define lgn 20
#define ddouble long double
#define minus minu
#define PI 3.1415926535
#define lgn 20


// #define INTMAX 200000000

// using namespace boost;
// #define si short int

using namespace std;
using namespace __gnu_pbds;             
// typedef priority_queue<ll, vector<ll> > max_pq;
// typedef priority_queue<pii, vector<pii> , greater<pii >  > min_pq;
ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}
string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

// typedef priority_queue<pair < ll , pair < pii , ll > >  , vector<pair < ll , pair < pii , ll > >  > ,greater<pair < ll , pair < pii , ll > >  > > min_pq;

typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
typedef priority_queue< pii , vector<pii> > max_pq;
typedef priority_queue<pii, vector<pii> , greater <pii>  > min_pq;

ll a,b,c,d,e,f;
ll amt[ 4000 ],kitna[4000];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> a >> b >> c >> d >> e >> f;

    for ( ll i = 0 ; i <= 30 ; i ++)
    {
        for ( ll j = 0 ; j <= 30 ; j ++)
        {
            if ( ( 100*i*a + 100*j*b) <= f )
            {   
                amt[100*i*a + 100*j*b] = 1;
            }
        }
    }

    for ( ll i = 4000 - 2; i >= 0 ; i --)
    {
        if ( amt[i] == 1 )
            kitna[i] = i;
        else
            kitna[i] = kitna[i+1];
    }

    double dens = 0;
    ll sw = a*100 , s = 0;
 

    for ( ll i = 0 ; i <= 3000 ;i ++)
    {
        for ( ll j = 0 ; j <= 3000 ; j ++)
        {
            ll sugar = ( c*i + d*j ) ;
            ll idx = 0;
            if ( (sugar*100)%e == 0 )
                idx = (sugar*100)/e ;
            else
                idx = (sugar*100)/e + 1  ;
          

            if ( sugar + idx <= f and kitna[idx]!=0)
            {
                  // if ( sugar == 880 )
                  //   cout << "yele" << sugar + idx  << endl;
                
                double val = ((double)(sugar*1.0))/((double)kitna[idx] + (double)1.0*sugar);
                double val2 = ((double)(sugar*1.0))/((double)kitna[idx]);
                // if ( sugar == 880 )
                //     cout << val << " "  << sw<<" " << s <<" " << i <<" " << j << endl;
                // if ( sugar == 200 )
                // cout <<"yele" << kitna[idx] << endl;;
                if ( kitna[idx] + sugar <= f and (double)val > (double)dens and val2 <= e*0.01 )
                {
                    dens = val;
                    sw = kitna[idx] + sugar;
                    s = sugar;
                }
            }
        }
    }

    cout << sw << " " << s ;





}                       

Measured memory_bytes: 256