#include <bits/stdc++.h>
using namespace std;

int main(){
  int a,b,c,d,e,f,s=0,w=100;cin>>a>>b>>c>>d>>e>>f;
  for(int i=0;100*i*a<=f;i++){
    for(int j=0;100*(i*a+j*b)<=f;j++){
      for(int k=0;100*(i*a+j*b)+k*c<=f;k++){
        for(int l=0;100*(i*a+j*b)+k*c+l*d<=f;l++){
          if(i||j){
            int wa=100*(i*a+j*b),su=k*c+l*d;
            if(su*(100+e)<=e*(wa+su)&&s*(wa+su)<=su*(w+s)){
              w=wa;
              s=su;
            }
          }
        }
      }
    }
  }
  cout<<w+s<<" "<<s<<endl;
}