/*input

*/
#include<bits/stdc++.h>
#define ll        	long long
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define pb          push_back
#define mp          make_pair
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)  for(ll int i=a;i<b;i++)
#define rrep(i,a,b) for(ll int i=a;i>=b;i--)
#define all(a)      (a).begin(),(a).end()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define tr(cont, i) for(auto i=cont.begin();i!=cont.end();i++)
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl "\n"
#define trace(x)                 cout << #x << ": " << x << endl;
#define trace1(x)                cout << #x << ": " << x << endl;
#define trace2(x, y)             cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cout << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
using namespace std;

int main(){
	ll n,k,x,y;
	cin>>n>>k;
	vi l,r;
	rep(i,0,n){
		cin>>x>>y;
		l.pb(x),r.pb(y);
	}
	sort(all(l));
	sort(all(r));
	vector<pii> ans,sol;
	set<ll> start,last;
	rep(i,k-1,n){
		if(l[i]<r[i-k+1]){
			ans.pb({l[i],r[i-k+1]});
			start.insert(l[i]),last.insert(r[i-k+1]);
		}
	}
	if(sz(ans)>0)
		x=ans[0].F,y=ans[0].S;
	rep(i,1,sz(ans)){
		if(ans[i].F>y){
			sol.pb({x,y});
			x=ans[i].F;
			y=ans[i].S;
		}
		else{
			y=ans[i].S;
		}
	}
	if(sz(ans)>0)
		sol.pb({x,y});
	cout<<sz(sol)<<endl;
	for(auto i:sol){
		cout<<i.F<<" "<<i.S<<endl;
	}
	return 0;
}


/*input

*/
#include<bits/stdc++.h>
#define ll        	long long
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define pb          emplace_back
#define mp          make_pair
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)  for(ll int i=a;i<b;i++)
#define rrep(i,a,b) for(ll int i=a;i>=b;i--)
#define all(a)      (a).begin(),(a).end()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define tr(cont, i) for(auto i=cont.begin();i!=cont.end();i++)
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl "\n"
#define trace(x)                 cout << #x << ": " << x << endl;
#define trace1(x)                cout << #x << ": " << x << endl;
#define trace2(x, y)             cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cout << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
using namespace std;

int main(){
	ll n,k,x,y;
	cin>>n>>k;
	vi l,r;
	rep(i,0,n){
		cin>>x>>y;
		l.pb(x),r.pb(y);
	}
	sort(all(l));
	sort(all(r));
	vector<pii> ans,sol;
	rep(i,k-1,n){
		if(l[i]<=r[i-k+1]){
			ans.pb(mp(l[i],r[i-k+1]));
		}
	}
	if(sz(ans)>0)
		x=ans[0].F,y=ans[0].S;
	rep(i,1,sz(ans)){
		if(ans[i].F>y){
			sol.pb(mp(x,y));
			x=ans[i].F;
			y=ans[i].S;
		}
		else{
			y=ans[i].S;
		}
	}
	if(sz(ans)>0)
		sol.pb(mp(x,y));
	cout<<sz(sol)<<endl;
	for(auto i:sol){
		cout<<i.F<<" "<<i.S<<endl;
	}
	return 0;
}


/*input

*/
#include<bits/stdc++.h>
#define ll        	long long
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define pb          emplace_back
#define mp          make_pair
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)  for(ll int i=a;i<b;i++)
#define rrep(i,a,b) for(ll int i=a;i>=b;i--)
#define all(a)      (a).begin(),(a).end()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define tr(cont, i) for(auto i=cont.begin();i!=cont.end();i++)
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl "\n"
#define trace(x)                 cout << #x << ": " << x << endl;
#define trace1(x)                cout << #x << ": " << x << endl;
#define trace2(x, y)             cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cout << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
using namespace std;

int main(){
	ios;
	ll n,k,x,y;
	cin>>n>>k;
	vi l,r;
	rep(i,0,n){
		cin>>x>>y;
		l.pb(x),r.pb(y);
	}
	sort(all(l));
	sort(all(r));
	vector<pii> ans,sol;
	rep(i,k-1,n){
		if(l[i]<=r[i-k+1]){
			ans.pb(mp(l[i],r[i-k+1]));
		}
	}
	if(sz(ans)>0)
		x=ans[0].F,y=ans[0].S;
	rep(i,1,sz(ans)){
		if(ans[i].F>y){
			sol.pb(mp(x,y));
			x=ans[i].F;
			y=ans[i].S;
		}
		else{
			y=ans[i].S;
		}
	}
	if(sz(ans)>0)
		sol.pb(mp(x,y));
	cout<<sz(sol)<<endl;
	for(auto i:sol){
		cout<<i.F<<" "<<i.S<<endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:1
*Problem:The Union of K-Segments
*Date:2018-7-20
*Algorithm:My Solution
*Stats:Unknown*/

bool debug=false;

int n,k;
pii seg[1000005];
vector<pair<int,bool>> p; //<pos,isLeft>
template<typename T1,typename T2> ostream& operator<<(ostream& o,pair<T1,T2> p){
	o<<"{";
	o<<p.first<<","<<p.second;
	o<<"}";
	return o;
}
template<typename T> ostream& operator<<(ostream& o,vector<T> vec){
	o<<"{";
	for(int i=0;i<vec.size();i++){
		o<<vec[i]<<" ";
	}
	o<<"}";
	return o;
}

int main(int argc,char* argv[]){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d%d",&seg[i].first,&seg[i].second);
		p.push_back(make_pair(seg[i].first,true));
		p.push_back(make_pair(seg[i].second,false));
	}
	sort(p.begin(),p.end());

	vector<pii> lines;
	int inLine=0;
	for(int i=0;i<p.size();i++){
		if(p[i].second==false){
			//Right side
			if(inLine==k){
				lines.back().second=p[i].first;
			}
			inLine--;
		}else{
			//Left side
			inLine++;
			if(inLine==k){
				lines.push_back(make_pair(p[i].first,-1));
			}
		}
	}

	sort(lines.begin(),lines.end());
	//cout<<lines<<endl;

	for(int i=0;i<lines.size()-1;i++){
		if(lines[i+1].first==lines[i].second){
			lines[i]=make_pair(lines[i].first,lines[i+1].second);
			lines.erase(lines.begin()+i+1);
			i--;
		}
	}

	cout<<lines.size()<<endl;
	for(int i=0;i<lines.size();i++){
		cout<<lines[i].first<<" "<<lines[i].second<<endl;
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:1
*Problem:The Union of K-Segments
*Date:2018-7-20
*Algorithm:My Solution
*Stats:Unknown*/

bool debug=false;

int n,k;
pii seg[1000005];
vector<pair<int,bool>> p; //<pos,isRight>
template<typename T1,typename T2> ostream& operator<<(ostream& o,pair<T1,T2> p){
	o<<"{";
	o<<p.first<<","<<p.second;
	o<<"}";
	return o;
}
template<typename T> ostream& operator<<(ostream& o,vector<T> vec){
	o<<"{";
	for(int i=0;i<vec.size();i++){
		o<<vec[i]<<" ";
	}
	o<<"}";
	return o;
}

int main(int argc,char* argv[]){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d%d",&seg[i].first,&seg[i].second);
		p.push_back(make_pair(seg[i].first,false));
		p.push_back(make_pair(seg[i].second,true));
	}
	sort(p.begin(),p.end());

	if(debug)cout<<"fuck"<<p<<endl;

	vector<pii> lines;
	int inLine=0;
	for(int i=0;i<p.size();i++){
		if(debug)cout<<"Solving "<<lines<<" "<<p[i]<<" "<<inLine<<endl;

		if(p[i].second==true){
			//Right side
			if(debug)cout<<k<<endl;
			if(inLine==k){
				lines.back().second=p[i].first;
			}
			inLine--;
		}else{
			//Left side
			inLine++;
			if(inLine==k){
				lines.push_back(make_pair(p[i].first,-1));
			}
		}
	}

	sort(lines.begin(),lines.end());
	if(debug)cout<<lines<<endl;

	//cout<<"hello"<<endl;

	if(lines.size()==0){
		cout<<0;
		return 0;
	}
	for(int i=0;i<lines.size()-1;i++){
		if(lines[i+1].first==lines[i].second){
			lines[i]=make_pair(lines[i].first,lines[i+1].second);
			lines.erase(lines.begin()+i+1);
			i--;
		}
	}

	cout<<lines.size()<<endl;
	for(int i=0;i<lines.size();i++){
		cout<<lines[i].first<<" "<<lines[i].second<<endl;
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:1
*Problem:The Union of K-Segments
*Date:2018-7-20
*Algorithm:My Solution
*Stats:AC-612D*/

bool debug=false;

int n,k;

vector<pair<int,bool>> p; //<pos,isRight>
template<typename T1,typename T2> ostream& operator<<(ostream& o,pair<T1,T2> p){
	o<<"{";
	o<<p.first<<","<<p.second;
	o<<"}";
	return o;
}
template<typename T> ostream& operator<<(ostream& o,vector<T> vec){
	o<<"{";
	for(int i=0;i<vec.size();i++){
		o<<vec[i]<<" ";
	}
	o<<"}";
	return o;
}

int main(int argc,char* argv[]){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		p.push_back(make_pair(a,false));
		p.push_back(make_pair(b,true));
	}
	sort(p.begin(),p.end());

	if(debug)cout<<"fuck"<<p<<endl;

	vector<pii> lines;
	int inLine=0;
	for(int i=0;i<p.size();i++){
		if(debug)cout<<"Solving "<<lines<<" "<<p[i]<<" "<<inLine<<endl;

		if(p[i].second==true){
			//Right side
			if(debug)cout<<k<<endl;
			if(inLine==k){
				lines.back().second=p[i].first;
			}
			inLine--;
		}else{
			//Left side
			inLine++;
			if(inLine==k){
				lines.push_back(make_pair(p[i].first,-1));
			}
		}
	}

	sort(lines.begin(),lines.end());
	if(debug)cout<<lines<<endl;

	//cout<<"hello"<<endl;

	if(lines.size()==0){
		cout<<0;
		return 0;
	}
	for(int i=0;i<lines.size()-1;i++){
		if(lines[i+1].first==lines[i].second){
			lines[i]=make_pair(lines[i].first,lines[i+1].second);
			lines.erase(lines.begin()+i+1);
			i--;
		}
	}

	printf("%d\n",lines.size());
	for(int i=0;i<lines.size();i++){
		printf("%d %d\n",lines[i].first,lines[i].second);
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:1
*Problem:The Union of K-Segments
*Date:2018-7-20
*Algorithm:My Solution
*Stats:Unknown*/

bool debug=false;

int n,k;
pii seg[1000005];
vector<pair<int,bool>> p; //<pos,isLeft>
template<typename T1,typename T2> ostream& operator<<(ostream& o,pair<T1,T2> p){
	o<<"{";
	o<<p.first<<","<<p.second;
	o<<"}";
	return o;
}
template<typename T> ostream& operator<<(ostream& o,vector<T> vec){
	o<<"{";
	for(int i=0;i<vec.size();i++){
		o<<vec[i]<<" ";
	}
	o<<"}";
	return o;
}

int main(int argc,char* argv[]){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d%d",&seg[i].first,&seg[i].second);
		p.push_back(make_pair(seg[i].first,true));
		p.push_back(make_pair(seg[i].second,false));
	}
	sort(p.begin(),p.end());

	vector<pii> lines;
	int inLine=0;
	for(int i=0;i<p.size();i++){
		if(p[i].second==false){
			//Right side
			if(inLine>=k){
				lines.back().second=p[i].first;
			}
			inLine--;
		}else{
			//Left side
			inLine++;
			if(inLine>=k){
				lines.push_back(make_pair(p[i].first,-1));
			}
		}
	}

	sort(lines.begin(),lines.end());
	if(debug)cout<<lines<<endl;

	for(int i=0;i<lines.size()-1;i++){
		if(lines[i+1].first==lines[i].second){
			lines[i]=make_pair(lines[i].first,lines[i+1].second);
			lines.erase(lines.begin()+i+1);
			i--;
		}
	}

	cout<<lines.size()<<endl;
	for(int i=0;i<lines.size();i++){
		cout<<lines[i].first<<" "<<lines[i].second<<endl;
	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:1
*Problem:The Union of K-Segments
*Date:2018-7-20
*Algorithm:My Solution
*Stats:Unknown*/

bool debug=false;

int n,k;
pii seg[1000005];
vector<pair<int,bool>> p; //<pos,isLeft>
template<typename T1,typename T2> ostream& operator<<(ostream& o,pair<T1,T2> p){
	o<<"{";
	o<<p.first<<","<<p.second;
	o<<"}";
	return o;
}
template<typename T> ostream& operator<<(ostream& o,vector<T> vec){
	o<<"{";
	for(int i=0;i<vec.size();i++){
		o<<vec[i]<<" ";
	}
	o<<"}";
	return o;
}

int main(int argc,char* argv[]){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d%d",&seg[i].first,&seg[i].second);
		p.push_back(make_pair(seg[i].first,true));
		p.push_back(make_pair(seg[i].second,false));
	}
	sort(p.begin(),p.end());

	if(debug)cout<<"fuck"<<p<<endl;

	vector<pii> lines;
	int inLine=0;
	for(int i=0;i<p.size();i++){
		if(debug)cout<<"Solving "<<lines<<" "<<p[i]<<" "<<inLine<<endl;

		if(p[i].second==false){
			//Right side
			if(debug)cout<<k<<endl;
			if(inLine==k){
				lines.back().second=p[i].first;
			}
			inLine--;
		}else{
			//Left side
			inLine++;
			if(inLine==k){
				lines.push_back(make_pair(p[i].first,-1));
			}
		}
	}

	sort(lines.begin(),lines.end());
	if(debug)cout<<lines<<endl;

	//cout<<"hello"<<endl;

	if(lines.size()==0){
		cout<<0;
		return 0;
	}
	for(int i=0;i<lines.size()-1;i++){
		if(lines[i+1].first==lines[i].second){
			lines[i]=make_pair(lines[i].first,lines[i+1].second);
			lines.erase(lines.begin()+i+1);
			i--;
		}
	}

	cout<<lines.size()<<endl;
	for(int i=0;i<lines.size();i++){
		cout<<lines[i].first<<" "<<lines[i].second<<endl;
	}

	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define INF 2111111111
typedef long long ll;
struct hhh
{
	int p,o;
}a[2001000];
bool hhhh(hhh q,hhh w)
{
	if (q.p!=w.p)return q.p<w.p;
	return q.o>w.o;
}
using namespace std;
int b,c,d=0,e=INF,f=INF,g[1000010][3],ans=0;
int main()
{
	cin>>b>>c;
	for (int m=1;m<=b;m++)
	  {
	  	scanf("%d%d",&a[2*m-1].p,&a[2*m].p);
	  	a[2*m-1].o=1;a[2*m].o=0;
	  }
	sort(a+1,a+2*b+1,hhhh);
	for (int m=1;m<=2*b;m++)
	  {
	  	if (a[m].o) d++;
	  	  else d--;
	  	if (d>=c&&e==INF) e=a[m].p;
	  	if (d<c&&e<INF)
	  	{
	  		if (a[m].p-e<f&&a[m].p-e>0)
	  		{
	  			ans=1;f=a[m].p-e;
	  			g[1][0]=e;g[1][1]=a[m].p;
	  		}
	  		else if (a[m].p-e==f||a[m].p==e)
	  		{
	  			g[++ans][0]=e;g[ans][1]=a[m].p;
	  		}
	  		e=INF;
	  	}
	  }
	printf("%d\n",ans);
	for (int m=1;m<=ans;m++)
	  printf("%d %d\n",g[m][0],g[m][1]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define INF 2111111111
typedef long long ll;
struct hhh
{
	int p,o;
}a[2001000];
bool hhhh(hhh q,hhh w)
{
	if (q.p!=w.p)return q.p<w.p;
	return q.o>w.o;
}
using namespace std;
int b,c,d=0,e=INF,f=INF,g[1000010][3],ans=0;
int main()
{
	cin>>b>>c;
	for (int m=1;m<=b;m++)
	  {
	  	scanf("%d%d",&a[2*m-1].p,&a[2*m].p);
	  	a[2*m-1].o=1;a[2*m].o=0;
	  }
	sort(a+1,a+2*b+1,hhhh);
	for (int m=1;m<=2*b;m++)
	  {
	  	if (a[m].o) d++;
	  	  else d--;
	  	if (d>=c&&e==INF) e=a[m].p;
	  	if (d<c&&e<INF)
	  	{
	  		if (a[m].p-e<f)
	  		{
	  			ans=1;f=a[m].p-e;
	  			g[1][0]=e;g[1][1]=a[m].p;
	  		}
	  		else if (a[m].p-e==f)
	  		{
	  			g[++ans][0]=e;g[ans][1]=a[m].p;
	  		}
	  		e=INF;
	  	}
	  }
	printf("%d\n",ans);
	for (int m=1;m<=ans;m++)
	  printf("%d %d\n",g[m][0],g[m][1]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define INF 2111111111
typedef long long ll;
struct hhh
{
	int p,o;
}a[2001000];
bool hhhh(hhh q,hhh w)
{
    return q.p<w.p;
}
using namespace std;
int b,c,d=0,e=INF,f=INF,g[1000010][3],ans=0;
int main()
{
	cin>>b>>c;
	for (int m=1;m<=b;m++)
	  {
	  	scanf("%d%d",&a[2*m-1].p,&a[2*m].p);
	  	a[2*m-1].o=1;a[2*m].o=0;
	  }
	sort(a+1,a+2*b+1,hhhh);
	for (int m=1;m<=2*b;m++)
	  {
	  	if (a[m].o) d++;
	  	  else d--;
	  	if (a[m+1].p==a[m].p)  continue;
	  	if (d>=c&&e==INF) e=a[m].p;
	  	if (d<c&&e<INF)
	  	{
	  		if (a[m].p-e<f)
	  		{
	  			ans=1;f=a[m].p-e;
	  			g[1][0]=e;g[1][1]=a[m].p;
	  		}
	  		else if (a[m].p-e==f)
	  		{
	  			g[++ans][0]=e;g[ans][1]=a[m].p;
	  		}
	  		e=INF;
	  	}
	  }
	printf("%d\n",ans);
	for (int m=1;m<=ans;m++)
	  printf("%d %d\n",g[m][0],g[m][1]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define INF 2111111111
typedef long long ll;
struct hhh
{
	int p,o;
}a[2001000];
bool hhhh(hhh q,hhh w)
{
	if (q.p!=w.p)return q.p<w.p;
	return q.o>w.o;
}
using namespace std;
int b,c,d=0,e=INF,f=INF,g[1000010][3],ans=0;
int main()
{
	cin>>b>>c;
	for (int m=1;m<=b;m++)
	  {
	  	scanf("%d%d",&a[2*m-1].p,&a[2*m].p);
	  	a[2*m-1].o=1;a[2*m].o=0;
	  }
	sort(a+1,a+2*b+1,hhhh);
	for (int m=1;m<=2*b;m++)
	  {
	  	if (a[m].o) d++;
	  	  else d--;
	  	if (d>=c&&e==INF) e=a[m].p;
	  	if (d<c&&e<INF)
	  	{
	  		g[++ans][0]=e;g[ans][1]=a[m].p;
	  		e=INF;
	  	}
	  }
	printf("%d\n",ans);
	for (int m=1;m<=ans;m++)
	  printf("%d %d\n",g[m][0],g[m][1]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define INF 2111111111
typedef long long ll;
struct hhh
{
	int p,o;
}a[2001000];
bool hhhh(hhh q,hhh w)
{
	if (q.p!=w.p)return q.p<w.p;
	return q.o>w.o;
}
using namespace std;
int b,c,d=0,e=INF,f=INF,g[1000010][3],ans=0;
int main()
{
	cin>>b>>c;
	for (int m=1;m<=b;m++)
	  {
	  	scanf("%d%d",&a[2*m-1].p,&a[2*m].p);
	  	a[2*m-1].o=1;a[2*m].o=0;
	  }
	sort(a+1,a+2*b+1,hhhh);
	for (int m=1;m<=2*b;m++)
	  {
	  	if (a[m].o) d++;
	  	  else d--;
	  	if (d>=c&&e==INF) e=a[m].p;
	  	if (d<c&&e<INF)
	  	{
	  		if (a[m].p-e<f&&a[m].p-e>0])
	  		{
	  			ans=1;f=a[m].p-e;
	  			g[1][0]=e;g[1][1]=a[m].p;
	  		}
	  		else if (a[m].p-e==f||a[m].p==e)
	  		{
	  			g[++ans][0]=e;g[ans][1]=a[m].p;
	  		}
	  		e=INF;
	  	}
	  }
	printf("%d\n",ans);
	for (int m=1;m<=ans;m++)
	  printf("%d %d\n",g[m][0],g[m][1]);
}


#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int main() {
    int n, k; scanf("%d %d", &n, &k);
    vector<int> l(n), r(n), xs;
    for(int i = 0; i < n; ++i) {
        scanf("%d %d", &l[i], &r[i]);
        xs.push_back(l[i]);
        xs.push_back(r[i]);
    }
    sort(begin(xs), end(xs));
    xs.erase(unique(begin(xs), end(xs)), end(xs));
    for(int i = 0; i < n; ++i) {
        l[i] = lower_bound(begin(xs), end(xs), l[i]) - begin(xs);
        r[i] = lower_bound(begin(xs), end(xs), r[i]) - begin(xs);
    }
    int const m = xs.size();
    vector<int> imos(m + 1);
    vector<int> point(m + 1);
    for(int i = 0; i < n; ++i) {
        if(l[i] == r[i]) {
            point[l[i]]++;
        } else {
            imos[l[i]]++; imos[r[i]]--;
        }
    }
    for(int i = 1; i <= m; ++i) {
        imos[i] += imos[i - 1];
    }

    vector<pii> ans;
    int i = 0;
    while(i < m) {
        int j = i;
        while(j < m && imos[j] + point[j] >= k) {
            j++;
        }
        if(i < j) {
            ans.emplace_back(xs[i], xs[min(j, m - 1)]);
            i = j;
        } else {
            i++;
        }
    }
    cout << ans.size() << endl;
    for(auto& p : ans) {
        printf("%d %d\n", p.first, p.second);
    }
}


#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int main() {
    int n, k; scanf("%d %d", &n, &k);
    vector<int> l(n), r(n), xs;
    for(int i = 0; i < n; ++i) {
        scanf("%d %d", &l[i], &r[i]);
        xs.push_back(l[i]);
        xs.push_back(r[i]);
    }
    sort(begin(xs), end(xs));
    xs.erase(unique(begin(xs), end(xs)), end(xs));
    for(int i = 0; i < n; ++i) {
        l[i] = lower_bound(begin(xs), end(xs), l[i]) - begin(xs);
        r[i] = lower_bound(begin(xs), end(xs), r[i]) - begin(xs);
    }
    int const m = xs.size();
    vector<int> s(m + 1), t(m + 1);
    for(int i = 0; i < n; ++i) {
        s[l[i]]++; t[r[i]]--;
    }

    int now = 0;
    vector<pii> ans;
    int i = 0;
    while(i < m) {
        now += s[i];
        if(now < k) {
            now += t[i++];
            continue;
        }
        int x = xs[i];
        while(i < m) {
            now += t[i];
            if(now < k) {
                break;
            }
            i++;
            if(i < m) {
                now += s[i];
            }
        }
        int y = xs[min(i, m - 1)];
        ans.emplace_back(x, y);
        ++i;
    }
    cout << ans.size() << endl;
    for(auto& p : ans) {
        printf("%d %d\n", p.first, p.second);
    }
}


#include <vector>
#include <algorithm>
#include <string.h>
#include <string>
#include <ctime>
#include <math.h>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <queue>
#include <map>
#include <set>

#define readD(n) scanf("%ld",&n)
#define readC(n) scanf("%c",&n)
#define writeD(n) printf("%ld",n)
#define readLD(n) scanf("%I64D",&n)
#define writeLD(n) printf("%I64D",n)
#define readS(n) scanf("%s",&n)
#define readln(s) gets(s)
#define for0(i,n) for(i=0; i<n; i++)
#define for1(i,n) for(i=1; i<=n; i++)
#define inf 1<<30
#define y1 y_1
#define y2 y_2

using namespace std;

char* ssg = new char[3];

long i,j,k,l,m,n,i1;

int main(){

    #ifndef ONLINE_JUDGE

    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);

    #endif

    readD(n);
    readln(ssg);

    long a[105][105];
    vector<string> vt,vg,vp;
    long mxt = 0, mxg = 0, mxp = 0;

    for0(i,n){
        long k,curp = 0, curg = 0, curt = 0;
        char ssc[1000];

        readD(k);
        readln(ssc);
        string s1 = ssc;
        s1.erase(0,1);

        for0(j,k){
            readln(ssc);
            string s2 = ssc;
            s2.erase(s2.find("-"),1);
            s2.erase(s2.find("-"),1);
            long piz = 0, tx = 0;

            for1(i1,5){
                if (s2[i1] != s2[i1-1]) tx = 1;
                if (s2[i1] >= s2[i1-1]) piz = 1;
            }
            if (tx==0) curt++;
            else if (piz==0) curp++;
            else curg++;
        }

        if (curt > mxt){
            vt.clear();
            mxt = curt;
            vt.push_back(s1);
        }else if (curt == mxt){
            vt.push_back(s1);
        }

         if (curg > mxg){
            vg.clear();
            mxg = curg;
            vg.push_back(s1);
        }else if (curg == mxg){
            vg.push_back(s1);
        }

         if (curp > mxp){
            vp.clear();
            mxp = curp;
            vp.push_back(s1);
        }else if (curp == mxp){
            vp.push_back(s1);
        }
    }
    printf("If you want to call a taxi, you should call: ");
    for0(i,vt.size()){
        printf("%s",vt[i].c_str());
        if (i != vt.size()-1)
            printf(", ");
        else
            printf(".\n");
    }

    printf("If you want to order a pizza, you should call: ");

    for0(i,vp.size()){
        printf("%s",vp[i].c_str());
        if (i != vp.size()-1)
            printf(", ");
        else
            printf(".\n");
    }

    printf("If you want to go to a cafe with a wonderful girl, you should call: ");
    for0(i,vg.size()){
        printf("%s",vg[i].c_str());
        if (i != vg.size()-1)
            printf(", ");
        else
            printf(".");
    }

    return 0;
}


#include <fstream>
#include <iostream>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <memory.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh

#define  INF 100000000
#define eps 1e-11
#define M_PI 3.141592653589793
//#define mx 1000000000000ll
//#define bs 1000000007
//#define free asdfasdfsdadsg
//#define szz 400
//#define pb push_back
#define MAXN 100000
#define free afdshjioey
//#define SIZE 60

using namespace std;

long sz[1000];
string st;
string nm[1000];
long n1[1000],n2[1000],n3[1000];
long tests;
long bn1,bn2,bn3;
vector<string> v1,v2,v3;

string parse(string st)
{
 string st1;
 for (int i=0;i<st.size();i++)
 if (st[i]>='0'&&st[i]<='9')st1+=st[i];
 return st1;
}

bool issame(string st)
{
     for (int i=0;i<st.size();i++)
     if (st[i]!=st[0])return false;
     return true;
}

bool isdown(string st)
{
 for (int i=1;i<st.size();i++)
 if (st[i]>=st[i-1])return false;
 return true;
}

int main(){
//freopen("processing.in","r",stdin);
//freopen("processing.out","w",stdout);
//freopen("C:/input.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
ios_base::sync_with_stdio(0);

cin>>tests;
for (int test=1;test<=tests;++test)
{
 cin>>sz[test]>>nm[test];
 for (int i=1;i<=sz[test];i++)
 {
     cin>>st;
     st=parse(st);
     if (issame(st))n1[test]++;
     else if (isdown(st))n2[test]++;
     else n3[test]++;
 }
}

//for (int i=1;i<=tests;i++)
//{
//    cout<<nm[i]<<" "<<n1[i]<<" "<<n2[i]<<" "<<n3[i]<<endl;
//}

for (int i=1;i<=tests;i++)
{
 if (n1[i]>bn1)bn1=n1[i];
 if (n2[i]>bn2)bn2=n2[i];
 if (n3[i]>bn3)bn3=n3[i];
}

for (int i=1;i<=tests;i++)
{
    if (n1[i]==bn1)v1.push_back(nm[i]);
    if (n2[i]==bn2)v2.push_back(nm[i]);
    if (n3[i]==bn3)v3.push_back(nm[i]);
}
cout<<"If you want to call a taxi, you should call:";
for (int i=0;i<v1.size();i++)
{
    if (i)cout<<",";
    cout<<" ";
    cout<<v1[i];
}
cout<<"."<<endl;

cout<<"If you want to order a pizza, you should call:";
for (int i=0;i<v2.size();i++)
{
    if (i)cout<<",";
    cout<<" ";
    cout<<v2[i];
}
cout<<"."<<endl;

cout<<"If you want to go to a cafe with a wonderful girl, you should call:";
for (int i=0;i<v3.size();i++)
{
    if (i)cout<<",";
    cout<<" ";
    cout<<v3[i];
}
cout<<"."<<endl;

cin.get();cin.get();
return 0;}


#include<iostream>
#include<vector>
using namespace std;
int inf[100][3],cnt[3],tmp;
vector <string> tnp[3];
int test(string s)
{
    int tx=0,pz=0;
    for(int i=2; i<s.size(); ++i)
        s[i]=s[i+1];
    for(int i=4; i<s.size(); ++i)
        s[i]=s[i+1];
    for(int i=0; i<s.size()-3; ++i)
    {
        if(s[i] == s[i+1])
            tx++;
        if(s[i] > s[i+1])
            pz++;
    }
    if(tx == 5)
        return 0;
    if(pz == 5)
        return 1;
    return 2;
}
int main()
{
    int n,m;
    string nm,s,a[100];
    cin >> n;
    for(int i=0; i<n; ++i)
    {
        cin >> m >> a[i];
        for(int j=0; j<m; ++j)
        {
            cin >> s;
            tmp = test(s);
            inf[i][tmp]++;
            cnt[tmp]=(cnt[tmp] < inf[i][tmp])?inf[i][tmp]:cnt[tmp];
        }
    }
    for(int i=0; i<n; ++i)
    {
        if(cnt[0] == inf[i][0])
            tnp[0].push_back(a[i]);
        if(cnt[1] == inf[i][1])
            tnp[1].push_back(a[i]);
        if(cnt[2] == inf[i][2])
            tnp[2].push_back(a[i]);
    }
    for(int i=0; i<3; ++i)
        {
            if(i==0)
                cout << "If you want to call a taxi, you should call: ";
            else if(i==1)
                cout << "If you want to order a pizza, you should call: ";
            else
                cout << "If you want to go to a cafe with a wonderful girl, you should call: ";
            if(tnp[i].size() == 1)
                cout << tnp[i][0];
            else
                cout << tnp[i][0];
                for(int j=1; j<tnp[i].size(); ++j)
                    cout << ", " << tnp[i][j];
            cout <<"." << endl;
        }
}


#include<iostream>
#include<vector>
using namespace std;
int inf[100][3],cnt[3],tmp;
vector <string> tnp[3];
int test(string s)
{
    int tx=0,pz=0,i=0;
    while(i < s.size()-1)
    {
        if(s[i] == s[i+1])
            tx++;
        if(s[i] > s[i+1])
            pz++;
        i+=3;
    }
    if(tx == 3)
        return 0;
    if(pz == 3)
        return 1;
    return 2;
}
int main()
{
    int n,m;
    string nm,s,a[100];
    cin >> n;
    for(int i=0; i<n; ++i)
    {
        cin >> m >> a[i];
        for(int j=0; j<m; ++j)
        {
            cin >> s;
            tmp = test(s);
            inf[i][tmp]++;
            cnt[tmp]=(cnt[tmp] < inf[i][tmp])?inf[i][tmp]:cnt[tmp];
        }
    }
    for(int i=0; i<n; ++i)
    {
        if(cnt[0] == inf[i][0])
            tnp[0].push_back(a[i]);
        if(cnt[1] == inf[i][1])
            tnp[1].push_back(a[i]);
        if(cnt[2] == inf[i][2])
            tnp[2].push_back(a[i]);
    }
    for(int i=0; i<3; ++i)
        {
            if(i==0)
                cout << "If you want to call a taxi, you should call: ";
            else if(i==1)
                cout << "If you want to order a pizza, you should call: ";
            else
                cout << "If you want to go to a cafe with a wonderful girl, you should call: ";
            if(tnp[i].size() == 1)
                cout << tnp[i][0];
            else
                cout << tnp[i][0];
                for(int j=1; j<tnp[i].size(); ++j)
                    cout << ", " << tnp[i][j];
            cout <<"." << endl;
        }
}


#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;

int T, K, PizzaMax, GirlsMax, TaxiMax;
string Name, Phone;
vector<string> Pizza, Girls, Taxi;

bool TestTaxi(string S)
{
    return S[0] == S[1] && S[1] == S[3] && S[3] == S[4] && S[4] == S[6] && S[6] == S[7];
}

bool TestPizza(string S)
{
    return S[0] > S[1] && S[1] > S[3] && S[3] > S[4] && S[4] > S[6] && S[6] > S[7];
}

int main()
{
    ios::sync_with_stdio(false);
    //ifstream cin("b.in");
   // ofstream cout("b.out");

    cin >> T;
    for(; T; T --)
    {
        cin >> K >> Name;
        int CntTaxi = 0, CntPizza = 0, CntGirls = 0;

        for(int i = 1; i <= K; ++ i)
        {
            cin >> Phone;
            if(TestTaxi(Phone)) CntTaxi ++;
            else if(TestPizza(Phone)) CntPizza ++;
            else CntGirls ++;
        }

        if(CntTaxi > TaxiMax) TaxiMax = CntTaxi, Taxi.clear(), Taxi.push_back(Name);
        else if(CntTaxi == TaxiMax) Taxi.push_back(Name);

        if(CntPizza > PizzaMax) PizzaMax = CntPizza, Pizza.clear(), Pizza.push_back(Name);
        else if(CntPizza == PizzaMax) Pizza.push_back(Name);

        if(CntGirls > GirlsMax) GirlsMax = CntGirls, Girls.clear(), Girls.push_back(Name);
        else if(CntGirls == GirlsMax) Girls.push_back(Name);
    }

    cout << "If you want to call a taxi, you should call: ";
    for(int i = 0; i < Taxi.size(); ++ i)
    {
        cout << Taxi[i];
        if(i != Taxi.size() - 1) cout << ", ";
        else cout << ".\n";
    }
    cout << "If you want to order a pizza, you should call: ";
    for(int i = 0; i < Pizza.size(); ++ i)
    {
        cout << Pizza[i];
        if(i != Pizza.size() - 1) cout << ", ";
        else cout << ".\n";
    }
    cout << "If you want to go to a cafe with a wonderful girl, you should call: ";
    for(int i = 0; i < Girls.size(); ++ i)
    {
        cout << Girls[i];
        if(i != Girls.size() - 1) cout << ", ";
        else cout << ".";
    }
}


#include <cstdio>
#include <array>
#include <algorithm>

const std::array<std::string, 3> Strs = {
  "If you want to call a taxi, you should call: ",
  "If you want to order a pizza, you should call: ",
  "If you want to go to a cafe with a wonderful girl, you should call: "
};

char names_[100][21];
int counts_[100][3];

int check(const char phone[]) {
  bool taxi = false, pizza = false;

  char prev = phone[0];
  for (int i = 1; phone[i]; ++i) {
    if (phone[i] == '-') continue;

    if (phone[i] == prev) {
      if (pizza) return 2;
      taxi = true;
    }
    else if (phone[i] < prev) {
      if (taxi) return 2;
      pizza = true;
    }
    else {
      return 2;
    }
    prev = phone[i];
  }
  return taxi ? 0 : 1;
}

int main() {
  int n; std::scanf("%d", &n);

  int maxima[3] = {};
  for (int i = 0; i < n; ++i) {
    int s; std::scanf("%d%s", &s, names_[i]);

    int counts[3] = {};
    for (int j = 0; j < s; ++j) {
      char phone[9]; std::scanf("%s", phone);
      ++counts[check(phone)];
    }

    for (int k = 0; k < 3; ++k) {
      counts_[i][k] = counts[k];
      maxima[k] = std::max(maxima[k], counts[k]);
    }
  }

  for (int k = 0; k < 3; ++k) {
    std::printf("%s", Strs[k].c_str());
    for (int i = 0, c = 0; i < n; ++i) {
      if (counts_[i][k] < maxima[k]) continue;

      if (c > 0) std::printf(", ");
      std::printf("%s", names_[i]);
      ++c;
    }
    std::printf(".\n");
  }
  return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;

inline int toInt(string s){int v;istringstream is(s);is>>v;return v;}
template<class T> inline string toString(T x){ostringstream so;so<<x;return so.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}

const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

int phone[] = {0, 1, 3, 4, 6, 7};

int main() {
    int N; cin >> N;
    vector<string> staxi, spizza, sgirl;
    int ntaxi = 0, npizza = 0, ngirl = 0;
    for(int i = 0; i < N; i++) {
        int num;
        string name;
        cin >> num >> name;
        int taxi = 0, pizza = 0, girl = 0;
        for(int j = 0; j < num; j++) {
            string line;
            cin >> line;
            int arr[6];
            bool t = true, p = true, g = true;
            for(int k = 0; k < 6; k++) {
                arr[k] = line[phone[k]] - '0';
            }
            for(int k = 1; k < 6; k++) {
                if(arr[k] != arr[k - 1])
                    t = false;
                if(arr[k - 1] <= arr[k])
                    p = false;
            }
            if(t || p) g = false;

            if(t) taxi++;
            if(p) pizza++;
            if(g) girl++;

#if 0
            if(t) cerr << "t" << endl;
            if(p) cerr << "p" << endl;
            if(g) cerr << "g" << endl;
#endif

        }
        if(taxi == ntaxi) {
            staxi.push_back(name);
        }
        if(taxi > ntaxi) {
            staxi.clear();
            staxi.push_back(name);
            ntaxi = taxi;
        }
        if(pizza == npizza) {
            spizza.push_back(name);
        }
        if(pizza > npizza) {
            spizza.clear();
            spizza.push_back(name);
            npizza = pizza;
        }
        if(girl == ngirl) {
            sgirl.push_back(name);
        }
        if(girl > ngirl) {
            sgirl.clear();
            sgirl.push_back(name);
            ngirl = girl;
        }
    }
#if 0
    pv(all(staxi));
    pv(all(spizza));
    pv(all(sgirl));
#endif

    cout << "If you want to call a taxi, you should call: ";
    for(int i = 0; i < (int)staxi.size() - 1; i++) {
        cout << staxi[i] << ", ";
    }
    cout << *staxi.rbegin() << "." << endl;

    cout << "If you want to order a pizza, you should call: ";
    for(int i = 0; i < (int)spizza.size() - 1; i++) {
        cout << spizza[i] << ", ";
    }
    cout << *spizza.rbegin() << "." << endl;

    cout << "If you want to go to a cafe with a wonderful girl, you should call: ";
    for(int i = 0; i < (int)sgirl.size() - 1; i++) {
        cout << sgirl[i] << ", ";
    }
    cout << *sgirl.rbegin() << "." << endl;

    return 0;
}


#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <iostream>
using namespace std;

typedef pair<int, int> pii;

inline void get_max(int &a, int b) {
	if (a < b) a = b;
}

bool all_same(vector<int>& v) {
	for (int i = 1; i < v.size(); i++)
		if (v[i] != v[i - 1]) return false;
	return true;
}

bool decreasing(vector<int>& v) {
	for (int i = 1; i < v.size(); i++)
		if (v[i] >= v[i - 1]) return false;
	return true;
}

int main() {
	freopen("in.txt", "r", stdin);
	map<string, vector<string> > data;
	map<string, pair<int, pii> > val;
	map<string, vector<bool> > ok;
	map<string, vector<string> >::iterator it;
	map<string, pair<int, pii> >::iterator k;
	int friends, i, j; scanf("%d", &friends);
	string strs[150];
	for (i = 0; i < friends; i++) {
		int n; scanf("%d", &n);
		string name; cin >> name;
		strs[i] = name;
		data[name] = vector<string>(n);
		val[name] = make_pair(0, pii(0, 0));
		ok[name] = vector<bool>(3, false);
		for (j = 0; j < n; j++)
			cin >> data[name][j];
	}
	vector<int> nums;
	int pizza = 0, girls = 0, taxi = 0;
	for (it = data.begin(); it != data.end(); it++) {
		nums.clear();
		for (i = 0; i < it->second.size(); i++) {
			for (j = 0; j < it->second[i].length(); j++) {
				if (it->second[i][j] != '-')
					nums.push_back(it->second[i][j] - '0');
			}
			if (all_same(nums)) {
				++val[it->first].first;
			} else if (decreasing(nums)) {
				++val[it->first].second.first;
			} else {
				++val[it->first].second.second;
			}
			get_max(taxi, val[it->first].first);
			get_max(pizza, val[it->first].second.first);
			get_max(girls, val[it->first].second.second);
			nums.clear();
		}
	}
	for (k = val.begin(); k != val.end(); k++) {
		if (k->second.first == taxi)
			ok[k->first][0] = true;
		if (k->second.second.first == pizza)
			ok[k->first][1] = true;
		if (k->second.second.second == girls)
			ok[k->first][2] = true;
	}
	cout << "If you want to call a taxi, you should call";
	bool first = true;
	for (i = 0; i < friends; i++) {
		if (ok[strs[i]][0]) {
			if (first) {
				cout << ": " << strs[i];
				first = false;
			} else
				cout << ", " << strs[i];
		}
	}
	cout << "." << endl;
	cout << "If you want to order a pizza, you should call";
	first = true;
	for (i = 0; i < friends; i++) {
		if (ok[strs[i]][1]) {
			if (first) {
				cout << ": " << strs[i];
				first = false;
			} else
				cout << ", " << strs[i];
		}
	}
	cout << "." << endl;
	cout << "If you want to go to a cafe with a wonderful girl, you should call";
	first = true;
	for (i = 0; i < friends; i++) {
		if (ok[strs[i]][2]) {
			if (first) {
				cout << ": " << strs[i];
				first = false;
			} else
				cout << ", " << strs[i];
		}
	}
	cout << "." << endl;
	return 0;
}


#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <iostream>
using namespace std;

typedef pair<int, int> pii;

inline void get_max(int &a, int b) {
	if (a < b) a = b;
}

bool all_same(vector<int>& v) {
	for (int i = 1; i < v.size(); i++)
		if (v[i] != v[i - 1]) return false;
	return true;
}

bool decreasing(vector<int>& v) {
	for (int i = 1; i < v.size(); i++)
		if (v[i] >= v[i - 1]) return false;
	return true;
}

int main() {
	map<string, vector<string> > data;
	map<string, pair<int, pii> > val;
	map<string, vector<bool> > ok;
	map<string, vector<string> >::iterator it;
	map<string, pair<int, pii> >::iterator k;
	int friends, i, j; scanf("%d", &friends);
	string strs[150];
	for (i = 0; i < friends; i++) {
		int n; scanf("%d", &n);
		string name; cin >> name;
		strs[i] = name;
		data[name] = vector<string>(n);
		val[name] = make_pair(0, pii(0, 0));
		ok[name] = vector<bool>(3, false);
		for (j = 0; j < n; j++)
			cin >> data[name][j];
	}
	vector<int> nums;
	int pizza = 0, girls = 0, taxi = 0;
	for (it = data.begin(); it != data.end(); it++) {
		nums.clear();
		for (i = 0; i < it->second.size(); i++) {
			for (j = 0; j < it->second[i].length(); j++) {
				if (it->second[i][j] != '-')
					nums.push_back(it->second[i][j] - '0');
			}
			if (all_same(nums)) {
				++val[it->first].first;
			} else if (decreasing(nums)) {
				++val[it->first].second.first;
			} else {
				++val[it->first].second.second;
			}
			get_max(taxi, val[it->first].first);
			get_max(pizza, val[it->first].second.first);
			get_max(girls, val[it->first].second.second);
			nums.clear();
		}
	}
	for (k = val.begin(); k != val.end(); k++) {
		if (k->second.first == taxi)
			ok[k->first][0] = true;
		if (k->second.second.first == pizza)
			ok[k->first][1] = true;
		if (k->second.second.second == girls)
			ok[k->first][2] = true;
	}
	cout << "If you want to call a taxi, you should call";
	bool first = true;
	for (i = 0; i < friends; i++) {
		if (ok[strs[i]][0]) {
			if (first) {
				cout << ": " << strs[i];
				first = false;
			} else
				cout << ", " << strs[i];
		}
	}
	cout << "." << endl;
	cout << "If you want to order a pizza, you should call";
	first = true;
	for (i = 0; i < friends; i++) {
		if (ok[strs[i]][1]) {
			if (first) {
				cout << ": " << strs[i];
				first = false;
			} else
				cout << ", " << strs[i];
		}
	}
	cout << "." << endl;
	cout << "If you want to go to a cafe with a wonderful girl, you should call";
	first = true;
	for (i = 0; i < friends; i++) {
		if (ok[strs[i]][2]) {
			if (first) {
				cout << ": " << strs[i];
				first = false;
			} else
				cout << ", " << strs[i];
		}
	}
	cout << "." << endl;
	return 0;
}


#include <iostream>
#include <string>
#include <map>
#include <vector>

#define trace(col, el) for(auto el = col.begin(); el != col.end(); ++el)

using namespace std;

int array[] = {0, 1, 3, 4, 6, 7};

bool istaxi(const string& s)
{
  for (int i = 0; i < 6; ++i)
    if (s[array[i]] != s[0])
      return false;

  return true;
}

bool ispizza(const string& s)
{
  for (int i = 1; i < 6; ++i)
    if (s[array[i - 1]] <= s[array[i]])
      return false;

  return true;
}

int main()
{
  int n;
  cin >> n;
  map<pair<int, string>, int> girls, pizza, taxi;
  string name, number;
  int num;
  for (int i = 0; i < n; ++i)
  {
    cin >> num >> name;
    girls[make_pair(i, name)] = 0;
    pizza[make_pair(i, name)] = 0;
    taxi [make_pair(i, name)]  = 0;
    for (int j = 0; j < num; ++j)
    {
       cin >> number;
       if (istaxi(number)) {
         taxi [make_pair(i, name)]++;
       }
       else if (ispizza(number)) {
         pizza[make_pair(i, name)]++;
       }
       else {
         girls[make_pair(i, name)]++;
       }
    }
  }

  vector<string> pizzaanswer, taxianswer, girlsanswer;
  int maxtaxi = 0, maxpizza = 0, maxgirls = 0;

  trace(taxi, it)
  {
    if (maxtaxi < it->second)
    {
      taxianswer.clear();
      maxtaxi = it->second;
    }
    if (maxtaxi == it->second)
      taxianswer.push_back((it->first).second);
  }
  trace(pizza, it)
  {
    if (maxpizza < it->second)
    {
      pizzaanswer.clear();
      maxpizza = it->second;
    }
    if (maxpizza == it->second)
      pizzaanswer.push_back((it->first).second);
  }

  trace(girls, it)
  {
    if (maxgirls < it->second)
    {
      girlsanswer.clear();
      maxgirls = it->second;
    }
    if (maxgirls == it->second)
      girlsanswer.push_back((it->first).second);
  }

  cout << "If you want to call a taxi, you should call: ";
  cout << taxianswer[0];
  for (int i = 1; i < taxianswer.size(); ++i)
    cout << ", " << taxianswer[i];
  cout << ".\n";

  cout << "If you want to order a pizza, you should call: ";
  cout << pizzaanswer[0];
  for (int i = 1; i < pizzaanswer.size(); ++i)
    cout << ", " << pizzaanswer[i];
  cout << ".\n";

  cout << "If you want to go to a cafe with a wonderful girl, you should call: ";
  cout << girlsanswer[0];
  for (int i = 1; i < girlsanswer.size(); ++i)
    cout << ", " << girlsanswer[i];
  cout << ".\n";
  return 0;
}


#include <iostream>
#include <string>
#include <map>
#include <vector>

#define trace(col, el) for(auto el = col.begin(); el != col.end(); ++el)

using namespace std;

int array[] = {0, 1, 3, 4, 6, 7};

bool istaxi(const string& s)
{
  for (int i = 0; i < 6; ++i)
    if (s[array[i]] != s[0])
      return false;

  return true;
}

bool ispizza(const string& s)
{
  for (int i = 1; i < 6; ++i)
    if (s[array[i - 1]] <= s[array[i]])
      return false;

  return true;
}

int main()
{
  int n;
  cin >> n;
  map<string, int> girls, pizza, taxi;
  string name, number;
  int num;
  for (int i = 0; i < n; ++i)
  {
    cin >> num >> name;
    girls[name] = 0;
    pizza[name] = 0;
    taxi[name]  = 0;
    for (int j = 0; j < num; ++j)
    {
       cin >> number;
       if (istaxi(number)) {
         taxi [name]++;
       }
       else if (ispizza(number)) {
         pizza[name]++;
       }
       else {
         girls[name]++;
       }
    }
  }

  vector<string> pizzaanswer, taxianswer, girlsanswer;
  int maxtaxi = 0, maxpizza = 0, maxgirls = 0;

  trace(taxi, it)
  {
    if (maxtaxi < it->second)
    {
      taxianswer.clear();
      maxtaxi = it->second;
    }
    if (maxtaxi == it->second)
      taxianswer.push_back(it->first);
  }
  trace(pizza, it)
  {
    if (maxpizza < it->second)
    {
      pizzaanswer.clear();
      maxpizza = it->second;
    }
    if (maxpizza == it->second)
      pizzaanswer.push_back(it->first);
  }

  trace(girls, it)
  {
    if (maxgirls < it->second)
    {
      girlsanswer.clear();
      maxgirls = it->second;
    }
    if (maxgirls == it->second)
      girlsanswer.push_back(it->first);
  }

  cout << "If you want to call a taxi, you should call: ";
  cout << taxianswer[0];
  for (int i = 1; i < taxianswer.size(); ++i)
    cout << ", " << taxianswer[i];
  cout << ".\n";

  cout << "If you want to order a pizza, you should call: ";
  cout << pizzaanswer[0];
  for (int i = 1; i < pizzaanswer.size(); ++i)
    cout << ", " << pizzaanswer[i];
  cout << ".\n";

  cout << "If you want to go to a cafe with a wonderful girl, you should call: ";
  cout << girlsanswer[0];
  for (int i = 1; i < girlsanswer.size(); ++i)
    cout << ", " << girlsanswer[i];
  cout << ".\n";
  return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
char name[101][25];
int taxi[101],girls[101],pizza[101];
int i,n,t,j,k,l,post,maxt=0,maxp=0,maxg=0;
scanf("%d",&n);
char str[10];
for(i=0;i<n;i++)
{taxi[i]=0;pizza[i]=0;girls[i]=0;
scanf("%d %s",&t,name[i]);
for(j=0;j<t;j++)
{
scanf("%s",str);
if((str[0]==str[1])&&(str[1]==str[3])&&(str[3]==str[4])&&(str[4]==str[6])&&(str[6]==str[7]))
taxi[i]++;
else if((str[0]>str[1])&&(str[1]>str[3])&&(str[3]>str[4])&&(str[4]>str[6])&&(str[6]>str[7]))
pizza[i]++;
else
girls[i]++;
}if(maxt<taxi[i])
maxt=taxi[i];
if(maxg<girls[i])
maxg=girls[i];
if(maxp<pizza[i])
maxp=pizza[i];
}
printf("If you want to call a taxi, you should call: ");

i=0;post=0;
while(i!=n)
{
if(taxi[i]==maxt)
{post++;
if(post==1)
printf("%s",name[i]);
else
printf(", %s",name[i]);
}i++;
}
printf(".\n");
printf( "If you want to order a pizza, you should call: ");
i=0;post=0;
while(i!=n)
{
if(pizza[i]==maxp)
{post++;
if(post==1)
printf("%s",name[i]);
else
printf(", %s",name[i]);
}
i++;
}
printf(".\n");
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
i=0;post=0;
while(i!=n)
{
if(girls[i]==maxg)
{post++;
if(post==1)
printf("%s",name[i]);
else
printf(", %s",name[i]);
}i++;
}
printf(".\n");
return 0;
}


#include<stdio.h>
#include<string.h>
main()
{
char name[100][25];
int taxi[100],girls[100],pizza[100];
int i,n,t,j,k,l,post,maxt=0,maxp=0,maxg=0;
scanf("%d",&n);
char str[10];
for(i=0;i<n;i++)
{
scanf("%d %s",&t,name[i]);
for(j=0;j<t;j++)
{
scanf("%s",str);
if((str[0]==str[1])&&(str[1]==str[3])&&(str[3]==str[4])&&(str[4]==str[6])&&(str[6]==str[7]))
taxi[i]++;
else if((str[0]>str[1])&&(str[1]>str[3])&&(str[3]>str[4])&&(str[4]>str[6])&&(str[6]>str[7]))
pizza[i]++;
else
girls[i]++;
}
if(maxt<taxi[i])
maxt=taxi[i];
if(maxg<girls[i])
maxg=girls[i];
if(maxp<pizza[i])
maxp=pizza[i];
}
printf("If you want to call a taxi, you should call: ");

i=0;post=0;
while(i!=n)
{
if(taxi[i]==maxt)
{post++;
if(post==1)
printf("%s",name[i]);
else
printf(", %s",name[i]);
}i++;
}
printf(".\n");
printf( "If you want to order a pizza, you should call: ");
i=0;post=0;
while(i!=n)
{
if(pizza[i]==maxp)
{post++;
if(post==1)
printf("%s",name[i]);
else
printf(", %s",name[i]);
}
i++;
}
printf(".\n");
printf("If you want to go to a cafe with a wonderful girl, you should call: ");
i=0;post=0;
while(i!=n)
{
if(girls[i]==maxg)
{post++;
if(post==1)
printf("%s",name[i]);
else
printf(", %s",name[i]);
}i++;
}
printf(".\n");
return 0;
}


#include <stdio.h>
#include <string.h>
typedef struct man
{
    char name[21];
    int size;
    int taxi;
    int pizza;
    int girl;
}Man;
Man t[100];
int judge(char s[10])
{
    int k;
    char x[6]={s[0],s[1],s[3],s[4],s[6],s[7]};
    for(k=1;k<6;k++){
        if(x[k]!=x[k-1]) break;
    }
    if(k==6) return 1;
    for(k=1;k<6;k++){
        if(x[k]>=x[k-1]) break;
    }
    if(k==6) return 2;
    return 3;
}
int main()
{
    int n;
    scanf("%d",&n);
    int k,j;
    char phone[10];
    int m1,m2,m3;
    m1=m2=m3=0;
    for(k=0;k<n;k++){
        scanf("%d%s",&t[k].size,t[k].name);
        t[k].taxi=t[k].pizza=t[k].girl=0;
        for(j=0;j<t[k].size;j++){
            scanf("%s",phone);

            switch(judge(phone))
            {
                case 1:t[k].taxi++;break;
                case 2:t[k].pizza++;break;
                case 3:t[k].girl++;break;
            }
        }

        if(t[k].taxi>m1) m1=t[k].taxi;
        if(t[k].pizza>m2) m2=t[k].pizza;
        if(t[k].girl>m3) m3=t[k].girl;
    }

    int first=1;
    printf("If you want to call a taxi, you should call: ");
    for(k=0;k<n;k++)
    {
        if(m1==t[k].taxi)
        {
            if(!first) printf(", ");
            else first=0;
            printf("%s",t[k].name);
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call: ");
    first=1;
    for(k=0;k<n;k++)
    {
        if(m2==t[k].pizza)
        {
            if(!first) printf(", ");
            else first=0;
            printf("%s",t[k].name);
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call: ");
    first=1;
    for(k=0;k<n;k++)
    {
        if(m3==t[k].girl)
        {
            if(!first) printf(", ");
            else first=0;
            printf("%s",t[k].name);
        }
    }
    printf(".\n");
    return 0;
}


#include <stdio.h>
main()
{
    int n,i,j,p,a,b,c,max;
    scanf("%d",&n);
    char name[n][21];
    int taxi[100]={0},piza[100]={0},girl[100]={0};
    for(i=0;i<n;i++)
    {
        scanf("%d %s",&p,name[i]);
        for(j=0;j<p;j++)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b && a==c && a/10==a%10)taxi[i]++;
            else if(a/10>a%10 && a%10>b/10 && b/10>b%10 && b%10>c/10 && c/10>c%10)piza[i]++;
            else girl[i]++;
        }
    }

    max=-1;
    for(i=0;i<n;i++){if(taxi[i]>max)max=taxi[i];}
    printf("If you want to call a taxi, you should call:");
    for(i=0;i<n;i++){if(taxi[i]==max){printf(" %s",name[i]);break;}}
    for(++i;i<n;i++){if(taxi[i]==max){printf(", %s",name[i]);}}
    printf(".\n");

    max=-1;
    for(i=0;i<n;i++){if(piza[i]>max)max=piza[i];}
    printf("If you want to order a pizza, you should call:");
    for(i=0;i<n;i++){if(piza[i]==max){printf(" %s",name[i]);break;}}
    for(++i;i<n;i++){if(piza[i]==max){printf(", %s",name[i]);}}
    printf(".\n");

    max=-1;
    for(i=0;i<n;i++){if(girl[i]>max)max=girl[i];}
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    for(i=0;i<n;i++){if(girl[i]==max){printf(" %s",name[i]);break;}}
    for(++i;i<n;i++){if(girl[i]==max){printf(", %s",name[i]);}}
    printf(".");

    return 0;

}


#include <stdio.h>
main()
{
    int n,i,j,p,a,b,c,max;
    scanf("%d",&n);
    char name[n][21];
    int taxi[100]={0},piza[100]={0},girl[100]={0};
    for(i=0;i<n;i++)
    {
        scanf("%d %s",&p,name[i]);
        for(j=0;j<p;j++)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b && a==c && a/10==a%10)taxi[i]++;
            else if(a/10>a%10 && a%10>b/10 && b/10>b%10 && b%10>c/10 && c/10>c%10)piza[i]++;
            else girl[i]++;
        }
    }

    for(i=0;i<n;i++)printf("%d\n",piza[i]);
    max=-1;
    for(i=0;i<n;i++){if(taxi[i]>max)max=taxi[i];}
    printf("If you want to call a taxi, you should call:");
    for(i=0;i<n;i++){if(taxi[i]==max){printf(" %s",name[i]);break;}}
    for(++i;i<n;i++){if(taxi[i]==max){printf(", %s",name[i]);}}
    printf(".\n");

    max=-1;
    for(i=0;i<n;i++){if(piza[i]>max)max=piza[i];}
    printf("If you want to order a pizza, you should call:");
    for(i=0;i<n;i++){if(piza[i]==max){printf(" %s",name[i]);break;}}
    for(++i;i<n;i++){if(piza[i]==max){printf(", %s",name[i]);}}
    printf(".\n");

    max=-1;
    for(i=0;i<n;i++){if(girl[i]>max)max=girl[i];}
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    for(i=0;i<n;i++){if(girl[i]==max){printf(" %s",name[i]);break;}}
    for(++i;i<n;i++){if(girl[i]==max){printf(", %s",name[i]);}}
    printf(".");

    return 0;

}


#include <stdio.h>
#include <string.h>

int main()
{
    int n, i, s[101], j, k, t[101]={0}, p[101]={0}, g[101]={0}, taxi, pizza, girl;
    char name[101][22], str[20];
    scanf("%d", &n);
    for(i=0; i<n; i++)
    {
        scanf("%d %s", &s[i], name[i]);
        for(j=0; j<s[i]; j++)
        {
            taxi=0, pizza=0, girl=0;
            scanf("%s", str);
            if(str[0]==str[1])
                taxi=1;
            else if(str[0]>str[1])
                pizza=1;
            else
                girl=1;
            if(taxi)
                for(k=2; k<strlen(str); k++)
                {
                    if(str[k]!='-' && str[k]!=str[k-1])
                    {
                        girl=1;
                        //printf("becoming girl here for i=%d j=%d k=%d\n", i, j, k);
                        break;
                    }
                    else if(str[k]=='-')
                    {
                        k++;
                        if(str[k]!=str[k-2])
                        {
                            {
                                girl=1;
                                //printf("becoming girl here for i=%d j=%d k=%d\n", i, j, k);
                                break;
                            }
                        }
                    }
                }
            else if(pizza)
                for(k=2; k<strlen(str); k++)
                {
                    if(str[k]!='-' && str[k]>=str[k-1])
                    {
                        girl=1;
                        //printf("becoming girl here for i=%d j=%d k=%d\n", i, j, k);
                        break;
                    }
                    else if(str[k]=='-')
                    {
                        k++;
                        if(str[k]>=str[k-2])
                        {
                            {
                                girl=1;
                                //printf("becoming girl here for i=%d j=%d k=%d\n", i, j, k);
                                break;
                            }
                        }
                    }
                }
            if(girl)
                g[i]++;
            else if(pizza)
                p[i]++;
            else if(taxi)
                t[i]++;
        }
    }
    taxi=0, pizza=0, girl=0;
    for(i=0; i<n; i++)
    {
        //printf("i=%d t=%d p=%d g=%d\n", i, t[i], p[i], g[i]);
        if(t[i]>taxi)
            taxi=t[i];
        if(p[i]>pizza)
            pizza=p[i];
        if(g[i]>girl)
            girl=g[i];
    }
    //printf("taxi=%d pizza=%d girl=%d\n", taxi, pizza, girl);
    printf("If you want to call a taxi, you should call: ");
    int first=0;
    for(i=0; i<n; i++)
    {
        if(t[i]==taxi)
        {
            if(!first)
            {
                first=1;
                printf("%s", name[i]);
            }
            else
                printf(", %s", name[i]);
        }
    }
    printf(".\nIf you want to order a pizza, you should call: ");
    first=0;
    for(i=0; i<n; i++)
    {
        if(p[i]==pizza)
        {
            if(!first)
            {
                first=1;
                printf("%s", name[i]);
            }
            else
                printf(", %s", name[i]);
        }
    }
    printf(".\nIf you want to go to a cafe with a wonderful girl, you should call: ");
    first=0;
    for(i=0; i<n; i++)
    {
        if(g[i]==girl)
        {
            if(!first)
            {
                first=1;
                printf("%s", name[i]);
            }
            else
                printf(", %s", name[i]);
        }
    }
    printf(".\n");
    return 0;
}


#include <stdio.h>

const int TAXI = 0;
const int GIRL = 1;
const int PIZZA = 2;

typedef struct
{
    char name [100];
    int pizza;
    int girls;
    int taxi;
} guy;

int process (char *str)
{
    int d [6];
    d [0] = str [0];
    d [1] = str [1];
    d [2] = str [3];
    d [3] = str [4];
    d [4] = str [6];
    d [5] = str [7];
    int i = 0;
    int pizza = 1;
    int taxi = 1;
    for (i = 1; i < 6; i++)
    {
        if (d [i] != d [i - 1])
            taxi = 0;
        if (d [i] >= d [i - 1])
            pizza = 0;
    }
    if (pizza)
        return PIZZA;
    if (taxi)
        return TAXI;
    return GIRL;
}

int main (void)
{
    int n = 0;
    scanf ("%d", &n);
    guy guys [100];
    int i = 0;
    char str [20];
    for (i = 0; i < n; i++)
    {
        guys [i].girls = guys [i].pizza = guys [i].taxi = 0;
        int m = 0;
        scanf ("%d", &m);
        scanf ("%s", guys [i].name);
        int j = 0;
        for (j = 0; j < m; j++)
        {
            scanf ("%s", str);
            int what = process (str);
            if (what == TAXI)
                guys [i].taxi ++;
            else if (what == PIZZA)
                guys [i].pizza ++;
            else if (what == GIRL)
                guys [i].girls ++;
        }
    }
    int max_pizza = 0;
    int max_taxi = 0;
    int max_girls = 0;
    for (i = 0; i < n; i++)
    {
        if (guys [i].pizza > max_pizza)
            max_pizza = guys [i].pizza;
        if (guys [i].girls > max_girls)
            max_girls = guys [i].girls;
        if (guys [i].taxi > max_taxi)
            max_taxi = guys [i].taxi;
    }

    printf ("If you want to call a taxi, you should call: ");
    int flag = 0;
    for (i = 0; i < n; i++)
    {
        if (guys [i].taxi == max_taxi)
        {
            if (flag)
                printf (", %s", guys [i].name);
            else
                printf ("%s", guys [i].name);
            flag = 1;
        }
    }
    printf (".\n");
    printf ("If you want to order a pizza, you should call: ");
    flag = 0;
    for (i = 0; i < n; i++)
    {
        if (guys [i].pizza == max_pizza)
        {
            if (flag)
                printf (", %s", guys [i].name);
            else
                printf ("%s", guys [i].name);
            flag = 1;
        }
    }
    printf (".\n");

    printf ("If you want to go to a cafe with a wonderful girl, you should call: ");
    flag = 0;
    for (i = 0; i < n; i++)
    {
        if (guys [i].girls == max_girls)
        {
            if (flag)
                printf (", %s", guys [i].name);
            else
                printf ("%s", guys [i].name);
            flag = 1;
        }
    }
    printf (".");

    return 0;
}


#include<stdio.h>

void merge(int a[], int p, int q, int r)
{
	int low[q-p+1], high[r-q];
	int i, j, k = p;

	for(i = 0; i <= q-p; i++, k++)
		low[i] = a[k];

	for(j = 0; j <= r-q-1; j++, k++)
		high[j] = a[k];

	i = 0;
	j = 0;
	k = p;

	while(i <= (q-p) && j <= (r-q-1))
	{
		if(low[i] > high[j])
		{
			a[k] = low[i];
			i++;
		}

		else
		{
			a[k] = high[j];
			j++;
		}

		k++;
	}

	while(i <= (q-p))
	{
		a[k] = low[i];
		i++;
		k++;
	}

	while(j <= (r-q-1))
	{
		a[k] = high[j];
		j++;
		k++;
	}
}

void mergeSort(int a[], int p, int r)
{
	if(p >= r)
		return;

	else
	{
		int q = (p+r)/2;
		mergeSort(a, p, q);
		mergeSort(a, q+1, r);
		merge(a, p, q, r);
	}

}

int main()
{
	int n;
	scanf(" %d", &n);

	int taxi[n], pizza[n], girls[n];
	int dupTaxi[n], dupPizza[n], dupGirls[n];
	int s;
	char name[n][100];

	for(int i = 0; i < n; i++)
	{
		taxi[i] = pizza[i] = girls[i] = dupTaxi[i] = dupPizza[i] = dupGirls[i] = 0;
		scanf(" %d", &s);
		scanf(" %s", name[i]);

		char number[s][9];

		for(int j = 0; j < s; j++)
		{
			scanf(" %s", number[j]);

			if(number[j][0] == number[j][1] && number[j][1] == number[j][3] && number[j][3] == number[j][4]
				&& number[j][3] == number[j][4] && number[j][4] == number[j][6] && number[j][6] == number[j][7])
			{
				taxi[i]++;
				dupTaxi[i]++;
			}

			else if(number[j][0] > number[j][1] && number[j][1] > number[j][3] && number[j][3] > number[j][4]
				&& number[j][3] > number[j][4] && number[j][4] > number[j][6] && number[j][6] > number[j][7])
			{
				pizza[i]++;
				dupPizza[i]++;
			}

			else
			{
				girls[i]++;
				dupGirls[i]++;
			}
		}
	}

	mergeSort(taxi, 0, n-1);
	mergeSort(pizza, 0, n-1);
	mergeSort(girls, 0, n-1);

	int count = 1, counter = 1;
	printf("If you want to call a taxi, you should call: ");
	for(int i = 1; i < n; i++)
	{
		if(taxi[i] == taxi[i-1])
		{
			count++;
		}

		else	break;
	}

	for(int j = 0; j < n && counter <= count; j++)
	{
		if(dupTaxi[j] == taxi[0])
		{
			printf("%s", name[j]);
			counter++;
			if(counter <= count)	printf(", ");
		}

	}

	printf(".\n");

	count = 1; counter = 1;

	printf( "If you want to order a pizza, you should call: ");
	for(int i = 1; i < n; i++)
	{
		if(pizza[i] == pizza[i-1])
		{
			count++;
		}

		else	break;
	}

	for(int j = 0; j < n && counter <= count; j++)
	{
		if(dupPizza[j] == pizza[0])
		{
			printf("%s", name[j]);
			counter++;
			if(counter <= count)	printf(", ");
		}
	}

	printf(".\n");

	count = 1; counter = 1;

	printf("If you want to go to a cafe with a wonderful girl, you should call: ");

	for(int i = 1; i < n; i++)
	{
		if(girls[i] == girls[i-1])
		{
			count++;
		}

		else	break;
	}

	for(int j = 0; j < n && counter <= count; j++)
	{
		if(dupGirls[j] == girls[0])
		{
			printf("%s", name[j]);
			counter++;
			if(counter <= count)	printf(", ");
		}
	}

	printf(".\n");
	return 0;
}


#include <stdio.h>

typedef struct {
    int girl;
    int pizza;
    int taxi;
    int no;
    char name[21];
} Node;
Node f[101];

int girl(const void *a, const void *b)
{
    if((*(Node *)a).girl != (*(Node *)b).girl)
        return (*(Node *)a).girl > (*(Node *)b).girl ? -1 : 1;
    else
        return (*(Node *)a).no - (*(Node *)b).no;
}

int taxi(const void *a, const void *b)
{
    if((*(Node *)a).taxi != (*(Node *)b).taxi)
        return (*(Node *)a).taxi > (*(Node *)b).taxi ? -1 : 1;
    else
        return (*(Node *)a).no - (*(Node *)b).no;
}

int pizza(const void *a, const void *b)
{
    if((*(Node *)a).pizza != (*(Node *)b).pizza)
        return (*(Node *)a).pizza > (*(Node *)b).pizza ? -1 : 1;
    else
        return (*(Node *)a).no - (*(Node *)b).no;
}

int main()
{
    int n, friends;
    int i, j;
    char str[9];
    char c1, c2;
    int flag;
    int mgirl, mtaxi, mpizza;

    scanf("%d", &friends);

    for(i = 0; i < friends; i++) {
        scanf("%d%s", &n, f[i].name);
        f[i].no = i + 1;
        f[i].girl = f[i].pizza = f[i].taxi = 0;
        while(n--) {
            scanf("%s", str);

            c1 = str[0];
            for(j = 1, flag = 0; j < 8; j++) {
                if(str[j] == '-')
                    continue;
                c2 = str[j];
                if(c1 == c2)
                    flag = 1;
                 else {
                     flag = 0;
                     break;
                 }
                 c1 = c2;
            }
            if(flag == 1) {
                f[i].taxi++;
                continue;
            }

            c1 = str[0];
            for(j = 1, flag = 0; j < 8; j++) {
                if(str[j] == '-')
                    continue;
                c2 = str[j];
                if(c1 > c2)
                    flag = 1;
                 else {
                     flag = 0;
                     break;
                 }
                 c1 = c2;
            }
            if(flag == 1) {
                f[i].pizza++;
                continue;
             }

            f[i].girl++;
        }
    }

    qsort(f, friends, sizeof(f[0]), taxi);
    mtaxi = f[0].taxi;
    i = 0;
    printf("If you want to call a taxi, you should call: ");
    while(f[i].taxi == mtaxi && i < friends) {
        if(i == 0)
            printf("%s", f[i].name);
        else
            printf(", %s", f[i].name);
        i++;
    }
    printf(".\n");

    qsort(f, friends, sizeof(f[0]), pizza);
    mpizza = f[0].pizza;
    i = 0;
    printf("If you want to order a pizza, you should call: ");
    while(f[i].pizza == mpizza && i < friends) {
        if(i == 0)
            printf("%s", f[i].name);
        else
            printf(", %s", f[i].name);
        i++;
    }
    printf(".\n");

    qsort(f, friends, sizeof(f[0]), girl);
    mgirl = f[0].girl;
    i = 0;
    printf("If you want to go to a cafe with a wonderful girl, you should call: ");
    while(f[i].girl == mgirl && i < friends) {
        if(i == 0)
            printf("%s", f[i].name);
        else
            printf(", %s", f[i].name);
        i++;
    }
    printf(".\n");

    return 0;
}


#include <stdio.h>

typedef struct {
     char s[21];
     int a;
     int b;
     int c;
} friend;

int main()
{
     int n, max, f, i, j, k;
     friend a[100];

     scanf("%d", &n);

     for (i = 0; i < n; i++) {
	  int c;

	  scanf("%d %s", &c, a[i].s);

	  a[i].a = a[i].b = a[i].c = 0;

	  for (j = 0; j < c; j++) {
	       char s[10];
	       int b[6];

	       scanf("%s", s);

	       for (k = 0; k < 6; k++) {
		    b[k] = s[k + k / 2];
	       }

	       for (k = 0; k < 5; k++) {
		    if (b[k] != b[k + 1]) break;
	       }

	       if (k == 5) {
		    a[i].a++;

		    continue;
	       }

	       for (k = 0; k < 5; k++) {
		    if (b[k] <= b[k + 1]) break;
	       }

	       if (k == 5) {
		    a[i].b++;
	       } else {
		    a[i].c++;
	       }
	  }
     }

     max = f = 0;

     for (i = 0; i < n; i++) {
	  if (a[i].a > max) max = a[i].a;
     }

     printf("If you want to call a taxi, you should call: ");

     for (i = 0; i < n; i++) {
	  if (a[i].a == max) {
	       if (f == 0) {
		    printf("%s", a[i].s);
	       } else {
		    printf(", %s", a[i].s);
	       }

	       f = 1;
	  }
     }

     puts(".");

     max = f = 0;

     for (i = 0; i < n; i++) {
	  if (a[i].b > max) max = a[i].b;
     }

     printf("If you want to order a pizza, you should call: ");

     for (i = 0; i < n; i++) {
	  if (a[i].b == max) {
	       if (f == 0) {
		    printf("%s", a[i].s);
	       } else {
		    printf(", %s", a[i].s);
	       }

	       f = 1;
	  }
     }

     puts(".");

     max = f = 0;

     for (i = 0; i < n; i++) {
	  if (a[i].c > max) max = a[i].c;
     }

     printf("If you want to go to a cafe with a wonderful girl, you should call: ");

     for (i = 0; i < n; i++) {
	  if (a[i].c == max) {
	       if (f == 0) {
		    printf("%s", a[i].s);
	       } else {
		    printf(", %s", a[i].s);
	       }

	       f = 1;
	  }
     }

     puts(".");

     return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct _friend {
  char name[21];
  int t, p, g;
} friend;

int main() {
  int n, si;
  friend *friends[100];
  int maxt, maxp, maxg;
  friend *tmp;
  int i, j;
  char t[9];
  char taxi[100][21], pizza[100][21], girl[100][21];
  int ti, pi, gi;

  maxt = maxp = maxg = 0;

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    tmp = malloc(sizeof(friend));
    friends[i] = tmp;
    tmp->t = tmp->p = tmp->g = 0;
    scanf("%d%s", &si, tmp->name);
    for (j = 0; j < si; j++) {
      scanf("%s", t);
      if (t[0] == t[1] && t[1] == t[3] && t[3] == t[4] && t[4] == t[6] && t[6] == t[7]) {
	puts("taxi");
	tmp->t++;
      } else if (t[0] > t[1] && t[1] > t[3] && t[3] > t[4] && t[4] > t[6] && t[6] > t[7]) {
	puts("pizza");
	tmp->p++;
      } else {
	puts("girl");
	tmp->g++;
      }
    }
    maxt = (tmp->t > maxt) ? tmp->t : maxt;
    maxp = (tmp->p > maxp) ? tmp->p : maxp;
    maxg = (tmp->g > maxg) ? tmp->g : maxg;
  }

  ti = pi = gi = 0;
  for (i = 0; i < n; i++) {
    if (friends[i]->t == maxt) {
      strcpy(taxi[ti], friends[i]->name);
      ti++;
    }
    if (friends[i]->p == maxp) {
      strcpy(pizza[pi], friends[i]->name);
      pi++;
    }
    if (friends[i]->g == maxg) {
      strcpy(girl[gi], friends[i]->name);
      gi++;
    }
  }

  printf("If you want to call a taxi, you should call: ");
  for (i = 0; i < ti; i++) {
    printf("%s", taxi[i]);
    if (i == ti-1) printf(".\n");
    else printf(", ");
  }
  printf("If you want to order a pizza, you should call: ");
  for (i = 0; i < pi; i++) {
    printf("%s", pizza[i]);
    if (i == pi-1) printf(".\n");
    else printf(", ");
  }
  printf("If you want to go to a cafe with a wonderful girl, you should call: ");
  for (i = 0; i < gi; i++) {
    printf("%s", girl[i]);
    if (i == gi-1) printf(".\n");
    else printf(", ");
  }

  return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct _friend {
  char name[21];
  int t, p, g;
} friend;

int main() {
  int n, si;
  friend *friends[100];
  int maxt, maxp, maxg;
  friend *tmp;
  int i, j;
  char t[9];
  char taxi[100][21], pizza[100][21], girl[100][21];
  int ti, pi, gi;

  maxt = maxp = maxg = 0;

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    tmp = malloc(sizeof(friend));
    friends[i] = tmp;
    tmp->t = tmp->p = tmp->g = 0;
    scanf("%d%s", &si, tmp->name);
    for (j = 0; j < si; j++) {
      scanf("%s", t);
      if (t[0] == t[1] && t[1] == t[3] && t[3] == t[4] && t[4] == t[6] && t[6] == t[7]) {
	tmp->t++;
      } else if (t[0] > t[1] && t[1] > t[3] && t[3] > t[4] && t[4] > t[6] && t[6] > t[7]) {
	tmp->p++;
      } else {
	tmp->g++;
      }
    }
    maxt = (tmp->t > maxt) ? tmp->t : maxt;
    maxp = (tmp->p > maxp) ? tmp->p : maxp;
    maxg = (tmp->g > maxg) ? tmp->g : maxg;
  }

  ti = pi = gi = 0;
  for (i = 0; i < n; i++) {
    if (friends[i]->t == maxt) {
      strcpy(taxi[ti], friends[i]->name);
      ti++;
    }
    if (friends[i]->p == maxp) {
      strcpy(pizza[pi], friends[i]->name);
      pi++;
    }
    if (friends[i]->g == maxg) {
      strcpy(girl[gi], friends[i]->name);
      gi++;
    }
  }

  printf("If you want to call a taxi, you should call: ");
  for (i = 0; i < ti; i++) {
    printf("%s", taxi[i]);
    if (i == ti-1) printf(".\n");
    else printf(", ");
  }
  printf("If you want to order a pizza, you should call: ");
  for (i = 0; i < pi; i++) {
    printf("%s", pizza[i]);
    if (i == pi-1) printf(".\n");
    else printf(", ");
  }
  printf("If you want to go to a cafe with a wonderful girl, you should call: ");
  for (i = 0; i < gi; i++) {
    printf("%s", girl[i]);
    if (i == gi-1) printf(".\n");
    else printf(", ");
  }

  return 0;
}


#include<stdio.h>
struct directory
{
	char s[20];
	int taxi;
	int pizza;
	int callgirl;
};
typedef struct directory d;
int find(char s[])
{	int i=1;
	char num=s[0]; int count=0;
	while(s[i]!='\0')
	{     if(s[i]==num)
		     count++;
		     i++;
	}
	if(count==5)
		return 1;
	int min=s[0]; int flag=0; i=1;
	while(s[i]!='\0')
	{
		if(s[i]=='-')
		{	i++;
			continue;
		}
		if(s[i]<min)
		{	min=s[i];
			i++;
			continue;
		}
		else
		{	flag=1;
			break;
		}
		i++;
	}
	if(flag==0)
		return 2;
	else
		return 3;
}
int main()
{
	int cases;
	scanf("%d",&cases); int i;
	d dir[100];
	int maxtaxi=-1,maxpizza=-1,maxcallgirl=-1;
	for(i=0;i<cases;i++)
	{
		int records; char dummy;
		scanf("%d%c%s",&records,&dummy,dir[i].s);
		dir[i].taxi=0;dir[i].pizza=0; dir[i].callgirl=0;
		while(records > 0)
		{
			char phone[10];
			scanf("%s",phone);
			int temp=find(phone);
			if(temp==1)
				dir[i].taxi++;
			else if(temp==2)
				dir[i].pizza++;
			else if (temp==3)
				dir[i].callgirl++;
			records --;
		}
		if(dir[i].taxi > maxtaxi)
			maxtaxi=dir[i].taxi;
		if(dir[i].pizza > maxpizza)
			maxpizza=dir[i].pizza;
		if(dir[i].callgirl > maxcallgirl)
			maxcallgirl=dir[i].callgirl;
	}
//	print(dir[0]);print(dir[1]);print(dir[2]);print(dir[3]);
	printf("If you want to call a taxi, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].taxi==maxtaxi)
			printf(" %s",dir[i].s);
	printf("\nIf you want to order a pizza, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].pizza==maxpizza)
			printf(" %s",dir[i].s);
	printf("\nIf you want to go to a cafe with a wonderful girl, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].callgirl==maxcallgirl)
			printf(" %s",dir[i].s);
	printf("\n");
	return 0;
}


#include<stdio.h>
struct directory
{
	char s[50];
	int taxi;
	int pizza;
	int callgirl;
};
typedef struct directory d;
int find(char s[])
{	int i=1;
	char num=s[0]; int count=0;
	while(s[i]!='\0')
	{     if(s[i]==num)
		     count++;
		     i++;
	}
	if(count==5)
		return 1;
	int min=s[0]; int flag=0; i=1;
	while(s[i]!='\0')
	{
		if(s[i]=='-')
		{	i++;
			continue;
		}
		if(s[i]<min)
		{	min=s[i];
			i++;
			continue;
		}
		else
		{	flag=1;
			break;
		}
		i++;
	}
	if(flag==0)
		return 2;
	else
		return 3;
}
void print(d dir)
{
	printf("%s\n",dir.s);
	printf("%d\n",dir.taxi);
	printf("%d\n",dir.pizza);
	printf("%d\n",dir.callgirl);
}
int main()
{
	int cases;
	scanf("%d",&cases); int i;
	d dir[100];
	int maxtaxi=-1,maxpizza=-1,maxcallgirl=-1;
	for(i=0;i<cases;i++)
	{
		int records; char dummy;
		scanf("%d%c%s",&records,&dummy,dir[i].s);
		dir[i].taxi=0;dir[i].pizza=0; dir[i].callgirl=0;
		while(records > 0)
		{
			char phone[10];
			scanf("%s",phone);
			int temp=find(phone);
			if(temp==1)
				dir[i].taxi++;
			else if(temp==2)
				dir[i].pizza++;
			else if (temp==3)
				dir[i].callgirl++;
			records --;
		}
		if(dir[i].taxi > maxtaxi)
			maxtaxi=dir[i].taxi;
		if(dir[i].pizza > maxpizza)
			maxpizza=dir[i].pizza;
		if(dir[i].callgirl > maxcallgirl)
			maxcallgirl=dir[i].callgirl;
	}
//	print(dir[0]);print(dir[1]);print(dir[2]);print(dir[3]);
	printf("If you want to call a taxi, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].taxi==maxtaxi)
			printf(" %s",dir[i].s);
	printf("\nIf you want to order a pizza, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].pizza==maxpizza)
			printf(" %s",dir[i].s);
	printf("\nIf you want to go to a cafe with a wonderful girl, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].callgirl==maxcallgirl)
			printf(" %s",dir[i].s);
	printf("\n");
}


#include<stdio.h>
struct directory
{
	char s[30];
	int taxi;
	int pizza;
	int callgirl;
};
typedef struct directory d;
int find(char s[])
{	int i=1;
	char num=s[0]; int count=0;
	while(s[i]!='\0')
	{     if(s[i]==num)
		     count++;
		     i++;
	}
	if(count==5)
		return 1;
	int min=s[0]; int flag=0; i=1;
	while(s[i]!='\0')
	{
		if(s[i]=='-')
		{	i++;
			continue;
		}
		if(s[i]<min)
		{	min=s[i];
			i++;
			continue;
		}
		else
		{	flag=1;
			break;
		}
		i++;
	}
	if(flag==0)
		return 2;
	else
		return 3;
}
int main()
{
	int cases;
	scanf("%d",&cases); int i;
	d dir[200];
	int maxtaxi=-1,maxpizza=-1,maxcallgirl=-1;
	for(i=0;i<cases;i++)
	{
		int records; char dummy;
		scanf("%d%c%s",&records,&dummy,dir[i].s);
		dir[i].taxi=0;dir[i].pizza=0; dir[i].callgirl=0;
		while(records > 0)
		{
			char phone[10];
			scanf("%s",phone);
			int temp=find(phone);
			if(temp==1)
				dir[i].taxi++;
			else if(temp==2)
				dir[i].pizza++;
			else if (temp==3)
				dir[i].callgirl++;
			records --;
		}
		if(dir[i].taxi > maxtaxi)
			maxtaxi=dir[i].taxi;
		if(dir[i].pizza > maxpizza)
			maxpizza=dir[i].pizza;
		if(dir[i].callgirl > maxcallgirl)
			maxcallgirl=dir[i].callgirl;
	}
//	print(dir[0]);print(dir[1]);print(dir[2]);print(dir[3]);
	int flag=0;
	printf("If you want to call a taxi, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].taxi==maxtaxi)
			if(flag==0){printf(" %s",dir[i].s); flag=1;}
			else printf(", %s",dir[i].s);
	flag=0;
	printf(".\nIf you want to order a pizza, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].pizza==maxpizza)
			if(flag==0){printf(" %s",dir[i].s);flag=1;}
			else printf(", %s",dir[i].s);
	flag=0;
	printf(".\nIf you want to go to a cafe with a wonderful girl, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].callgirl==maxcallgirl)
			if(flag==0){printf(" %s",dir[i].s); flag=1;}
			else printf(", %s",dir[i].s);
	printf(".\n");
	return 0;
}


#include<stdio.h>
struct directory
{
	char s[20];
	int taxi;
	int pizza;
	int callgirl;
};
typedef struct directory d;
int find(char s[])
{	int i=1;
	char num=s[0]; int count=0;
	while(s[i]!='\0')
	{     if(s[i]==num)
		     count++;
		     i++;
	}
	if(count==5)
		return 1;
	int min=s[0]; int flag=0; i=1;
	while(s[i]!='\0')
	{
		if(s[i]=='-')
		{	i++;
			continue;
		}
		if(s[i]<min)
		{	min=s[i];
			i++;
			continue;
		}
		else
		{	flag=1;
			break;
		}
		i++;
	}
	if(flag==0)
		return 2;
	else
		return 3;
}
int main()
{
	int cases;
	scanf("%d",&cases); int i;
	d dir[100];
	int maxtaxi=-1,maxpizza=-1,maxcallgirl=-1;
	for(i=0;i<cases;i++)
	{
		int records; char dummy;
		scanf("%d%c%s",&records,&dummy,dir[i].s);
		dir[i].taxi=0;dir[i].pizza=0; dir[i].callgirl=0;
		while(records > 0)
		{
			char phone[10];
			scanf("%s",phone);
			int temp=find(phone);
			if(temp==1)
				dir[i].taxi++;
			else if(temp==2)
				dir[i].pizza++;
			else if (temp==3)
				dir[i].callgirl++;
			records --;
		}
		if(dir[i].taxi > maxtaxi)
			maxtaxi=dir[i].taxi;
		if(dir[i].pizza > maxpizza)
			maxpizza=dir[i].pizza;
		if(dir[i].callgirl > maxcallgirl)
			maxcallgirl=dir[i].callgirl;
	}
//	print(dir[0]);print(dir[1]);print(dir[2]);print(dir[3]);
	printf("If you want to call a taxi, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].taxi==maxtaxi)
			printf(" %s",dir[i].s);
	printf(".\nIf you want to order a pizza, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].pizza==maxpizza)
			printf(" %s",dir[i].s);
	printf(".\nIf you want to go to a cafe with a wonderful girl, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].callgirl==maxcallgirl)
			printf(" %s",dir[i].s);
	printf(".\n");
	return 0;
}


#include<stdio.h>
struct directory
{
	char s[20];
	int taxi;
	int pizza;
	int callgirl;
};
typedef struct directory d;
int find(char s[])
{	int i=1;
	char num=s[0]; int count=0;
	while(s[i]!='\0')
	{     if(s[i]==num)
		     count++;
		     i++;
	}
	if(count==5)
		return 1;
	int min=s[0]; int flag=0; i=1;
	while(s[i]!='\0')
	{
		if(s[i]=='-')
		{	i++;
			continue;
		}
		if(s[i]<min)
		{	min=s[i];
			i++;
			continue;
		}
		else
		{	flag=1;
			break;
		}
		i++;
	}
	if(flag==0)
		return 2;
	else
		return 3;
}
int main()
{
	int cases;
	scanf("%d",&cases); int i;
	d dir[100];
	int maxtaxi=-1,maxpizza=-1,maxcallgirl=-1;
	for(i=0;i<cases;i++)
	{
		int records; char dummy;
		scanf("%d%c%s",&records,&dummy,dir[i].s);
		dir[i].taxi=0;dir[i].pizza=0; dir[i].callgirl=0;
		while(records > 0)
		{
			char phone[10];
			scanf("%s",phone);
			int temp=find(phone);
			if(temp==1)
				dir[i].taxi++;
			else if(temp==2)
				dir[i].pizza++;
			else if (temp==3)
				dir[i].callgirl++;
			records --;
		}
		if(dir[i].taxi > maxtaxi)
			maxtaxi=dir[i].taxi;
		if(dir[i].pizza > maxpizza)
			maxpizza=dir[i].pizza;
		if(dir[i].callgirl > maxcallgirl)
			maxcallgirl=dir[i].callgirl;
	}
//	print(dir[0]);print(dir[1]);print(dir[2]);print(dir[3]);
	int flag=0;
	printf("If you want to call a taxi, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].taxi==maxtaxi)
			if(flag==0){printf(" %s",dir[i].s); flag=1;}
			else printf(", %s",dir[i].s);
	flag=0;
	printf(".\nIf you want to order a pizza, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].pizza==maxpizza)
			if(flag==0){printf(" %s",dir[i].s);flag=1;}
			else printf(", %s",dir[i].s);
	flag=0;
	printf(".\nIf you want to go to a cafe with a wonderful girl, you should call:");
	for(i=0;i<cases;i++)
		if(dir[i].callgirl==maxcallgirl)
			if(flag==0){printf(" %s",dir[i].s); flag=1;}
			else printf(", %s",dir[i].s);
	printf(".\n");
	return 0;
}


#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main()
{
     int n,i,j;
     scanf("%d",&n);
     int count[100][3]={0};
     int tk[n],mt=0,mp=0,md=0,f;
     char spis[n][100][10],name[n][21];
     for(i=0;i<n;i++)
     {
         scanf("%d%s",&tk[i],name[i]);
         for(j=0;j<tk[i];j++)
         {
             scanf("%s",spis[i][j]);
             if(spis[i][j][0]==spis[i][j][1]&&spis[i][j][0]==spis[i][j][3]&&
             spis[i][j][0]==spis[i][j][4]&&spis[i][j][0]==spis[i][j][6]&&
             spis[i][j][0]==spis[i][j][7])
             {
                 count[i][0]++;
             }
             else
             {
                 if(spis[i][j][0]>spis[i][j][1]&&spis[i][j][1]>spis[i][j][3]&&
                 spis[i][j][3]>spis[i][j][4]&&spis[i][j][4]>spis[i][j][6]&&
                 spis[i][j][6]>spis[i][j][7])
                 {
                     count[i][1]++;
                 }
                 else
                     count[i][2]++;
             }
         }
         if(count[i][0]>mt)
             mt=count[i][0];
         if(count[i][1]>mp)
             mp=count[i][1];
         if(count[i][2]>md)
             md=count[i][2];
     }
     printf("If you want to call a taxi, you should call: ");
     f=1;
     for(i=0;i<n;i++)
     {
         if(count[i][0]==mt)
         {
             if(f)
             {
                 f=0;
                 printf("%s",name[i]);
             }
             else
                 printf(", %s",name[i]);
         }
     }
     printf(".\n");

     printf("If you want to order a pizza, you should call: ");
     f=1;
     for(i=0;i<n;i++)
     {
         if(count[i][1]==mp)
         {
             if(f)
             {
                 f=0;
                 printf("%s",name[i]);
             }
             else
                 printf(", %s",name[i]);
         }
     }
     printf(".\n");

     printf("If you want to go to a cafe with a wonderful girl, you should call: ");
     f=1;
     for(i=0;i<n;i++)
     {
         if(count[i][2]==md)
         {
             if(f)
             {
                 f=0;
                 printf("%s",name[i]);
             }
             else
                 printf(", %s",name[i]);
         }
     }
     printf(".");
     return 0;
}


#include <stdio.h>
#include <string.h>

static struct count {
	int t, p, g;
	char name[21];
} cc[100];

int taxi(char *s) {
	return s[0] == s[1] && s[1] == s[3] &&
		s[3] == s[4] && s[4] == s[6] && s[6] == s[7];
}

int pizza(char *s) {
	return s[0] > s[1] && s[1] > s[3] &&
		s[3] > s[4] && s[4] > s[6] && s[6] > s[7];
}

int main() {
	int i, j, n, s, tmax, pmax, gmax, tfirst, pfirst, gfirst;
	static char phone[9];

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %s", &s, cc[i].name);
		cc[i].t = cc[i].p = cc[i].g = 0;
		for (j = 0; j < s; j++) {
			scanf("%s", phone);
			if (taxi(phone))
				cc[i].t++;
			else if (pizza(phone))
				cc[i].p++;
			else
				cc[i].g++;
		}
	}
	tmax = pmax = gmax = 0;
	for (i = 0; i < n; i++) {
		if (tmax < cc[i].t)
			tmax = cc[i].t;
		if (pmax < cc[i].p)
			pmax = cc[i].p;
		if (gmax < cc[i].g)
			gmax = cc[i].g;
	}
	printf("If you want to call a taxi, you should call:");
	tfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].t == tmax) {
			printf("%c%s", (tfirst ? ',' : ' '), cc[i].name);
			tfirst = 1;
		}
	printf(".\n");
	printf("If you want to order a pizza, you should call:");
	pfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].p == pmax) {
			printf("%s%s", (pfirst ? ", " : " "), cc[i].name);
			pfirst = 1;
		}
	printf(".\n");
	printf("If you want to go to a cafe with a wonderful girl, you should call:");
	gfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].g == gmax) {
			printf("%c%s", (gfirst ? ',' : ' '), cc[i].name);
			gfirst = 1;
		}
	printf(".\n");
	return 0;
}


#include <stdio.h>
#include <string.h>

static struct count {
	int t, p, g;
	char name[21];
} cc[100];

int taxi(char *s) {
	return s[0] == s[1] && s[1] == s[3] &&
		s[3] == s[4] && s[4] == s[6] && s[6] == s[7];
}

int pizza(char *s) {
	return s[0] > s[1] && s[1] > s[3] &&
		s[3] > s[4] && s[4] > s[6] && s[6] > s[7];
}

int main() {
	int i, j, n, s, tmax, pmax, gmax, tfirst, pfirst, gfirst;
	static char phone[9];

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %s", &s, cc[i].name);
		cc[i].t = cc[i].p = cc[i].g = 0;
		for (j = 0; j < s; j++) {
			scanf("%s", phone);
			if (taxi(phone))
				cc[i].t++;
			else if (pizza(phone))
				cc[i].p++;
			else
				cc[i].g++;
		}
	}
	tmax = pmax = gmax = 0;
	for (i = 0; i < n; i++) {
		if (tmax < cc[i].t)
			tmax = cc[i].t;
		if (pmax < cc[i].p)
			pmax = cc[i].p;
		if (gmax < cc[i].g)
			gmax = cc[i].g;
	}
	printf("If you want to call a taxi, you should call:");
	tfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].t == tmax) {
			printf("%c%s", (tfirst ? ',' : ' '), cc[i].name);
			tfirst = 1;
		}
	printf(".\n");
	printf("If you want to order a pizza, you should call:");
	pfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].p == pmax) {
			printf("%s%s", (pfirst ? ", " : " "), cc[i].name);
			pfirst = 1;
		}
	printf(".\n");
	printf("If you want go to a cafe with a wonderful girl, you should call:");
	gfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].g == gmax) {
			printf("%c%s", (gfirst ? ',' : ' '), cc[i].name);
			gfirst = 1;
		}
	printf(".\n");
	return 0;
}


#include <stdio.h>
#include <string.h>

static struct count {
	int t, p, g;
	char name[21];
} cc[100];

int taxi(char *s) {
	return s[0] == s[1] && s[1] == s[3] &&
		s[3] == s[4] && s[4] == s[6] && s[6] == s[7];
}

int pizza(char *s) {
	return s[0] > s[1] && s[1] > s[3] &&
		s[3] > s[4] && s[4] > s[6] && s[6] > s[7];
}

int main() {
	int i, j, n, s, tmax, pmax, gmax, tfirst, pfirst, gfirst;
	static char phone[9];

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %s", &s, cc[i].name);
		cc[i].t = cc[i].p = cc[i].g = 0;
		for (j = 0; j < s; j++) {
			scanf("%s", phone);
			if (taxi(phone))
				cc[i].t++;
			else if (pizza(phone))
				cc[i].p++;
			else
				cc[i].g++;
		}
	}
	tmax = pmax = gmax = 0;
	for (i = 0; i < n; i++) {
		if (tmax < cc[i].t)
			tmax = cc[i].t;
		if (pmax < cc[i].p)
			pmax = cc[i].p;
		if (gmax < cc[i].g)
			gmax = cc[i].g;
	}
	printf("If you want to call a taxi, you should call:");
	tfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].t == tmax) {
			printf("%s%s", (tfirst ? ", " : " "), cc[i].name);
			tfirst = 1;
		}
	printf(".\n");
	printf("If you want to order a pizza, you should call:");
	pfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].p == pmax) {
			printf("%s%s", (pfirst ? ", " : " "), cc[i].name);
			pfirst = 1;
		}
	printf(".\n");
	printf("If you want to go to a cafe with a wonderful girl, you should call:");
	gfirst = 0;
	for (i = 0; i < n; i++)
		if (cc[i].g == gmax) {
			printf("%s%s", (gfirst ? ", " : " "), cc[i].name);
			gfirst = 1;
		}
	printf(".\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
int main ()
{
    int d,e,f,g,h,i,j,k,kk,kkk,l,m,n,taxi=0,pizza=0,girls=0,first=1,second=1,third=1,ll,lll;
    char o[25],p[10],z[2500],zz[2500],zzz[2500],komuna[]=", ",ajaira,a,b,c,okola,aa,bb,cc,y,yy;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%c%s",&m,&ajaira,o);
        for(j=0;j<m;j++)
        {
            scanf("%c%c%c%c%c%c%c%c%c",&okola,&a,&aa,&y,&b,&bb,&yy,&c,&cc);
            if(a==aa && aa==b && b==bb && bb==c && c==cc)taxi++;
            else if(a>aa && aa>b && b>bb && bb>c && c>cc)pizza++;
            else girls++;
        }
        if(second==1)
        {
            strcpy(zz,o);
            kk=pizza;
            second=0;
        }
        else
        {
            if(kk<pizza)zz[0]='\0',strcpy(zz,o),kk=pizza;
            else
            {
                if(kk==pizza)
                {
                    strcat(zz,komuna);
                    strcat(zz,o);
                }
            }
        }
        if(third==1)
        {
            strcpy(zzz,o);
            kkk=girls;
            third=0;
        }
        else
        {
            if(kkk<girls)zzz[0]='\0',strcpy(zzz,o),kkk=girls;
            else
            {
                if(kkk==girls)
                {
                    strcat(zzz,komuna);
                    strcat(zzz,o);
                }
            }
        }
        if(first==1)
        {
            strcpy(z,o);
            k=taxi;
            first=0;
        }
        else
        {
            if(k<taxi)z[0]='\0',strcpy(z,o),k=taxi;
            else
            {
                if(k==taxi)
                {
                    strcat(z,komuna);
                    strcat(z,o);
                }
            }
        }
        taxi=0;
        pizza=0;
        girls=0;
    }
    l=strlen(z);
    ll=strlen(zz);
    lll=strlen(zzz);
    z[l]='.';
    zz[ll]='.';
    zzz[lll]='.';
    z[l+1]='\0';
    zz[ll+1]='\0';
    zzz[lll+1]='\0';
    printf("If you want to call a taxi, you should call: ");
    puts(z);
    printf("If you want to order a pizza, you should call: ");
    puts(zz);
    printf("If you want to go to a cafe with a wonderful girl, you should call: ");
    puts(zzz);
    return 0;
}


#include <stdio.h>

typedef struct
{
    char m_Name[20];
    int  m_taxi,m_pizza,m_girl;
} Preson_t;
Preson_t P[100];

int main()
{
    int N,M,a,b,c,Taxi,Pizza,Girl,i;
    char flag;
    scanf("%d",&N);
    for(i=0; i<N; ++i)
    {
        scanf("%d %s",&M,P[i].m_Name);
        while(M--)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b&&b==c&&a/10==a%10)
            {
                ++P[i].m_taxi;
            }
            else if(a>b&&b>c&&a/10!=a%10&&b/10>b%10&&c/10>c%10)
            {
                ++P[i].m_pizza;
            }
            else
            {
                ++P[i].m_girl;
            }
        }
    }
    Taxi=Pizza=Girl=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi>Taxi)
        {
            Taxi=P[i].m_taxi;
        }
        if(P[i].m_pizza>Pizza)
        {
            Pizza=P[i].m_pizza;
        }
        if(P[i].m_girl>Girl)
        {
            Girl=P[i].m_girl;
        }
    }
    printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi==Taxi)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_pizza==Pizza)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_girl==Girl)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    return 0;
}


#include <stdio.h>

typedef struct
{
    char m_Name[21];
    int  m_taxi,m_pizza,m_girl;
} Preson_t;
Preson_t P[100];

int main()
{
    int N,M,a,b,c,Taxi,Pizza,Girl,i;
    char flag;
    scanf("%d",&N);
    for(i=0; i<N; ++i)
    {
        scanf("%d %s",&M,P[i].m_Name);
        while(M--)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b&&b==c&&a/10==a%10)
            {
                ++P[i].m_taxi;
            }
            else if(a>b&&b>c&&a/10>a%10&&b/10>b%10&&c/10>c%10&&a%10>b/10&&b%10>c/10)
            {
                ++P[i].m_pizza;
            }
            else
            {
                ++P[i].m_girl;
            }
        }
    }
    Taxi=Pizza=Girl=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi>Taxi)
        {
            Taxi=P[i].m_taxi;
        }
        if(P[i].m_pizza>Pizza)
        {
            Pizza=P[i].m_pizza;
        }
        if(P[i].m_girl>Girl)
        {
            Girl=P[i].m_girl;
        }
    }
    printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi==Taxi)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_pizza==Pizza)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_girl==Girl)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    return 0;
}


#include <stdio.h>

typedef struct
{
    char m_Name[21];
    int  m_taxi,m_pizza,m_girl;
} Preson_t;
Preson_t P[100];

int main()
{
    int N,M,a,b,c,Taxi,Pizza,Girl,i;
    char flag;
    scanf("%d",&N);
    for(i=0; i<N; ++i)
    {
        scanf("%d %s",&M,P[i].m_Name);
        while(M--)
        {
            scanf("%d-%d-%d",&a,&b,&c);
            if(a==b&&b==c&&a/10==a%10)
            {
                ++P[i].m_taxi;
            }
            else if(a>b&&b>c&&a/10!=a%10&&b/10!=b%10&&c/10!=c%10)
            {
                ++P[i].m_pizza;
            }
            else
            {
                ++P[i].m_girl;
            }
        }
    }
    Taxi=Pizza=Girl=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi>Taxi)
        {
            Taxi=P[i].m_taxi;
        }
        if(P[i].m_pizza>Pizza)
        {
            Pizza=P[i].m_pizza;
        }
        if(P[i].m_girl>Girl)
        {
            Girl=P[i].m_girl;
        }
    }
    printf("If you want to call a taxi, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_taxi==Taxi)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to order a pizza, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_pizza==Pizza)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    flag=0;
    for(i=0; i<N; ++i)
    {
        if(P[i].m_girl==Girl)
        {
            if(flag)
            {
                printf(",");
            }
            printf(" %s",P[i].m_Name);
            flag=1;
        }
    }
    printf(".\n");
    return 0;
}