using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{

    public void Proc()
    {
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
        this.AddWater1 = inpt[0] * 100;
        this.AddWater2 = inpt[1] * 100;
        this.AddSugar1 = inpt[2];
        this.AddSugar2 = inpt[3];
        this.MaxTokeru = inpt[4];
        this.MaxTotal = inpt[5];
        SugarWater sw = GetAns(0, 0);
        Console.WriteLine((sw.Water + sw.Sugar) + " " + sw.Sugar);
    }

    private Dictionary<int, Dictionary<int, SugarWater>> dic = new Dictionary<int, Dictionary<int, SugarWater>>();
    private SugarWater GetAns(int sugar, int water) {
        if(sugar+water>this.MaxTotal) {
            return new SugarWater(0, 0);
        }
        int maxSugar = (water / 100) * this.MaxTokeru;
        if(sugar>maxSugar) {
            return new SugarWater(0, 0);
        }
        if (!dic.ContainsKey(sugar))
        {
            dic.Add(sugar, new Dictionary<int, SugarWater>());
        }
        if (dic[sugar].ContainsKey(water))
        {
            return dic[sugar][water];
        }
        SugarWater ans = new SugarWater(sugar, water);
        SugarWater ret = GetAns(sugar + AddSugar1, water);
        if(ret.IsHiSugar(ans)) {
            ans = ret;
        }
        ret = GetAns(sugar + AddSugar2, water);
        if (ret.IsHiSugar(ans))
        {
            ans = ret;
        }
        ret = GetAns(sugar, water + AddWater1);
        if (ret.IsHiSugar(ans))
        {
            ans = ret;
        }
        ret = GetAns(sugar, water + AddWater2);
        if (ret.IsHiSugar(ans))
        {
            ans = ret;
        }
        dic[sugar][water] = ans;
        return ans;
    }


    private struct SugarWater {
        public int Sugar;
        public int Water;
        public SugarWater(int s, int w) {
            this.Sugar = s;
            this.Water = w;
        }
        public bool IsHiSugar(SugarWater target) {
            int FixSugar1 = this.Sugar * target.Water;
            int FixSugar2 = target.Sugar * this.Water;
            if(FixSugar1==FixSugar2) {
                return this.Water >= target.Water;
            }
            return FixSugar1 > FixSugar2;
        }

        public int Total {
            get {
                return this.Sugar + this.Water;
            }
        }
    }

    private int AddWater1;
    private int AddWater2;
    private int AddSugar1;
    private int AddSugar2;
    private int MaxTokeru;
    private int MaxTotal;



    public class Reader
    {
        private static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (sr == null)
                {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"


17 19 22 26 55 2802


";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
    }
}


Measured memory_bytes: 13408