#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                           //     #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                    		return x != p.x ? x<p.x: y<p.y;
                                    	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };
int a[60]={0};

vector<int> wa,sa;

           signed main(){
   int a,b,c,d,e,f;
           	cin>>a>>b>>c>>d>>e>>f;          	
           	
           	for(int i=1;i<=f/100;i++){
           		bool bb=false;
           		for(int j=0;j<=i;j+=b)if((i-j)%a==0){
           			bb=1;
           			break;
           		}
           		if(bb)wa.pb(i*100);
           	}
           	
           	for(int i=0;i<=f;i++){
           		bool bb=false;
           		for(int j=0;j<=i;j+=d)if((i-j)%c==0){
           		bb=1;
           			break;
           		}
           		if(bb) sa.pb(i);
           	}
           	pas ans={100*a,0};
           	for(auto v:wa){
           		int satou=v*e/100;
           //		cout<<satou<<endl;
           		if(satou+v>f) satou=min(f-v,satou);
           		int r=upper_bound(sa.begin(),sa.end(),satou)-sa.begin();
           		r--;
           		pas z={v,sa[r]};
           	//	cout<<v<<" "<<sa[r]<<endl;
           		if((ans.y+0.0)/(1.0*ans.x+ans.y+0.0)<(z.y+0.0)/(1.0*z.x+z.y+0.0)) ans=z;
           	}
           	cout<<ans.x+ans.y<<" "<<ans.y<<endl;
           	
           }
             

Measured memory_bytes: 256