#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const long long INF = 100000000;
const long long MOD = 1000000007;
int a, b, c, d, e, f;
bool ok[31];
bool dp[3001];
int main() {
  cin >> a >> b >> c >> d >> e >> f;
  ok[0] = true;
  for (int i = 1; i <= 30; i++) {
    if (i - a >= 0) {
      ok[i] |= ok[i - a];
    }
    if (i - b >= 0) {
      ok[i] |= ok[i - b];
    }
  }
  double ans = 0.0;
  int ret1 = 100 * a, ret2 = 0;
  for (int i = 1; i <= 30; i++) {
    if (!ok[i]) continue;
    memset(dp, sizeof(dp), false);
    dp[0] = true;
    for (int j = 1; j <= i * e; j++) {
      if (i * 100 + j > f) break;
      if (j - c >= 0) {
        dp[j] |= dp[j - c];
      }
      if (j - d >= 0) {
        dp[j] |= dp[j - d];
      }
    }
    for (int j = i * e; j >= 0; j--) {
      if (dp[j]) {
        if (ans < (double)j / (double)(i * 100 + j)) {
          ans = (double)j / (double)(i * 100 + j);
          ret1 = i * 100 + j;
          ret2 = j;
        }
      }
    }
  }
  cout << ret1 << " " << ret2 << endl;
}
