← Home
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func classify(s string) int {
	d := make([]byte, 0, 6)
	for i := 0; i < len(s); i++ {
		if s[i] != '-' {
			d = append(d, s[i])
		}
	}

	taxi := true
	for i := 1; i < 6; i++ {
		if d[i] != d[0] {
			taxi = false
			break
		}
	}
	if taxi {
		return 0
	}

	pizza := true
	for i := 1; i < 6; i++ {
		if d[i-1] <= d[i] {
			pizza = false
			break
		}
	}
	if pizza {
		return 1
	}

	return 2
}

func winners(names []string, counts []int) string {
	mx := -1
	for _, v := range counts {
		if v > mx {
			mx = v
		}
	}
	res := make([]string, 0)
	for i, v := range counts {
		if v == mx {
			res = append(res, names[i])
		}
	}
	return strings.Join(res, ", ")
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var n int
	fmt.Fscan(in, &n)

	names := make([]string, n)
	taxiCounts := make([]int, n)
	pizzaCounts := make([]int, n)
	girlCounts := make([]int, n)

	for i := 0; i < n; i++ {
		var s int
		fmt.Fscan(in, &s, &names[i])
		for j := 0; j < s; j++ {
			var num string
			fmt.Fscan(in, &num)
			switch classify(num) {
			case 0:
				taxiCounts[i]++
			case 1:
				pizzaCounts[i]++
			default:
				girlCounts[i]++
			}
		}
	}

	fmt.Fprintf(out, "If you want to call a taxi, you should call: %s.\n", winners(names, taxiCounts))
	fmt.Fprintf(out, "If you want to order a pizza, you should call: %s.\n", winners(names, pizzaCounts))
	fmt.Fprintf(out, "If you want to go to a cafe with a wonderful girl, you should call: %s.\n", winners(names, girlCounts))
}