module.exports=function(r){var e={};function t(n){if(e[n])return e[n].exports;var u=e[n]={i:n,l:!1,exports:{}};return r[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}return t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},t.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,e){if(1&e&&(r=t(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var u in r)t.d(n,u,function(e){return r[e]}.bind(null,u));return n},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},t.p="",t(t.s=0)}([function(r,e,t){t(1)(t(2).readFileSync("/dev/stdin","UTF-8"))},function(r,e){function t(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=[],n=!0,u=!1,a=void 0;try{for(var o,i=r[Symbol.iterator]();!(n=(o=i.next()).done)&&(t.push(o.value),!e||t.length!==e);n=!0);}catch(r){u=!0,a=r}finally{try{n||null==i.return||i.return()}finally{if(u)throw a}}return t}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r.exports=function(r){for(var e=t(r.split("\n")[0].split(" ").map(function(r){return Number(r)}),6),n=e[0],u=e[1],a=e[2],o=e[3],i=e[4],s=e[5],f={},l={water:0,sugar:0,pp:0},c=[{water:0,sugar:0}];c.length>0;){1;var p=c.shift(),g=p.water+p.sugar,d=`${p.water}-${p.sugar}`;if(!(g>s||1==f[d])){f[d]=1;var y=100*p.sugar/g;y>l.pp&&100*p.sugar<=p.water*i&&(l.pp=y,l.water=p.water,l.sugar=p.sugar),c.push({water:p.water+100*n,sugar:p.sugar}),c.push({water:p.water+100*u,sugar:p.sugar}),c.push({water:p.water,sugar:p.sugar+a}),c.push({water:p.water,sugar:p.sugar+o})}}console.log(`${l.water+l.sugar} ${l.sugar}`)}},function(r,e){r.exports=require("fs")}]);