void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  long A, B, C, D, E, F; rd(A, B, C, D, E, F);

  A*=100; B*=100;
  long tot=A, su=0;
  for(long a=0; a<=F; a+=A)for(long b=0; a+b<=F; b+=B){
    for(long c=0; a+b+c<=F; c+=C){
      if(c*100>(a+b)*E) continue;
      for(long d=0; a+b+c+d<=F; d+=D){
        if((c+d)*100>(a+b)*E) continue;
        long wa_=a+b, su_=c+d, to_=wa_+su_;
        if(su*to_<tot*su_){
          tot=to_;
          su=su_;
        }
      }
    }
  }

  writeln(tot, " ", su);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x) e=l[i].to!(typeof(e));
}