#include<bits/stdc++.h>
using namespace std;
int main() {
int n,k,l,c,d,p,nl,np;
cin>>n>>k>>l>>c>>d>>p>>nl>>np;
int Yin=k*l/nl;
int Ning=c*d;
int Yan=p/np;
int a1=min(Yin,Ning);
int a2=min(a1,Yan);
cout<<a2/n<<endl;
}
#include<bits/stdc++.h>
using namespace std;
struct who{
string Name;
int count1;
};
int main() {
int n;
cin>>n;
who Pizz[100],Girl[100],Tax[100];
Pizz[0].count1=-1;
Girl[0].count1=-1;
Tax[0].count1=-1;
int pp=0;
int gg=0;
int tt=0;
for(int i=0;i<n;i++){
int t;
string name;
cin>>t>>name;
int numPizz=0,numGirl=0,numTax=0;
while(t--){
string phone1,phone="";
cin>>phone1;
int p=0,g=0,T=0;
int r=phone1.size();
for(int i=0;i<r;i++){
if(phone1[i]=='-')continue;
else phone+=phone1[i];
}
for(int i=0;i<phone.size();i++){
if(i>0){
if(phone[i]==phone[i-1])
T++;
else if(phone[i]<phone[i-1])
p++;
else g++;
}
}
if(T==5)numTax++;
else if(g==5)numGirl++;
else if(p==5)numPizz++;
else numGirl++;
}
//cout<<"Tax="<<numTax<<"Girl="<<numGirl<<"Pizz="<<numPizz<<endl;
if(numTax>Tax[0].count1){
Tax[0].Name=name,Tax[0].count1=numTax,tt=0;
}
else if(numTax==Tax[0].count1){
Tax[++tt].Name=name,Tax[tt].count1=numTax;
}
if(numGirl>Girl[0].count1)
{
Girl[0].count1=numGirl,Girl[0].Name=name,gg=0;
}
else if(numGirl==Girl[0].count1)
{
Girl[++gg].count1=numGirl,Girl[gg].Name=name;
}
if(numPizz>Pizz[0].count1)
{
Pizz[0].count1=numPizz,Pizz[0].Name=name,pp=0;
}
else if(numPizz==Pizz[0].count1)
{
Pizz[++pp].count1=numPizz,Pizz[pp].Name=name;
}
//cout<<pp<<tt<<gg<<endl;
// cout<<"------------------------"<<endl;
// if(gg==0)cout<<Girl[0].Name<<endl;
//else{
// int v;
// for(int v=0;v<gg-1;v++){
// cout<<Girl[v].Name<<", ";
// }
// cout<<Girl[v].Name<<endl;
//}
//
//cout<<"---------------------------------------"<<endl;
//if(pp==0)cout<<Pizz[0].Name<<endl;
//else{
// int v;
// for(int v=0;v<pp-1;v++){
// cout<<Pizz[v].Name<<", ";
// }
// cout<<Pizz[v].Name<<endl;;
//}
//cout<<"-----------------------------------"<<endl;
// if(tt==0)cout<<Tax[0].Name<<endl;
//else{
// int v;
// for(int v=0;v<tt-1;v++){
// cout<<Tax[v].Name<<", ";
// }
// cout<<Tax[v].Name<<endl;
//}
}
int v;
cout<<"If you want to call a taxi, you should call: ";
for(v=0;v<tt;v++){
cout<<Tax[v].Name<<", ";
}
cout<<Tax[v].Name<<"."<<endl;
cout<<"If you want to order a pizza, you should call: ";
for(v=0;v<pp;v++){
cout<<Pizz[v].Name<<", ";
}
cout<<Pizz[v].Name<<"."<<endl;;
cout<<"If you want to go to a cafe with a wonderful girl, you should call: ";
for(v=0;v<gg;v++){
cout<<Girl[v].Name<<", ";
}
cout<<Girl[v].Name<<"."<<endl;
}