#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0L;i--)
#define positiverep(i,n) for(int64_t i=1;i <= (int64_t)(n);i++)
using namespace std;

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/
struct playerinfo{
  int64_t eattime;
  int64_t id;
};

int main(){
  int64_t a,b,c,d,e,f;
  cin >> a >> b >> c >> d >> e >> f;
  //cout << f << endl;
  vector<bool> sdp(3001);
  vector<bool> wdp(31);
  sdp[0] = true;
  wdp[0] = true;
  for(int64_t s=1;s <= 3000;s++){
    if(s >= c) sdp[s] = (sdp[s] || sdp[s-c]);
    if(s >= d) sdp[s] = (sdp[s] || sdp[s-d]);
  }
  for(int64_t w=1;w <= 30;w++){
    if(w >= a) wdp[w] = (wdp[w] || wdp[w-a]);
    if(w >= b) wdp[w] = (wdp[w] || wdp[w-b]);
  }
  vector<int64_t> poswater,possugar;
  rep(i,3001){
    if(sdp[i])possugar.push_back(i);
  }
  rep(i,31){
    if(wdp[i])poswater.push_back(i);
  }
  double maxdense = 0.0;
  int64_t maxwater = 0,maxsugar = 0;
  rep(i,poswater.size()){
    rep(j,possugar.size()){
      if(poswater[i]*100 + possugar[j] <= f && e*poswater[i] >= possugar[j]){
        if(maxdense <= 100.0*possugar[j]/(1.0*possugar[j]+100.0*poswater[i])){
          maxdense = 100.0*possugar[j]/(1.0*possugar[j]+100.0*poswater[i]);
          maxsugar = possugar[j];
          maxwater = poswater[i]*100;
        }
      }
    }
  }
  printf("%ld %ld",maxsugar+maxwater,maxsugar);
  
  
    
    
  
}

Measured memory_bytes: 256