#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 2000000000
//#define int long long int

#ifdef LOCAL
  #define eprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define eprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

int wa;
int wb;
int sc;
int sd;
int gper100;
int beaker;

vector<pair<int, int>> vp;
map<pair<int, int>, int> visited;
vector<vector<int>> routed;

double percentage(int water, int suger) {
  return (double)100 * suger / (double)(water + suger);
}

void dfs(int op, int water, int suger, int beaker) {
  /*
  if(!(water == 0 && suger == 0)) {
    if(visited[pair<int,int>(water,suger)] > 0) {
      eprintf("visited: %d %d\n", water, suger);
      return;
    }
  }
  */
  int water2 = water;
  int suger2 = suger;
  switch(op) {
    case 1:
      water2 += wa * 100;
      break;
    case 2:
      water2 += wb * 100;
      break;
    case 3:
      suger2 += sc;
      break;
    case 4:
      suger2 += sd;
      break;
  }
  eprintf("dfs: op:%d, beaker:%d, w:%d, s:%d\n", op, beaker, water2, suger2);
  // ビーカーを超えるかE濃度を超えたら終わり
  // もしくは既に見てる
  /*
  auto iter = find(ALL(vp), pair<int,int>(water2,suger2));
  if(iter != vp.end()) {
     return; 
  }
  */
  if(water2 + suger2 == beaker) {
    visited[pair<int,int>(water2,suger2)]++;
    vp.push_back(pair<int, int>(water2, suger2));
    eprintf("---breaker full---\n");
  }
  if(water2 + suger2 >= beaker) {
    visited[pair<int,int>(water2,suger2)]++;
    vp.push_back(pair<int, int>(water, suger));
    eprintf("---breaker full---\n");
    return;
  }
  else if((double)percentage(100, gper100) < (double)percentage(water2, suger2)) {
    visited[pair<int,int>(water2,suger2)]++;
    vp.push_back(pair<int, int>(water, suger));
    eprintf("---percentage exceed: %8f---\n", percentage(water, suger));
    return;
  }
  else {
    visited[pair<int,int>(water,suger)]++;
    if(visited[pair<int,int>(water2 ,suger2)] == 0) {
      //if(water2 + wa*100 + suger2 <= beaker) {
        dfs(1, water2, suger2, beaker);
      //}
      //if(water2 + wb*100 + suger2 <= beaker)
        dfs(2, water2, suger2, beaker);
      //if(water2 + suger2 + sc <= beaker)
        dfs(3, water2, suger2, beaker);
      //if(water2 + suger2 + sd <= beaker)
        dfs(4, water2, suger2, beaker);
    }
  }
}

int main() {
  //int w100a, w100b, sc, sd, gper100, beaker;
  cin >> wa >> wb >> sc >> sd >> gper100 >> beaker;
  dfs(1, 0, 0, beaker);
  dfs(2, 0, 0, beaker);
  dfs(3, 0, 0, beaker);
  dfs(4, 0, 0, beaker);


  pair<int, int> ans;
  double maxpct = percentage(100, gper100);
  double mindiff = INF;
  double diff;
  double pct;
  for(auto p : vp) {
    eprintf("w:%d, s:%d\n", p.first + p.second, p.second);
    if(p.first == 0 && p.second == 0) {
      continue;
    }
    pct = percentage(p.first, p.second);
    eprintf("%d %d maxpct:%8f, pct:%8f\n", p.first + p.second, p.second, maxpct, pct);
    diff = maxpct - pct;
    if(mindiff > diff) {
      mindiff = diff;
      ans = p;
    }
  }
  eprintf("-------------\n");
  printf("%d %d", ans.first+ans.second, ans.second);

  return 0;
}


Measured memory_bytes: 1280