#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int a,b,c,d,e,f,i,j,k,l;
    ll answ=0,anss=0;
    double density=INT_MIN;
    cin>>a>>b>>c>>d>>e>>f;
    int a1=f/a;
    int b1=f/b;
    for(i=0; i<=a1; i++)
    {
        for(j=0; j<=b1; j++)
        {
            ll water=(a*i+b*j)*100;
            if(water>f)
                break;
            ll temp=e*(water/100);
            ll c1=temp/c;
            ll d1=temp/d;
            for(k=0;k<=c1;k++)
            {
                for(l=0;l<=d1;l++)
                {
                    ll salt=c*k+l*d;
                    if(salt>temp)
                        break;
                    if(salt+water>f)
                        break;
                    double dentemp=((100.0*salt)/((double)(salt+water)));
                    if(dentemp>density)
                    {
                        density=dentemp;
                        answ=water;
                        anss=salt;
                    }
                }
            }

        }
    }
    cout<<answ+anss<<' '<<anss<<endl;
    return 0;
}
