import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.format;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int a, b, c, d, e, f;
double max_noudo = 0;
int ans_suwar = 0;
int ans_sugar = 0;

bool[][] done;
void search(int water = 0, int sugar = 0)
{
  // stderr.writeln(water, " ", sugar, " : ", water * 100 + sugar, " ", f);
  // verify
  if (water * 100 + sugar > f) {
    return;
  }
  if (done[water][sugar]) {
    return;
  }
  if (water * e < sugar) {
    return;
  }
  double noudo = cast(double)(100 * sugar) / (water * 100 + sugar);
  if (noudo > max_noudo) {
    max_noudo = noudo;
    ans_suwar = 100 * water + sugar;
    ans_sugar = sugar;
  }

  // input sugar
  search(water, sugar + c);
  search(water, sugar + d);
  // input water
  search(water + a, sugar);
  search(water + b, sugar);

  done[water][sugar] = true;
}

void main()
{
  auto input = readln.chomp.split.map!(to!int);
  a = input[0];
  b = input[1];
  c = input[2];
  d = input[3];
  e = input[4];
  f = input[5];
  ans_suwar = 100 * a;
  done = new bool[][](f / 100 + 1, f + 1);
  search();
  writeln(ans_suwar, " ", ans_sugar);
}
