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

int main() {
  
  int A,B,C,D,E,F;
  cin >> A >> B >> C >> D >> E >> F;

  int water = 0,suger = 0;
  double con = 0;

  for(int i = 0;100*A*i <= F;i++) {
    for(int j = 0;100*B*j <= F;j++) {
      int w = 100*(A*i+B*j);
      if(w > F) break;
      for(int k = 0;k*C <= F;k++) {
        for(int l = 0;l*D <= F;l++) {
          int s = k*C+l*D;
          if(w/100*E < s || s+w > F) break;
          if(s+w == 0) continue;
          double c = 100*s/ (double)(s+w);
          if(c >= con) {
            con = c;
            suger = s;
            water = w;
          }
        }
      }
    }
  }

  cout << suger + water << " " << suger << endl;
  
}