import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}

void main()
{
  int a, b, c, d, e, f; readV(a, b, c, d, e, f);

  auto nu = 0, de = 1;
  foreach (o1; 0..f/100/a+1)
    foreach (o2; 0..(f/100-o1*a)/b+1) {
      auto w = (o1*a+o2*b)*100, s = min(f-w, w/100*e);
      foreach (o3; 0..s/c+1) {
        auto o4 = (s-o3*c)/d;
        auto t = o3*c+o4*d;

        if (nu*(w+t) < de*t) {
          nu = t;
          de = w+t;
        }
      }
    }

  if (de == 0)
    writeln(a*100, " ", 0);
  else
    writeln(de, " ", nu);
}
