#define TEST_MODE true
 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i)
#define range(i, a, b, c) for (int i = a;		\
                               c > 0 ? i < b : i > b;	\
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long
 
#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x)
#define dump_l(x) dump(x) << endl
#else
const bool test = false;
#define dump(x)
#define dump_l(x)
#endif
 
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }
 
//.....................
const int MAX = (int)2e5 + 5;
 
vector<string> split(const string &str, char sep)
{
  vector<string> v;
  stringstream ss(str);
  string buffer;
  while (getline(ss, buffer, sep))
    {
      v.push_back(buffer);
    }
  return v;
}

string reverse_str(string input) {
  string res = input;
  reverse(all(res));
  return res;
}
 
template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
  return accumulate(begin, end, 0ll);
}

int H = 20, W = 30;

bool ng(int y, int x) {
  return y < 0 || H <= y || x < 0 || W <= x;
}

void solve();

class A {
public:
  int water = 0;
  int sugar = 0;

  A() {};

  A(int water, int sugar) : water(water), sugar(sugar) {};

  double v() {
    if (water == 0 && sugar == 0) return -1;
    return (double)sugar / (water + sugar);
  }

  void print() {
    cout << water + sugar << " " << sugar << endl;
  }
};

class Solver {
public:
  int water[2];
  int sugar[2];
  int E, F;	

  A ans() {    
    bool water_exists[3005] = {};
    bool sugar_exists[3005] = {};
    water_exists[0] = true;
    sugar_exists[0] = true;
    rep(i, 3005) {
      rep(j, 2) {
	int next_water = i + water[j] * 100;
	int next_sugar = i + sugar[j];
	if (water_exists[i] && next_water < 3005) {
	  water_exists[next_water] = true;
	}
	if (sugar_exists[i] && next_sugar < 3005) {
	  sugar_exists[next_sugar] = true;
	}
      }
    }
    A ans;
    rep(i, 3005) {
      if (water_exists[i] == false) continue;
      rep(j, 3005) {
	if (sugar_exists[j] == false) continue;
	if (j * 100 > i * E) break;
	if (i + j > F) break;
	A cur(i, j);
	if (cur.v() > ans.v()) {
	  ans = cur;
	}
      }
    }
    return ans;
  }

  void solve() {
    rep(i, 2) cin >> water[i];
    rep(i, 2) cin >> sugar[i];    
    cin >> E >> F;
    A ans_v = ans();
    ans_v.print();
  }
};
 
signed main()
{
  cout << fixed << setprecision(20);
  auto ptr = new Solver();
  ptr->solve();
  delete ptr;
  // while (true) {
  //   auto ptr = new Solver();
  //   ptr->solve();
  //   delete ptr;
  // }
  return 0;
}
 
// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;
 
// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;
 
// #define cin mycin
// #define cout mycout
// #define endl '\n'
 


Measured memory_bytes: 256