#

# Written by NoKnowledgeGG @YlePhan

# ('ω')

#

#import math

#mod = 10**9+7

#import itertools

#import fractions

#import numpy as np

#mod = 10**4 + 7

"""def kiri(n,m):

  r_ = n / m

  if (r_ - (n // m)) > 0:

    return (n//m) + 1

  else:

    return (n//m)"""



""" n! mod m 階乗

mod = 1e9 + 7

N = 10000000

fac = [0] * N

def ini():

  fac[0] = 1 % mod

  for i in range(1,N):

    fac[i] = fac[i-1] * i % mod"""



"""mod = 1e9+7

N = 10000000

pw = [0] * N

def ini(c):

  pw[0] = 1 % mod

  for i in range(1,N):

    pw[i] = pw[i-1] * c % mod"""



"""

def YEILD():

  yield 'one'

  yield 'two'

  yield 'three'

generator = YEILD()

print(next(generator))

print(next(generator))

print(next(generator))

"""

"""def gcd_(a,b):

  if b == 0:#結局はc,0の最大公約数はcなのに

    return a

  return gcd_(a,a % b) # a = p * b + q"""

"""def extgcd(a,b,x,y):

  d = a

  if b!=0:

    d = extgcd(b,a%b,y,x)

    y -= (a//b) * x

    print(x,y)

  else:

    x = 1

    y = 0

  return d"""

# 最大公約数 と 最小公倍数

"""def gcd(a,b):

  if b == 0:

    return a

  return gcd(b, a % b)

def lcm(a,b):

  g = gcd(a,b)

  return (a * b) // g"""



def readInts():

  return list(map(int,input().split()))

mod = 10**9 + 7



def main():

  A,B,C,D,E,F = readInts()

  dic = {}

  for a in range(31):# 30まで

    for b in range(31): # 30まで

      for c in range(101): # 100まで

        for d in range(101):

          w = (100*A)*a + (100 * B ) *b

          s = C * c + D * d

          if w == 0:

            break

          if w + s > F:

            break

          else:

            if w/100 * E >= s:

              mitudo = 100 * s / (w + s)

              dic[a,b,c,d] = mitudo

  maxV = max(dic.values())

  for k,v in list(dic.items()):

    if v == maxV:

      print(((100*A)*k[0] + (100*B)*k[1] + C*k[2] + D*k[3],C*k[2] + D*k[3]))

      exit()

if __name__ == '__main__':

  main()
#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

#from itertools import combinations # (string,3) 3回

#from collections import deque

#import collections.defaultdict(list)

#import bisect

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



mod = 10**9 + 7



def readInts():

  return list(map(int,input().split()))

def main():

    a,b,c,d,e,f = readInts()

    water = set()

    sugar = set()

    # water

    # A,B の制約が 1 <= A,B <= 30 だから、ループは31まで回せば位

    for i in range(31):

        for j in range(31):

            w = 100 * a * i + 100 * b * j

            if w <= f: # 水の合計が F より大きくなってはいけない (砂糖0gの時もあるが、)

            # -1g とかはないので

                water.add(w)

    # sugar

    # C,D の制約が、 1 <= C,D <= 3000 であるから、 3001 までまわせばい

    for i in range(3001):

        for j in range(3001):

            s = c * i  + d * j

            if s <= f: # 砂糖の合計が F より大きくなってはいけない

            # 水 0 g はあっても、-1gとかはないから

                sugar.add(s)

    # 濃度の限界値を決める

    nl = e/(100 + e) # *100 すれば、限界の濃度のパーセント

    noudo = -1

    ans1 = 0

    ans2 = 0

    for s in sugar:

        for w in water:

            # 砂糖水をつくる

            sum = s + w

            if sum == 0:# 和が0はだめー てか1 <= だから 1からループ回せばええやんけ

                continue

            x = s/sum # suger / 砂糖水 * 100 すれば%やで

            if sum <= f and x <= nl and x > noudo:

                # 砂糖水は fg以下 , 砂糖水の濃度は限界以下 , 濃度が最大になるまで回せ

                noudo = x

                ans1 = sum

                ans2 = s

    print((ans1,ans2))

if __name__ == '__main__':

  main()

#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
# import math
# mod = 10**9+7
# import itertools
# import fractions
# import numpy as np
# mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""
"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""
"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:#結局はc,0の最大公約数はcなのに
    return a
  return gcd_(a,a % b) # a = p * b + q"""
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""
# 最大公約数 と 最小公倍数
"""def gcd(a,b):
  if b == 0:
    return a
  return gcd(b, a % b)
def lcm(a,b):
  g = gcd(a,b)
  return (a * b) // g"""


def readInts():
    return list(map(int, input().split()))


mod = 10**9 + 7


def main():
    A, B, C, D, E, F = readInts()
    dic = {}
    for a in range(31):  # 30まで
        for b in range(31):  # 30まで
            for c in range(101):  # 100まで
                for d in range(101):
                    w = (100 * A) * a + (100 * B) * b
                    s = C * c + D * d
                    if w == 0:
                        break
                    if w + s > F:
                        break
                    else:
                        if w / 100 * E >= s:
                            mitudo = 100 * s / (w + s)
                            dic[a, b, c, d] = mitudo
    maxV = max(dic.values())
    for k, v in list(dic.items()):
        if v == maxV:
            print(
                (
                    (100 * A) * k[0] + (100 * B) * k[1] + C * k[2] + D * k[3],
                    C * k[2] + D * k[3],
                )
            )
            exit()


if __name__ == "__main__":
    main()

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
# from itertools import combinations # (string,3) 3回
# from collections import deque
# import collections.defaultdict(list)
# import bisect
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
mod = 10**9 + 7


def readInts():
    return list(map(int, input().split()))


def main():
    a, b, c, d, e, f = readInts()
    water = set()
    sugar = set()
    # water
    # A,B の制約が 1 <= A,B <= 30 だから、ループは31まで回せば位
    for i in range(31):
        for j in range(31):
            w = 100 * a * i + 100 * b * j
            if w <= f:  # 水の合計が F より大きくなってはいけない (砂糖0gの時もあるが、)
                # -1g とかはないので
                water.add(w)
    # sugar
    # C,D の制約が、 1 <= C,D <= 3000 であるから、 3001 までまわせばい
    for i in range(3001):
        for j in range(3001):
            s = c * i + d * j
            if s <= f:  # 砂糖の合計が F より大きくなってはいけない
                # 水 0 g はあっても、-1gとかはないから
                sugar.add(s)
    # 濃度の限界値を決める
    nl = e / (100 + e)  # *100 すれば、限界の濃度のパーセント
    noudo = -1
    ans1 = 0
    ans2 = 0
    for s in sugar:
        for w in water:
            # 砂糖水をつくる
            sum = s + w
            if sum == 0:  # 和が0はだめー てか1 <= だから 1からループ回せばええやんけ
                continue
            x = s / sum  # suger / 砂糖水 * 100 すれば%やで
            if sum <= f and x <= nl and x > noudo:
                # 砂糖水は fg以下 , 砂糖水の濃度は限界以下 , 濃度が最大になるまで回せ
                noudo = x
                ans1 = sum
                ans2 = s
    print((ans1, ans2))


if __name__ == "__main__":
    main()

+# from statistics import median +# import collections +# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] +# from itertools import combinations # (string,3) 3回 +# from collections import deque +# import collections.defaultdict(list) +# import bisect -# Written by NoKnowledgeGG @YlePhan -# ('ω') -# import math -# mod = 10**9+7 -# import itertools -# import fractions -# import numpy as np -# mod = 10**4 + 7 -"""def kiri(n,m): -  r_ = n / m -  if (r_ - (n // m)) > 0: -    return (n//m) + 1 -  else: -    return (n//m)""" -""" n! mod m 階乗 -mod = 1e9 + 7 -N = 10000000 -fac = [0] * N -def ini(): -  fac[0] = 1 % mod -  for i in range(1,N): -    fac[i] = fac[i-1] * i % mod""" -"""mod = 1e9+7 -N = 10000000 -pw = [0] * N -def ini(c): -  pw[0] = 1 % mod -  for i in range(1,N): -    pw[i] = pw[i-1] * c % mod""" -""" -def YEILD(): -  yield 'one' -  yield 'two' -  yield 'three' -generator = YEILD() -print(next(generator)) -print(next(generator)) -print(next(generator)) -""" -"""def gcd_(a,b): -  if b == 0:#結局はc,0の最大公約数はcなのに -    return a -  return gcd_(a,a % b) # a = p * b + q""" -"""def extgcd(a,b,x,y): -  d = a -  if b!=0: -    d = extgcd(b,a%b,y,x) -    y -= (a//b) * x -    print(x,y) -  else: -    x = 1 -    y = 0 -  return d""" -# 最大公約数 と 最小公倍数 -"""def gcd(a,b): -  if b == 0: -    return a -  return gcd(b, a % b) -def lcm(a,b): -  g = gcd(a,b) -  return (a * b) // g""" +# pythonで無理なときは、pypyでやると正解するかも！！ +# +# +mod = 10**9 + 7 -mod = 10**9 + 7 - - -    A, B, C, D, E, F = readInts() -    dic = {} -    for a in range(31):  # 30まで -        for b in range(31):  # 30まで -            for c in range(101):  # 100まで -                for d in range(101): -                    w = (100 * A) * a + (100 * B) * b -                    s = C * c + D * d -                    if w == 0: -                        break -                    if w + s > F: -                        break -                    else: -                        if w / 100 * E >= s: -                            mitudo = 100 * s / (w + s) -                            dic[a, b, c, d] = mitudo -    maxV = max(dic.values()) -    for k, v in list(dic.items()): -        if v == maxV: -            print( -                ( -                    (100 * A) * k[0] + (100 * B) * k[1] + C * k[2] + D * k[3], -                    C * k[2] + D * k[3], -                ) -            ) -            exit() +    a, b, c, d, e, f = readInts() +    water = set() +    sugar = set() +    # water +    # A,B の制約が 1 <= A,B <= 30 だから、ループは31まで回せば位 +    for i in range(31): +        for j in range(31): +            w = 100 * a * i + 100 * b * j +            if w <= f:  # 水の合計が F より大きくなってはいけない (砂糖0gの時もあるが、) +                # -1g とかはないので +                water.add(w) +    # sugar +    # C,D の制約が、 1 <= C,D <= 3000 であるから、 3001 までまわせばい +    for i in range(3001): +        for j in range(3001): +            s = c * i + d * j +            if s <= f:  # 砂糖の合計が F より大きくなってはいけない +                # 水 0 g はあっても、-1gとかはないから +                sugar.add(s) +    # 濃度の限界値を決める +    nl = e / (100 + e)  # *100 すれば、限界の濃度のパーセント +    noudo = -1 +    ans1 = 0 +    ans2 = 0 +    for s in sugar: +        for w in water: +            # 砂糖水をつくる +            sum = s + w +            if sum == 0:  # 和が0はだめー てか1 <= だから 1からループ回せばええやんけ +                continue +            x = s / sum  # suger / 砂糖水 * 100 すれば%やで +            if sum <= f and x <= nl and x > noudo: +                # 砂糖水は fg以下 , 砂糖水の濃度は限界以下 , 濃度が最大になるまで回せ +                noudo = x +                ans1 = sum +                ans2 = s +    print((ans1, ans2))