import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto rd = readln.split.to!(int[]);
  auto a = rd[0], b = rd[1], c = rd[2], d = rd[3], e = rd[4], f = rd[5];

  auto ansW = 0, ansS = 0, ansK = real(0);

  foreach (i; 0..f/a+1)
    foreach (j; 0..f/b+1) {
      auto w = i*a + j*b;
      if (w*100 > f) continue;
      auto s = w*e;
      foreach (k; 0..s/c+1)
        foreach (l; 0..s/d+1) {
          auto t = k*c + l*d;
          if (t > s || t+w*100 > f) continue;
          auto m = t.to!real / (t+w*100);
          if (m >= ansK) {
            ansW = w;
            ansS = t;
            ansK = m;
          }
        }
    }

  writeln(ansW*100+ansS, " ", ansS);
}
