#include<bits/stdc++.h>
using namespace std;
double a,b,c,d,e,x,y,n[2];
int maxx=-1,pos;
int main()
{
cin>>a>>b>>c>>d>>e>>x>>y;
n[0]=a*x*1.0+b*1.0*y;
n[1]=c*y*1.0;
n[2]=d*y*1.0+e;
for(int i=0;i<=2;i++)
{
if(n[i]>maxx)
{
maxx=n[i];
pos=i+1;
}
}
cout<<pos<<" ";
cout<<fixed<<setprecision(2)<<n[pos-1];
return 0;
}