<?php
//[$n,$m] = array_map('intval', explode(' ', trim(fgets(STDIN))));
[$n] = array_map('intval', explode(' ', trim(fgets(STDIN))));
//$a = array_map('intval', explode(' ', trim(fgets(STDIN))));
//[$s] = explode(' ', trim(fgets(STDIN)));
//$s = explode(' ', trim(fgets(STDIN)));
//function decr($v){return --$v;}
//$alpha='abcdefghijklmnopqrstuvwxyz';
//$mod=1000000009;
//$mod=1000000007;
//$mod=998244353;
//$a=[];
//$b=[];
//for($i=0;$i<$n;$i++){
//    [$a[],$b[]] = array_map('intval', explode(' ', trim(fgets(STDIN))));
//}
$ans = [];
for($i=0;$i<$n;$i++){
    [$a,$b] = explode(' ', trim(fgets(STDIN)));
    $lena = strlen($a);
    $lenb = strlen($b);
    if($a[$lena-1]=="S"){
        if($b[$lenb-1]=="S"){
            if($lena > $lenb) $ans[] = "<";
            else if($lena < $lenb) $ans[] = ">";
            else $ans[] = "=";
        }else{
            $ans[] = "<";
        }
    }else if($a[$lena-1]=="M"){
        if($b[$lenb-1]=="S"){
            $ans[] = ">";
        }else if($b[$lenb-1]=="M"){
            $ans[] = "=";
        }else{
            $ans[] = "<";
        }
    }else{
        if($b[$lenb-1]=="L"){
            if($lena > $lenb) $ans[] = ">";
            else if($lena < $lenb) $ans[] = "<";
            else $ans[] = "=";
        }else{
            $ans[] = ">";
        }
    }
}
echo implode(PHP_EOL,$ans);

<?php
$mod = 1000000007;
$intMaxValue = 2147483646; //2147483647

$loop = true;
$t = $loop ? IO::get() : 1;
while($t--) {
    solve();
}
function solve()
{
   list($a, $b) = IO::getArray();
   $l = $r = 0;
    $ans = '=';//< >
    if(strlen($a) ==1) {
       if($a == 'M') {
          $l = 5;
         } elseif($a == 'S') {
              $l = 0;
         } else {
              $l = 10;
         }

    } else {
        $l = (strlen($a));
        if($a[strlen($a)-1] == 'S') {
             $l *=-10;
        } else {
            $l *= 10;
        }
    }
    if(strlen($b) == 1) {
       if($b == 'M') {
          $r = 5;
         } elseif($b == 'S') {
              $r = 0;
         } else {
              $r = 10;
         }
    } else {
        $r = (strlen($b));
        if($b[strlen($b)-1] == 'S') {
             $r *=-10;
        } else {
             $r *= 10;
        }
    }
    if($l > $r) {
         $ans = '>';
    } elseif($l< $r) {
         $ans = '<';
    } else {
         $ans = '=';
    }
    IO::pr($ans);
}

class IO {
    public static function get()
    {
        return trim(fgets(STDIN));
    }

    public static function getArray()
    {
        return explode(' ', trim(fgets(STDIN)));
    }
    public static function pr($s)
    {
        echo $s, PHP_EOL;
    }
    public static function prArray($s)
    {
        echo implode( ' ', $s), PHP_EOL;
    }
    public static function getMinValue($x, $y) {
        return $x > $y ? $y : $x;
    }
    public static function getMaxValue($x, $y) {
        return $x > $y ? $x : $y;
    }
}

<?php
$mod = 1000000007;
$intMaxValue = 2147483646; //2147483647

$loop = true;
$t = $loop ? IO::get() : 1;
while($t--) {
    solve();
}
function solve()
{
   list($a, $b) = IO::getArray();
   $l = $r = 0;
    $ans = '=';//< >
    if(strlen($a) ==1) {
       if($a == 'M') {
          $l = 5;
         } elseif($a == 'S') {
              $l = 0;
         } else {
              $l = 10;
         }

    } else {
        $l = (strlen($a)-1)*10;
        if($a[strlen($a)-1] == 'S') {
             $l *=-1;
        }
    }
    if(strlen($b) == 1) {
       if($b == 'M') {
          $r = 5;
         } elseif($b == 'S') {
              $r = 0;
         } else {
              $r = 10;
         }
    } else {
        $r = (strlen($b)-1)*10;
        if($b[strlen($b)-1] == 'S') {
             $r *=-1;
        }
    }
    if($l > $r) {
         $ans = '>';
    } elseif($l< $r) {
         $ans = '<';
    } else {
         $ans = '=';
    }
    IO::pr($ans);
}

class IO {
    public static function get()
    {
        return trim(fgets(STDIN));
    }

    public static function getArray()
    {
        return explode(' ', trim(fgets(STDIN)));
    }
    public static function pr($s)
    {
        echo $s, PHP_EOL;
    }
    public static function prArray($s)
    {
        echo implode( ' ', $s), PHP_EOL;
    }
    public static function getMinValue($x, $y) {
        return $x > $y ? $y : $x;
    }
    public static function getMaxValue($x, $y) {
        return $x > $y ? $x : $y;
    }
}


<?php
function checkArr($arr, $d)
{
	foreach($arr as $key => $value)
	{
		if($value > $d)
			return false;
	}
	return true;
}

$t = (int)fgets(STDIN);
for($i=0;$i<$t;$i++)
{
	$str = fgets(STDIN);
	$arr = explode(" ", $str);
	$n = (int)$arr[0];
	$d = (int)$arr[1];
	$a_str = fgets(STDIN);
	$a = explode(" ", trim($a_str));
	if(checkArr($a, $d))
		print("YES\r\n");
	else
	{
		if(sizeof($a) == 1)
			print("NO\r\n");
		else
		{
			sort($a, SORT_NUMERIC);
			if($a[0] + $a[1] <= $d)
				print("YES\r\n");
			else
				print("NO\r\n");
		}
	}
}

$end = readline();
?>

<?php
     $ft =  trim(fgets(STDIN));
     for($irt = 0; $irt < $ft; $irt++){
         $a = explode(" ", trim(fgets(STDIN)));
         $b = explode(" ", trim(fgets(STDIN)));

         sort($b);
         $s = 0;
         $bool = false;
         for($u = 0; $u < $a[0]; $u++) {
             if($u < 2) {
                 $s += $b[$u];
             }
             if($b[$u] > $a[1]){
                 $bool = true;
             }
         }
         if($s <= $a[1] || !$bool){
             echo "YES\n";
         } else {
             echo "NO\n";
         }
     }

?>

<?php
    $t = trim(fgets(STDIN));
    for ($i = 0; $i < $t; $i++) {
        list($n, $d) = explode(" ", trim(fgets(STDIN)));
        $a = explode(" ", trim(fgets(STDIN)));
        if (max($a) <= $d) {
            echo 'YES'."\n";
        } else {
            $m = min($a);
            if ($m > $d) {
                echo 'NO' ."\n";
            } else {
                foreach ($a as $k => $v) {
                    if ($v == $m) {
                        unset($a[$k]);
                        break;
                    }
                }
                if (min($a) + $m <= $d) {
                    echo 'YES'."\n";
                } else {
                    echo 'NO' ."\n";
                }
            }
        }
    }

?>

<?php
$t = readline();
while($t!=0){
    $case = explode(' ',readline());

    $arr = explode(' ',readline());

    sort($arr);
    if ($arr[0]+$arr[1]<=$case[1]||$arr[$case[0]-1]<=$case[1]){
        echo "YES\n";
    }
    else {
        echo "NO\n";
    }
    $t--;
}
?>

<?php

$t = (int) trim(fgets(STDIN));
for ($i = 0; $i < $t; ++$i) {
    list($n[], $d[]) = array_map('intval', explode(' ', trim(fgets(STDIN))));
    $a[$i] = array_map('intval', explode(' ', trim(fgets(STDIN))));
}
for ($i = 0; $i < $t; ++$i) {
    $di = $d[$i];
    $ai = $a[$i];
    sort($ai);
    echo (($ai[0] + $ai[1] <= $di || max($ai) <= $di) ? 'YES' : 'NO'), PHP_EOL;
}

<?php
$fileName = 'php://stdin';
$file = fopen($fileName, "r");

$t = trim(fgets($file));
for ($i = 0; $i < $t; $i++) {
  list($n, $d) = explode(" ", trim(fgets($file)));
  $a = array();
  $a = explode(" ", trim(fgets($file)));
  rsort($a);

  $r = 0; $l = 0;
  $c = count($a);
  for ($j = 0; $j < $c; $j++) {
    if ($a[$j] > $d) {
      $a[$j] = $a[$c - 1] + $a[$c - 2];
      if ($a[$j] > $d) { $l = 1; echo 'NO'.PHP_EOL; break;}
    } else {
      $r++;
    }
  }
  if ($l != 1) { echo 'YES'.PHP_EOL; }
}

?>

<?php

/**
 * Соревнование http://codeforces.com/contest/1473
 */

$file = fopen("php://stdin", "r");
// $file = fopen("./input.txt", "r");

$rowsNumber = fgets($file);

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", trim(fgets($file)));

    $array = explode(" ", trim(fgets($file)));

    sort($array);

    if ($array[$n-1] <= $d) {
        echo "YES".PHP_EOL;

        continue;
    }

    if ((trim($array[0]) + trim($array[1])) <= trim($d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

$t = trim(fgets(STDIN));

for ($i=0; $i<$t; $i++) {
    list($count, $r) = explode(' ', trim(fgets(STDIN)));
    $array = explode(' ', trim(fgets(STDIN)));
    sort($array);

    if ($array[$count -1] <= $r || $array[0] + $array[1] <= $r) {
        echo "YES\n";
    } else {
        echo "NO\n";
    }

}

<?php

$t = trim(fgets(STDIN));

for ($i=0; $i<$t; $i++) {
    list($count, $d) = explode(' ', trim(fgets(STDIN)));
    $array = explode(' ', trim(fgets(STDIN)));
    sort($array);

    if ($array[$count -1] <= $d || $array[0] + $array[1] <= $d) {
        echo "YES\n";
    } else {
        echo "NO\n";
    }

}

<?php

$t = trim(fgets(STDIN));

for ($i=0; $i<$t; $i++) {
    list($count, $d) = explode(' ', trim(fgets(STDIN)));
    $array = explode(' ', trim(fgets(STDIN)));
    $aMin = [];
    $aMax = [];
    foreach ($array as $s) {
        if ($s <= $d) {
            $aMin[] = $s;
        } else {
            $aMax[] = $s;
        }
    }

    if (count($aMax) <= 0) {
        echo 'YES' . PHP_EOL;
    } else {
        if (count($aMin) > 1) {
            sort($aMin);
            if ($aMin[0] + $aMin[1] <= $d){
                echo 'YES' . PHP_EOL;
            }  else {
                echo 'NO' . PHP_EOL;
            }
        } else {
            echo 'NO' . PHP_EOL;
        }
    }

}

<?php
/**
 * Author       : Mina Sameh Wadie

 * Date         : 2021-01-21

 * Requirements : PHP V7+

 * *Description*  : Code Forces Problem https://codeforces.com/problemset/problem/1473/A

 *
 * The problem is replacing elements, the idea is you have elements in an array, and an inputed 'd',

 * if all elements can be less than or equal 'd' using a[i] = a[j] + a[k] where

 * i,j,k are different indices, then output Yes

 *
 * @inputs       : First input t number of test cases where (1<=t<=2000), newline

 * 		  Second input n (3<=n<=100), third input is 'd' (1<=d<=100)

 *
 */
class prob
{

	/**
	 * Takes input form user.
	 * @return array of inputs *See #inputs
	 */
	public function take_input() {

		$n = fgets(STDIN);
		$d = substr($n, strpos($n, ' '), -1);
		$n = substr($n, 0,strpos($n, ' '));

		return [ "n" => $n, "d" => $d ];

	}

	public function less_equal($data, $val) : bool {
		if( $data >= $val ) { return true; }
		return false;
	}

	/**
	 * die and dump, used for debugging.
	 * @parm data that will be dumped.
	 * @return void
	 */
	public function dd($data) {
		die(var_dump($data));
	}

	/**
	 * gets Array that will be used
	 * @parm amount of elements
	 * @return arr of elements
	 */
	public function getArr( $n ) {
		return array_map('intval', explode(' ', fgets(STDIN) ) );

	}

	/**
	 * Main Logic of doing the operations.
	 * @parm the array, and d.
	 * @return String YES or NO
	 */
	public function ReplaceElements( $arr, $d ) : string {
		// get the needed value
		$NeededVal = (int) $d;
		// Sort the arr
		sort($arr);
		$Counter = 1;

		// First Check if there is something to be done, by comparing the largest element to d.
		if( $this->less_equal($NeededVal,$arr[count($arr)-1])) { return "YES\n"; }

		// If not then, set j and k to first elements, which are the lowest ones.
		$arr[count($arr)-1] = $arr[0] + $arr[1];
		//Reset the counter
		$Counter = 0;
		// Then check again, if yes then that means all can be smaller | equal to d.
		if( $this->less_equal($NeededVal,$arr[count($arr)-1])) { return "YES\n"; }
		return "NO\n";
	}

	/**
	 * Constructor, used as main.
	 */
	public function Run(){
		// get T
		$t  = (int)fgets(STDIN);
		do {
			// take the required input
			$inputs = $this->take_input();
			// get Arr
			echo $this->ReplaceElements(  $this->getArr( $inputs["n"] ) , $inputs["d"] );
			$t--;
		} while( $t > 0 );

	}
}

$obj = new prob();
$obj->Run();

<?php

/**
 * Соревнование http://codeforces.com/contest/1473
 */

$file = fopen("php://stdin", "r");
// $file = fopen("./input.txt", "r");

$rowsNumber = fgets($file);

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", fgets($file));

    $array = explode(" ", trim(fgets($file)));

    sort($array);

    if ($array[$n-1] <= $d) {
        echo "YES".PHP_EOL;

        continue;
    }

    if ((trim($array[0]) + trim($array[1])) <= trim($d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

$file = fopen("php://stdin", "r");

$rowsNumber = trim(fgets($file));

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", trim(fgets($file)));

    $array = explode(" ", trim(fgets($file)));

    sort($array);

    if (($array[0] + $array[1]) <= $d) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

/**
 * Соревнование http://codeforces.com/contest/1473
 */

$file = fopen("php://stdin", "r");

$rowsNumber = fgets($file);

function hasMoreThen($array, $n, $d) {
    for ($i=0; $i<$n; $i++) {
        if (trim($array[$i]) > trim($d)) {
            return true;
        }
    }

    return false;
}

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", fgets($file));

    $array = explode(" ", fgets($file));

    if (! hasMoreThen($array, $n, $d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    sort($array);

    if ((trim($array[0]) + trim($array[1])) <= trim($d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

/**
 * Соревнование http://codeforces.com/contest/1473
 */

$file = fopen("php://stdin", "r");

$rowsNumber = fgets($file);

function hasMoreThen($array, $n, $d) {
    for ($i=0; $i<$n; $i++) {
        if (trim($array[$i]) > trim($d)) {
            return true;
        }
    }

    return false;
}

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", fgets($file));

    $array = explode(" ", fgets($file));

    if (! hasMoreThen($array, $n, $d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    sort($array);
        var_dump($array);
    if ((trim($array[0]) + trim($array[1])) <= trim($d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

/**
 * Соревнование http://codeforces.com/contest/1473
 */

$file = fopen("php://stdin", "r");

$rowsNumber = fgets($file);

function hasMoreThen($array, $n, $d) {
    for ($i=0; $i<$n; $i++) {
        if ($array[$i] > $d) {
            return true;
        }
    }

    return false;
}

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", fgets($file));

    $array = explode(" ", fgets($file));

    if (! hasMoreThen($array, $n, $d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    sort($array);

    if (($array[0] + $array[1]) <= $d) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

/**
 * Соревнование http://codeforces.com/contest/1473
 */

$file = fopen("php://stdin", "r");

$rowsNumber = fgets($file);

function hasMoreThen($array, $n, $d) {
    for ($i=0; $i<$n; $i++) {
        if ($array[$i] > $d) {
            return true;
        }
    }

    return false;
}

for($i=0; $i<$rowsNumber; $i++) {
    list($n, $d) = explode(" ", fgets($file));

    $array = explode(" ", fgets($file));

    if (! hasMoreThen($array, $n, $d)) {
        echo "YES".PHP_EOL;

        continue;
    }

    sort($array);

    if (($array[0] + $array[1]) < $d) {
        echo "YES".PHP_EOL;

        continue;
    }

    echo "NO".PHP_EOL;
}

<?php

$t = trim(fgets(STDIN));

for ($i=0; $i<$t; $i++) {
    list($count, $d) = explode(' ', trim(fgets(STDIN)));
    $array = explode(' ', trim(fgets(STDIN)));
    $aMin = [];
    $aMax = [];
    foreach ($array as $s) {
        if ($s <= $d) {
            $aMin[$s] = $s;
        } else {
            $aMax[$s] = $s;
        }
    }

    if (count($aMax) <= 0) {
        echo 'YES' . PHP_EOL;
    } else {
        if (count($aMin) > 1) {
            sort($aMin);
            if ($aMin[0] + $aMin[1] <= $d){
                echo 'YES' . PHP_EOL;
            }  else {
                echo 'NO' . PHP_EOL;
            }
        } else {
            echo 'NO' . PHP_EOL;
        }
    }

}

<?php

$t = trim(fgets(STDIN));

for ($i=0; $i<$t; $i++) {
    list($count, $d) = explode(' ', trim(fgets(STDIN)));
    $array = explode(' ', trim(fgets(STDIN)));

    foreach ($array as $s) {
        if ($s <= $d) {
            $aMin[$s] = $s;
        } else {
            $aMax[$s] = $s;
        }
    }

    if (count($aMax) <= 0) {
        echo 'YES' . PHP_EOL;
    } else {
        if (count($aMin) > 1) {
            sort($aMin);
            if ($aMin[0] + $aMin[1] <= $d){
                echo 'YES' . PHP_EOL;
            }  else {
                echo 'NO' . PHP_EOL;
            }
        } else {
            echo 'NO' . PHP_EOL;
        }
    }

}

<?php
/**
 * Author       : Mina Sameh Wadie

 * Date         : 2021-01-21

 * Requirements : PHP V7+

 * *Description*  : Code Forces Problem https://codeforces.com/problemset/problem/1473/A

 *
 * The problem is replacing elements, the idea is you have elements in an array, and an inputed 'd',

 * if all elements can be less than or equal 'd' using a[i] = a[j] + a[k] where

 * i,j,k are different indices, then output Yes

 *
 * @inputs       : First input t number of test cases where (1<=t<=2000), newline

 * 		  Second input n (3<=n<=100), third input is 'd' (1<=d<=100)

 *
 */
class prob
{

	/**
	 * Takes input form user.
	 * @return array of inputs *See #inputs
	 */
	public function take_input() {

		$n = fgets(STDIN);
		$d = substr($n, strpos($n, ' '), -1);
		$n = substr($n, 0,strpos($n, ' '));

		return [ "n" => $n, "d" => $d ];

	}

	public function less_equal($data, $val) : bool {
		if( $data >= $val ) { return true; }
		return false;
	}

	/**
	 * die and dump, used for debugging.
	 * @parm data that will be dumped.
	 * @return void
	 */
	public function dd($data) {
		die(var_dump($data));
	}

	/**
	 * gets Array that will be used
	 * @parm amount of elements
	 * @return arr of elements
	 */
	public function getArr( $n ) {
		return array_map('intval', explode(' ', fgets(STDIN) ) );

	}

	/**
	 * Main Logic of doing the operations.
	 * @parm the array, and d.
	 * @return String YES or NO
	 */
	public function ReplaceElements( $arr, $d ) : string {
		// get the needed value
		$NeededVal = ( $d < sizeof($arr) ? $arr[(int)$d] : $d );
		$Counter = 1;

		// First Check if there is something to be done.
		foreach( $arr as $val ) {
			if( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))
		       	{ $Counter++; }
		}

		if( $Counter == sizeof($arr) ) { return "YES"; }
		// First, get I, J and K.
		$i = 0; $j = 1; $k = 2;
		// Reset the counter
		$Counter = 0;
		for( $i=0; $i<sizeof($arr); ( $i != $k && $i != $j ) ? $i++ : $i+=2  ) {
			for( $j=1; $j<sizeof($arr); ( $j != $i && $j != $k ) ? $j++ : $j+=2  ) {
					if( $this->less_equal($NeededVal, $arr[$i] ) ){
						continue;
					}
				for( $k=2; $k<sizeof($arr); ( $k != $i && $k != $j ) ? $k++ : $k+=2  ) {
					if( $this->less_equal($NeededVal, ($arr[$j] + $arr[$k] ) ) ) {
						$arr[$i] = $arr[$j] + $arr[$k];
						echo "| NeededVal:";
						echo $NeededVal;
						echo " ,Arr[i]:";
						echo $arr[$i];
						}
					}
			}
		}
		foreach( $arr as $val ) {
			if( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))
		       	{ $Counter++; }
		}

		if( $Counter == sizeof($arr) ) { return "YES\n"; }
		return "NO\n";
	}

	/**
	 * Constructor, used as main.
	 */
	public function Run(){
		// get T
		$t  = (int)fgets(STDIN);
		do {
			// take the required input
			$inputs = $this->take_input();
			// get Arr
			echo $this->ReplaceElements( $this->getArr( $inputs["n"] ), $inputs["d"] );
			$t--;
		} while( $t > 0 );

	}
}

$obj = new prob();
$obj->Run();

<?php
/**
 * Author       : Mina Sameh Wadie

 * Date         : 2021-01-21

 * Requirements : PHP V7+

 * *Description*  : Code Forces Problem https://codeforces.com/problemset/problem/1473/A

 *
 * The problem is replacing elements, the idea is you have elements in an array, and an inputed 'd',

 * if all elements can be less than or equal 'd' using a[i] = a[j] + a[k] where

 * i,j,k are different indices, then output Yes

 *
 * @inputs       : First input t number of test cases where (1<=t<=2000), newline

 * 		  Second input n (3<=n<=100), third input is 'd' (1<=d<=100)

 *
 */
class prob
{

	/**
	 * Takes input form user.
	 * @return array of inputs *See #inputs
	 */
	public function take_input() {

		$n = fgets(STDIN);
		$d = substr($n, strpos($n, ' '), -1);
		$n = substr($n, 0,strpos($n, ' '));

		return [ "n" => $n, "d" => $d ];

	}

	public function less_equal($data, $val) : bool {
		if( $data >= $val ) { return true; }
		return false;
	}

	/**
	 * die and dump, used for debugging.
	 * @parm data that will be dumped.
	 * @return void
	 */
	public function dd($data) {
		die(var_dump($data));
	}

	/**
	 * gets Array that will be used
	 * @parm amount of elements
	 * @return arr of elements
	 */
	public function getArr( $n ) {
		return array_map('intval', explode(' ', fgets(STDIN) ) );

	}

	/**
	 * Main Logic of doing the operations.
	 * @parm the array, and d.
	 * @return String YES or NO
	 */
	public function ReplaceElements( $arr, $d ) : string {
		// get the needed value
		$NeededVal = ( $d < sizeof($arr) ? $arr[(int)$d] : $d );
		$Counter = 1;

		// First Check if there is something to be done.
		foreach( $arr as $val ) {
			if( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))
		       	{ $Counter++; }
		}

		if( $Counter == sizeof($arr) ) { return "YES"; }
		// First, get I, J and K.
		$i = 0; $j = 1; $k = 2;
		// Reset the counter
		$Counter = 0;
		for( $i=0; $i<sizeof($arr); ( $i != $k && $i != $j ) ? $i++ : $i+=2  ) {
			for( $j=1; $j<sizeof($arr); ( $j != $i && $j != $k ) ? $j++ : $j+=2  ) {
					if( $this->less_equal($NeededVal, $arr[$i] ) ){
						continue;
					}
				for( $k=2; $k<sizeof($arr); ( $k != $i && $k != $j ) ? $k++ : $k+=2  ) {
					if( $this->less_equal($NeededVal, ($arr[$j] + $arr[$k] ) ) ) {
						$arr[$i] = $arr[$j] + $arr[$k];
						echo "| NeededVal:";
						echo $NeededVal;
						echo " ,Arr[i]:";
						echo $arr[$i];
						}
					}
			}
		}
		foreach( $arr as $val ) {
			if( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))
		       	{ $Counter++; }
		}

		if( $Counter == sizeof($arr) ) { return "YES"; }
		return "NO";
	}

	/**
	 * Constructor, used as main.
	 */
	public function Run(){
		// get T
		$t  = (int)fgets(STDIN);
		do {
			// take the required input
			$inputs = $this->take_input();
			// get Arr
			echo $this->ReplaceElements( $this->getArr( $inputs["n"] ), $inputs["d"] );
			$t--;
		} while( $t > 0 );

	}
}

$obj = new prob();
$obj->Run();

<?php
     $ft =  trim(fgets(STDIN));
     for($irt = 0; $irt < $ft; $irt++){
         $a = explode(" ", trim(fgets(STDIN)));
         $b = explode(" ", trim(fgets(STDIN)));

         sort($b);
         var_dump($b);
         $s = 0;
         $bool = false;
         for($u = 0; $u < $a[0]; $u++) {
             if($u < 2) {
                 $s += $b[$u];
             }
             if($b[$u] > $a[1]){
                 $bool = true;
             }
         }
         if($s <= $a[1] || !$bool){
             echo "YES\n";
         } else {
             echo "NO\n";
         }
     }

?>

<?php
     $ft =  trim(fgets(STDIN));
     for($irt = 0; $irt < $ft; $irt++){
         $a = explode(" ", trim(fgets(STDIN)));
         $b = explode(" ", trim(fgets(STDIN)));

         sort($b);
         $s = 0;
         $bool = false;
         for($u = 0; $u < $a[0]; $u++) {
             if($u < 2) {
                 $s += $b[$u];
             }
             if($u > $a[1]){
                 $bool = true;
             }
         }
         if($s <= $a[1] || !$bool){
             echo "YES\n";
         } else {
             echo "NO\n";
         }
     }

?>

<?php
    $t = trim(fgets(STDIN));
    for ($i = 0; $i < $t; $i++) {
        list($n, $d) = explode(" ", trim(fgets(STDIN)));
        $a = explode(" ", trim(fgets(STDIN)));
        if (max($a) <= $d) {
            echo 'YES'."\n";
        } else {
            $m = min($a);
            if ($m > $d) {
                echo 'NO' ."\n";
            } else {
                foreach ($a as $k => $v) {
                    if ($v == $m) {
                        unset($a[$k]);
                    }
                }
                if (min($a) + $m <= $d) {
                    echo 'YES'."\n";
                } else {
                    echo 'NO' ."\n";
                }
            }
        }
    }

?>


<?php
$l = (int)fgets(STDIN);
$l1 = explode(' ', fgets(STDIN));
$l2 = explode(' ', fgets(STDIN));
$l2cp = array_flip($l2);
$LJ = 0;
$r = [];
for ($i = 0; $i < $l; ++$i) {
    if ($LJ == $l) {
        echo '0 ';
        continue;
    }
    if ($l2cp[$l2[$i]] === false) {
        echo '0 ';
        continue;
    }
    $J = $LJ;
    $SS = 0;
    while($J <= $l) {
        if (intval($l2[$i]) == intval($l1[$J])) {
            ++$J;
            $SS = $J - $LJ;
            $LJ = $J;
            break;
        }
        $l2cp[$l1[$J]] = false;
        ++$J;
    }
    echo $SS . ' ';
}

<?php
$l = (int)fgets(STDIN);
$r = [];
for($i = 0; $i < $l; $i++) {
    $r[] = 0;
}
$l1 = array_map('intval', explode(' ', fgets(STDIN)));
$l2 = explode(' ', fgets(STDIN));
for ($i = 0; $i < $l; $i++) {
    $ind = array_search((int)$l2[$i], $l1) - $i;
    if ($ind !== false && $ind > -1) {
        $r[$i] = $ind + 1;
    }
}
echo implode(' ', $r);


<?php

    $stdin = fopen ('php://stdin','r');
    $n = fgets($stdin);
    $grid = [];
    for ($i = 0; $i < $n; $i++)
        array_push($grid, explode(" ", trim(fgets($stdin))));

    $answer = true;
    for ($i = 0; $i < $n; $i++)
        for ($j = 0; $j < $n; $j++)
            if ($grid[$i][$j] != 1) {
                $sumNth = false;
                for ($a = 0; $a < $n; $a++) {
                    if ($a != $j) {
                        for ($b = 0; $b < $n; $b++)
                            if ($b != $i)
                                if ($grid[$i][$a] + $grid[$b][$j] == $grid[$i][$j]) {
                                    $sumNth = true;
                                    $a = $n;
                                    break;
                                }
                    }
                }
                if (!$sumNth) {
                    $answer = false;
                    $i = $n;
                    break;
                }
            }
    echo ($answer ? "Yes" : "No")."\n";
    fclose($stdin);
?>

<?php

    $stdin = fopen ('php://stdin','r');
    $n = fgets($stdin);
    $grid = array();
    for ($i = 0; $i < $n; $i++)
        array_push($grid, explode(" ", trim(fgets($stdin))));

    $answer = true;
    for ($i = 0; $i < $n && $answer; $i++)
        for ($j = 0; $j < $n && $answer; $j++)
            if ($grid[$i][$j] != 1) {
                $sumNth = false;
                for ($a=0; $a < $n; $a++)
                    for ($b=0; $b < $n && $a != $j; $b++)
                        if ($b != $i)
                            if ($grid[$i][$a] + $grid[$b][$j] == $grid[$i][$j]) {
                                $sumNth = true;
                                $a = $n;
                                break;
                            }
                $answer = $answer && $sumNth;
            }
    echo ($answer ? "Yes" : "No")."\n";
    fclose($stdin);
?>

<?php

    $stdin = fopen ('php://stdin','r');
    $n = fgets($stdin);
    $grid = array();
    for ($i = 0; $i < $n; $i++)
        array_push($grid, explode(" ", trim(fgets($stdin))));

    $answer = true;
    for ($i = 0; $i < $n; $i++)
        for ($j = 0; $j < $n; $j++)
            if ($grid[$i][$j] != 1) {
                $sumNth = false;
                for ($a=0; $a < $n; $a++)
                    for ($b=0; $b < $n && $a != $j; $b++)
                        if ($b != $i)
                            if ($grid[$i][$a] + $grid[$b][$j] == $grid[$i][$j]) {
                                $sumNth = true;
                                $a = $n;
                                break;
                            }
                $answer = $answer && $sumNth;
            }
    echo ($answer ? "Yes" : "No")."\n";
    fclose($stdin);
?>

<?php
$a=intval(trim(fgets(STDIN)));
for($i=0;$i<$a;$i++){
    $b[$i]=explode(' ',trim(fgets(STDIN)));
}
$sign=true;
for($i=0;$i<$a;$i++){
    for($j=0;$j<$a;$j++){
        if($b[$i][$j]==1){
            continue;
        }
        else{
            $flag=false;
            for ($k=0;$k<$a;$k++){
                if ($k==$i){
                    continue;
                }
                else{
                    if(in_array($b[$i][$j]-$b[$k][$j],$b[$i])){
                        $flag=true;
                        break;
                    }
                }
            }
            if (!$flag){
                echo 'No';
                $sign=false;
                break 2;
            }
        }
    }
}
if ($sign){
    echo 'Yes';
}
?>


<?php
$_fp = fopen("php://stdin", "r");

$n = (int) trim(fgets($_fp));

$a = explode(' ', trim(fgets($_fp)));
$b = $a;
sort($a);
$swap_list = [];
$start = 0;
$first = false;
for ($i=0; $i < $n; $i++) {
    if ($a[$i] != $b[$i]) {
        $swap_list[] = $i;
    }
}
if (count($swap_list) == 0) {
    echo 'yes' . PHP_EOL;
    echo '1 1';
} else {
    $start = $swap_list[0];
    $end = end($swap_list);
    $sub_list = array_slice($b, $start, $end-$start+1);
    $sub_list_sort = array_slice($a, $start, $end-$start+1);
    $sub_list_reverse = array_reverse($sub_list);

    if ($sub_list_reverse == $sub_list_sort) {
        echo 'yes' . PHP_EOL;
        echo ($swap_list[0] + 1) . ' ' . (end($swap_list) + 1);
    } else {
        echo 'no';
    }
}

<?php
/**
 * Created by PhpStorm.
 * User: CPU11316-local
 * Date: 5/22/2019
 * Time: 5:21 PM
 */
//  Bear and Game
function check($n, $arr){
    /*
    $count = 0;
    for($i = 0;$i<$n - 1;$i++){
        if($arr[$i] >= $arr[$i+1]){
            $count++;
            if($i == $n-2){//end
                $temp = swap($arr,$i - $count + 1,$i + 1);
                $res = checkIncre($n,$temp);
                if($res){
                    echo "yes\n";
                    echo ($i - $count + 2);
                    echo " ";
                    echo ($i + 2);
                    return true;
                }
                $count = 0;
            }
        }
        else{
            $temp = swap($arr,$i - $count,$i);
            $res = checkIncre($n,$temp);
            if($res){
                echo "yes\n";
                echo ($i - $count + 1);
                echo " ";
                echo ($i + 1);
                return true;
            }
            if($count != 0 ){
                echo "no";
                return false;
            }
            $count = 0;
        }
    }
    echo "no";
    return false;*/
    $count = 0;
    $arrTemp = [];
    for($i = 0;$i<$n - 1;$i++){
        if($arr[$i] >= $arr[$i+1]) {
            if($count == 0){
                array_push($arrTemp,$i);
            }
            if($i == $n - 2){
                array_push($arrTemp,$i +1);
            }
            $count++;
        }
        else{
            if($count !== 0){
                array_push($arrTemp,$i);
            }
            $count = 0;
        }
    }
    if (count($arrTemp) != 2){
        if(count($arrTemp) == 0){
            echo "yes\n";
            echo (1);
            echo " ";
            echo (1);
        }
        else
        echo "no";
    }
    else{
         $st1 = $arrTemp[0];
         $st2 = $arrTemp[1];
         if($st1 == 0||$arr[$st1 - 1] <= $arr[$st2]){
            if ($st2+1 == $n ||$arr[$st2 +1] >= $arr[$st1]){
                echo "yes\n";
                echo ($st1 + 1);
                echo " ";
                echo ($st2 + 1);
            }
            else{
                echo "no";
            }
        }
        else{
            echo "no";
        }
    }
    return;
}
function swap($arr,$start,$end)
{
    $tempArr = $arr;
    $count = 0;
    for ($i = $start; $i <= $end; $i++) {
        $tempArr[$i] = $arr[$end - $count];
        $count++;
    }
    return $tempArr;
}
function checkIncre($n,$arr){
    for($i = 0;$i<$n -1;$i++){
        if($arr[$i] >= $arr[$i+1]) return false;
    }
    return true;
}

$in = 'php://stdin';

$input = fopen($in, "r");

$n = fgets($input);

$t = [];

$t = array_merge($t, explode(" ", trim(fgets($input))));

check($n,$t);

<?php

function Sort_array($array_size,$raw_array){
   $raw_array     = explode(" ",$raw_array);
   $default       = $raw_array;
   $array         = $default;
   $pos           = array();
   $start         = 0;
   $end           = 0;
   $reverse       = 0;

   for($i=0;$i<$array_size-1;$i++){

       if(($array[$i] > $array[$i+1]) )
       {
           if($start==0){
                $start = $i+1;
                if($i>0)
                    $start_value = $array[$i-1];
                else
                    $start_value = $array[$i];
           }

           if($i==$array_size-2){
                $end       = $i+2;
                $end_value = $array[$i+1];
           }
           else {
                $end = $i+2;
                $end_value = $array[$i+2];
           }

       }

    }
    //echo $start. " ".$end."\n";
    //echo $start_value. " ".$end_value."\n";
    if($start==0 && $end==0){
        echo "yes\n"."1 1";

    }
    else{

        for($i=$end-1;$i>$start-1;$i--){

            if($default[$i]>$default[$i-1]){
                $reverse = 1;
            }
        }

        if(($end == $array_size) && ($start==1))
        {
            if($start_value > $end_value && $reverse==0)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start==1 && $end<$array_size  ) {

            if($start_value < $end_value && $array[$start-1] <= $end_value && $reverse==0)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start>1 && $end<$array_size) {
            if($start_value < $end_value && $array[$start-1] <= $end_value && $reverse==0)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start>1 && $end==$array_size) {
            if($start_value < $end_value && $reverse==0)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }

    }

}

$array_size = trim(fgets(STDIN));
$array      = trim(fgets(STDIN));
Sort_array($array_size,$array);

<?php
/**
 * Created by PhpStorm.
 * User: CPU11316-local
 * Date: 5/22/2019
 * Time: 5:21 PM
 */
//  Bear and Game
function check($n, $arr){
    /*
    $count = 0;
    for($i = 0;$i<$n - 1;$i++){
        if($arr[$i] >= $arr[$i+1]){
            $count++;
            if($i == $n-2){//end
                $temp = swap($arr,$i - $count + 1,$i + 1);
                $res = checkIncre($n,$temp);
                if($res){
                    echo "yes\n";
                    echo ($i - $count + 2);
                    echo " ";
                    echo ($i + 2);
                    return true;
                }
                $count = 0;
            }
        }
        else{
            $temp = swap($arr,$i - $count,$i);
            $res = checkIncre($n,$temp);
            if($res){
                echo "yes\n";
                echo ($i - $count + 1);
                echo " ";
                echo ($i + 1);
                return true;
            }
            if($count != 0 ){
                echo "no";
                return false;
            }
            $count = 0;
        }
    }
    echo "no";
    return false;*/
    $count = 0;
    $arrTemp = [];
    for($i = 0;$i<$n - 1;$i++){
        if($arr[$i] >= $arr[$i+1]) {
            if($count == 0){
                array_push($arrTemp,$i);
            }
            if($i == $n - 2){
                array_push($arrTemp,$i +1);
            }
            $count++;
        }
        else{
            if($count !== 0){
                array_push($arrTemp,$i);
            }
            $count = 0;
        }
    }
    if (count($arrTemp) != 2){
        echo "no";
    }
    else{
         $st1 = $arrTemp[0];
         $st2 = $arrTemp[1];
         if($st1 == 0||$arr[$st1 - 1] <= $arr[$st2]){
            if ($st2+1 == $n ||$arr[$st2 +1] >= $arr[$st1]){
                echo "yes\n";
                echo ($st1 + 1);
                echo " ";
                echo ($st2 + 1);
            }
            else{
                echo "no";
            }
        }
        else{
            echo "no";
        }
    }
    return;
}
function swap($arr,$start,$end)
{
    $tempArr = $arr;
    $count = 0;
    for ($i = $start; $i <= $end; $i++) {
        $tempArr[$i] = $arr[$end - $count];
        $count++;
    }
    return $tempArr;
}
function checkIncre($n,$arr){
    for($i = 0;$i<$n -1;$i++){
        if($arr[$i] >= $arr[$i+1]) return false;
    }
    return true;
}

$in = 'php://stdin';

$input = fopen($in, "r");

$n = fgets($input);

$t = [];

$t = array_merge($t, explode(" ", trim(fgets($input))));

check($n,$t);

<?php
/**
 * Created by PhpStorm.
 * User: CPU11316-local
 * Date: 5/22/2019
 * Time: 5:21 PM
 */
//  Bear and Game
function check($n, $arr){
    $count = 0;
    for($i = 0;$i<$n - 1;$i++){
        if($arr[$i] >= $arr[$i+1]){
            $count++;
            if($i == $n-2){//end
                $temp = swap($arr,$i - $count + 1,$i + 1);
                $res = checkIncre($n,$temp);
                if($res){
                    echo "yes\n";
                    echo ($i - $count + 2);
                    echo " ";
                    echo ($i + 2);
                    return true;
                }
                $count = 0;
            }
        }
        else{
            $temp = swap($arr,$i - $count,$i);
            $res = checkIncre($n,$temp);
            if($res){
                echo "yes\n";
                echo ($i - $count + 1);
                echo " ";
                echo ($i + 1);
                return true;
            }
            if($count == 0 ){
                echo "no";
                return false;
            }
            $count = 0;
        }
    }
    echo "no";
    return false;
}
function swap($arr,$start,$end)
{
    $tempArr = $arr;
    $count = 0;
    for ($i = $start; $i <= $end; $i++) {
        $tempArr[$i] = $arr[$end - $count];
        $count++;
    }
    return $tempArr;
}
function checkIncre($n,$arr){
    for($i = 0;$i<$n -1;$i++){
        if($arr[$i] >= $arr[$i+1]) return false;
    }
    return true;
}

$in = 'php://stdin';

$input = fopen($in, "r");

$n = fgets($input);

$t = [];

$t = array_merge($t, explode(" ", trim(fgets($input))));

check($n,$t);

<?php
/**
 * Created by PhpStorm.
 * User: CPU11316-local
 * Date: 5/22/2019
 * Time: 5:21 PM
 */
//  Bear and Game
function check($n, $arr){
    $count = 0;
    for($i = 0;$i<$n - 1;$i++){
        if($arr[$i] >= $arr[$i+1]){
            $count++;
            if($i == $n-2){//end
                $temp = swap($arr,$i - $count + 1,$i + 1);
                $res = checkIncre($n,$temp);
                if($res){
                    echo "yes\n";
                    echo ($i - $count + 2);
                    echo " ";
                    echo ($i + 2);
                    return true;
                }
                $count = 0;
            }
        }
        else{
            $temp = swap($arr,$i - $count,$i);
            $res = checkIncre($n,$temp);
            if($res){
                echo "yes\n";
                echo ($i - $count + 1);
                echo " ";
                echo ($i + 1);
                return true;
                return true;
            }
            $count = 0;
        }
    }
    echo "no";
    return false;
}
function swap($arr,$start,$end)
{
    $tempArr = $arr;
    for ($i = $start; $i <= $end; $i++) {
        $tempArr[$i] = $arr[$end - $i];
    }
    return $tempArr;
}
function checkIncre($n,$arr){
    for($i = 0;$i<$n -1;$i++){
        if($arr[$i] >= $arr[$i+1]) return false;
    }
    return true;
}
$in = 'php://stdin';

$input = fopen($in, "r");

$n = fgets($input);

$t = [];

$t = array_merge($t, explode(" ", trim(fgets($input))));

check($n,$t);

<?php

function Sort_array($array_size,$raw_array){
   $raw_array     = explode(" ",$raw_array);
   $default       = $raw_array;
   $array       = $default;
    for($i=0;$i<$array_size;$i++){
        for($j=$i+1;$j<$array_size;$j++){
            if($array[$i]>$array[$j])
            {
                $temp        = $array[$i];
                $array[$i]   = $array[$j];
                $array[$j]   = $temp;

            }

        }
    }

    if($default==$array){
        echo "yes\n"."1 1";
        exit();
    }
    else
    {
        for($i=0;$i<$array_size;$i++){
            for($j=$i+1;$j<$array_size;$j++){
                $swap = 0;
                if($default[$i]>$default[$j]&& $swap<=1)
                {
                    $temp        = $default[$i];
                    $default[$i]   = $default[$j];
                    $default[$j]   = $temp;
                    $swap++;
                    if($default==$array){
                        echo "yes\n".($i+1)." ".($j+1);
                        exit();
                    }
                    else{
                        $default = $raw_array;
                    }
                }

            }
        }
        if($default!=$array){
            echo "no";
        }
    }

}

$array_size = trim(fgets(STDIN));
$array      = trim(fgets(STDIN));
Sort_array($array_size,$array);

<?php

function Sort_array($array_size,$raw_array){
   $raw_array     = explode(" ",$raw_array);
   $default       = $raw_array;
   $array         = $default;
   $pos           = array();
   $start         = 0;
   $end           = 0;
   $reverse       = 0;

   for($i=0;$i<$array_size-1;$i++){

       if(($array[$i] > $array[$i+1]) )
       {
           if($start==0){
                $start = $i+1;
                if($i>0)
                    $start_value = $array[$i-1];
                else
                    $start_value = $array[$i];
           }

           if($i==$array_size-2){
                $end       = $i+2;
                $end_value = $array[$i+1];
           }
           else {
                $end = $i+2;
                $end_value = $array[$i+2];
           }

       }

    }
    //echo $start. " ".$end."\n";
    //echo $start_value. " ".$end_value."\n";
    if($start==0 && $end==0){
        echo "yes\n"."1 1";

    }
    else{
        if(($end == $array_size) && ($start==1))
        {
            if($start_value > $end_value )
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start==1 && $end<$array_size  ) {

            if($start_value < $end_value && $array[$start-1] <= $end_value)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start>1 && $end<$array_size) {
            if($start_value < $end_value && $array[$start-1] <= $end_value)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start>1 && $end==$array_size) {
            if($start_value < $end_value)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }

    }

}

$array_size = trim(fgets(STDIN));
$array      = trim(fgets(STDIN));
Sort_array($array_size,$array);

<?php

function Sort_array($array_size,$raw_array){
   $raw_array     = explode(" ",$raw_array);
   $default       = $raw_array;
   $array         = $default;
   $pos           = array();
   $start         = 0;
   $end           = 0;
   $reverse       = 0;

   for($i=0;$i<$array_size-1;$i++){

       if(($array[$i] > $array[$i+1]) )
       {
           if($start==0){
                $start = $i+1;
                if($i>0)
                    $start_value = $array[$i-1];
                else
                    $start_value = $array[$i];
           }

           if($i==$array_size-2){
                $end       = $i+2;
                $end_value = $array[$i+1];
           }
           else {
                $end = $i+2;
                $end_value = $array[$i+2];
           }

       }

    }

    if($start==0 && $end==0){
        echo "yes\n"."1 1";

    }
    else{
        if(($end == $array_size) && ($start==1))
        {
            if($start_value > $end_value)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start==1 && $end<$array_size) {

            if($start_value < $end_value)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }
        elseif ($start>1) {
            if($start_value < $end_value)
                echo "yes\n".$start." ".$end;
            else
                echo "no";
        }

    }

}

$array_size = trim(fgets(STDIN));
$array      = trim(fgets(STDIN));
Sort_array($array_size,$array);

<?php

function Sort_array($array_size,$raw_array){
   $raw_array     = explode(" ",$raw_array);
   $default       = $raw_array;
   $array         = $default;

   for($i=0;$i<$array_size;$i++){
        for($j=$i+1;$j<$array_size;$j++){
            if($array[$i]>$array[$j])
            {
                $temp        = $array[$i];
                $array[$i]   = $array[$j];
                $array[$j]   = $temp;

            }

        }
    }

    for($i=0;$i<$array_size;$i++){
        $reverse_array[$i] = $default[$array_size-1-$i];
    }

    if($default==$array){
        echo "yes\n"."1 1";
        exit();
    }
    else if($reverse_array==$array){
        echo "yes\n"."1 ".$array_size;
        exit();
    }
    else
    {
        for($i=0;$i<$array_size;$i++){
            for($j=$i+1;$j<$array_size;$j++){
                $swap = 0;
                if($default[$i]>$default[$j]&& $swap<=1)
                {
                    $temp        = $default[$i];
                    $default[$i]   = $default[$j];
                    $default[$j]   = $temp;
                    $swap++;
                    if($default==$array){
                        echo "yes\n".($i+1)." ".($j+1);
                        exit();
                    }
                    else{
                        $default = $raw_array;
                    }
                }

            }
        }
        if($default!=$array){
            echo "no";
        }
    }

}

$array_size = trim(fgets(STDIN));
$array      = trim(fgets(STDIN));
Sort_array($array_size,$array);

<?php
$_fp = fopen("php://stdin", "r");

$n = (int) trim(fgets($_fp));

$a = explode(' ', trim(fgets($_fp)));
$b = $a;
sort($a);
$swap_list = [];
$start = 0;
$first = false;
for ($i=0; $i < $n; $i++) {
    if ($a[$i] != $b[$i]) {
        $swap_list[] = $i;
    }
}
if (count($swap_list) == 0) {
    echo 'yes' . PHP_EOL;
    echo '1 1';
} else {
    $sub_list = array_slice($b, $swap_list[0], end($swap_list) + 1);
    $sub_list_sort = array_slice($a, $swap_list[0], end($swap_list) + 1);
    $sub_list_reverse = array_reverse($sub_list);

    if ($sub_list_reverse == $sub_list_sort) {
        echo 'yes' . PHP_EOL;
        echo ($swap_list[0] + 1) . ' ' . (end($swap_list) + 1);
    } else {
        echo 'no';
    }
}


<?

error_reporting(false);

$handle = fopen('php://stdin', 'r');

if (file_exists("in.txt")) {
    error_reporting(E_ALL);
    $handle = fopen('in.txt', 'r');
    set_time_limit(1);
};

$n = intval(fgets($handle));
$n5 = 0;
$n0 = 0;

$array = explode(" ", fgets($handle));

foreach($array as $c) {
    if ($c == 0) $n0++;
    else $n5++;
}

$k = intval(5*$n5/45);

if ($n0 == 0) die("-1");
if ($n0 > 0 && $k == 0) die("0");
echo str_repeat("5", $k*9).str_repeat("0", $n0);

?>


<?php
$lines = explode("\n", str_replace("\r", "", file_get_contents("php://stdin")));
list($n, $m) = explode(" ", array_shift($lines));
$tree = [];
for ($i = 0; $i < $m; $i++) {
    list($x, $y) = explode(" ", $lines[$i]);
    if (!isset($tree[$x]))
        $tree[$x] = 0;
    if (!isset($tree[$y]))
        $tree[$y] = 0;
    $tree[$x]++;
    $tree[$y]++;
}

$counts = [];
foreach ($tree as $val) {
    if (!isset($counts[$val])) {
        $counts[$val] = 1;
        if (count($counts) > 2)
            die("unknown topology");
    } else {
        $counts[$val]++;
    }
}

if (count($counts) == 1 && !empty($counts[2]))
    die("ring topology");
if (count($counts) == 2 && $counts[1] == 2 && $counts[2] > 1)
    die("bus topology");
$keys = array_keys($counts);
sort($keys);
if ($keys[0] == 1 && $keys[1] == $n-1)
    die("star topology");
echo "unknown topology";

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
#print_r($numbers);
$a = array_count_values($numbers);
asort($a);
#print_r($a);
#$av = array_values($a);
if (count($a) == 2 && $a[2] == $n - 2 && $a[1] == 2) {
    echo 'bus topology';
} elseif (count($a) == 1 && $a[2] == $n) {
    echo 'ring topology';
} elseif (count($a) == 2 && $a[1] == $n - 1 && $a[$n - 1] == 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?

$num = explode(' ', trim(fgets(STDIN)));
for ($i = 0; $i < $num[1]; $i++) {
    $arr = explode(' ', trim(fgets(STDIN)));
    $res[$arr[0]][$arr[1]] = 1;
    $res[$arr[1]][$arr[0]] = 1;
}
$result = Array();
$tmp = 0;
foreach ($res as $a) {
    foreach ($a as $b) {
        $result[$tmp] += $b;
    }
    $tmp += 1;
}
function cOne($var){
return ($var == 1);
}
function cTwo($var){
return ($var == 2);
}
$tmp = array_unique($result);
sort($tmp);
if (count($tmp) == 1 && $tmp[0] == 2)
    echo 'ring topology
';
elseif (count ($tmp) == 2 && $tmp[0] == 1 && $tmp[1] == $num[0] - 1)
    echo 'star topology
';
elseif (count($tmp) == 2 && $tmp[0] == 1 && $tmp[1] == 2 && count(array_filter($result, "cOne")) == 2 && count(array_filter($result, "cTwo")) == $num[0]-2)
    echo 'bus topology
';
else
    echo 'unknown topology
';
?>

<?

list($n, $m) = explode(" ", fgets(STDIN));

$n = (int)$n;
$m = (int)$m;

$top_counts = array();
while($m--) {
    list($top1, $top2) = explode(" ", fgets(STDIN));

    $top_counts[(int)$top1]++;
    $top_counts[(int)$top2]++;
}

$one_cnt = 0;
$two_cnt = 0;
$many = 0;

foreach($top_counts as $top => $count) {
    if($count == 1)
        $one_cnt++;
    elseif($count == 2)
        $two_cnt++;
    else // граф связный, значит только больше
        $many++;
}

if($one_cnt == 2 && $many == 0)
    die("bus topology");

if($one_cnt == 0 && $many == 0)
    die("ring topology");

if($two_cnt == 0 && $many == 1)
    die("star topology");

die("unknown topology");

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
#print_r($numbers);
$a = array_count_values($numbers);
sort($a);
#print_r($a);
if (count($a) == 2 && $a[0] == 2 && $a[1] == $n - 2) {
    echo 'bus topology';
} elseif (count($a) == 1 && $a[0] == $n) {
    echo 'ring topology';
} elseif (count($a) == 2 && $a[0] == 1 && $a[1] == $n - 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
$a = array_count_values($numbers);
sort($a);
if (count($a) == 2 && $a[0] == 2 && $a[1] == $n - 2) {
    echo 'bus topology';
} elseif (count($a) == 1) {
    echo 'ring topology';
} elseif (count($a) == 2 && $a[0] == 1 && $a[1] == $n - 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
$a = array_count_values($numbers);
sort($a);
if ($a[0] == 2 && $a[1] == $n - 2) {
    echo 'bus topology';
} elseif (count($a) == 1) {
    echo 'ring topology';
} elseif (count($a) == 2 && $a[0] == 1 && $a[1] == $n - 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
#print_r($numbers);
$a = array_count_values($numbers);
sort($a);
#print_r($a);
if (count($a) == 2 && $a[0] == 2 && $a[1] == $n - 2) {
    echo 'bus topology';
} elseif (count($a) == 1 && $a[0] == $n && in_array(2, $numbers)) {
    echo 'ring topology';
} elseif (count($a) == 2 && $a[0] == 1 && $a[1] == $n - 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
#print_r($numbers);
$a = array_count_values($numbers);
asort($a);
#print_r($a);
$av = array_values($a);
if (count($a) == 2 && $av[0] == 2 && $av[1] == $n - 2) {
    echo 'bus topology';
} elseif (count($a) == 1 && $a[2] == $n) {
    echo 'ring topology';
} elseif (count($a) == 2 && $av[0] == 1 && $av[1] == $n - 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?php

$fIn = fopen('php://stdin', 'r');
$n = preg_split('[ ]', fgets($fIn));
$m = intval($n[1]);
$n = intval($n[0]);

$numbers = array();
for ($i = 0; $i < $m; ++$i) {
    $str = preg_split('[ ]', fgets($fIn));
    for ($j = 0; $j < 2; ++$j) {
        $num = intval($str[$j]);
        if (isset($numbers[$num]))
            $numbers[$num]++;
        else
            $numbers[$num] = 1;
    }
}
#print_r($numbers);
$a = array_count_values($numbers);
sort($a);
#print_r($a);
if (count($a) == 2 && $a[0] == 2 && $a[1] == $n - 2) {
    echo 'bus topology';
} elseif (count($a) == 1 && $a[0] == 2) {
    echo 'ring topology';
} elseif (count($a) == 2 && $a[0] == 1 && $a[1] == $n - 1) {
    echo 'star topology';
} else {
    echo 'unknown topology';
}
?>

<?php
$lines = explode("\n", str_replace("\r", "", file_get_contents("php://input")));
list($n, $m) = explode(" ", array_shift($lines));
$tree = [];
for ($i = 0; $i < $m; $i++) {
    list($x, $y) = explode(" ", $lines[$i]);
    if (!isset($tree[$x]))
        $tree[$x] = 0;
    if (!isset($tree[$y]))
        $tree[$y] = 0;
    $tree[$x]++;
    $tree[$y]++;
}

$counts = [];
foreach ($tree as $val) {
    if (!isset($counts[$val])) {
        $counts[$val] = 1;
        if (count($counts) > 2)
            die("unknown topology");
    } else {
        $counts[$val]++;
    }
}

if (count($counts) == 1 && !empty($counts[2]))
    die("ring topology");
if (count($counts) == 2 && $counts[1] == 2 && $counts[2] > 1)
    die("bus topology");
$keys = array_keys($counts);
sort($keys);
if ($keys[0] == 1 && $keys[1] == $n-1)
    die("star topology");
echo "unknown topology";

<?php
$lines = explode("\n", str_replace("\r", "", file_get_contents("php://input")));
list($n, $m) = explode(" ", array_shift($lines));
$tree = [];
for ($i = 0; $i < $m; $i++) {
    list($x, $y) = explode(" ", $lines[$i]);
    if (!isset($tree[$x]))
        $tree[$x] = 0;
    if (!isset($tree[$y]))
        $tree[$y] = 0;
    $tree[$x]++;
    $tree[$y]++;
}

$counts = [];
foreach ($tree as $val) {
    if (!isset($counts[$val])) {
        $counts[$val] = 1;
        if (count($counts) > 2)
            die("unknown topology");
    } else {
        $counts[$val]++;
    }
}

if (count($counts) == 1 && !empty($counts[2]))
    die("ring topology");
if (count($counts) == 2 && $counts[1] == 2 && $counts[2] > 1)
    die("bus topology");
$keys = array_keys($counts);
sort($keys);
if ($keys[0] == 1 && $keys[1] > 2)
    die("star topology");
echo "unknown topology";


<?php
#1187A
$n = (int)trim(fgets(STDIN));
while ($n--) {
    [$eggsCount, $toysCount, $stickersCount] = fscanf(STDIN, '%u %u %u');
    echo ($eggsCount - min($toysCount, $stickersCount) + 1) . PHP_EOL;
}

<?php
$a = trim(fgets(STDIN));
for($x = 1; $x <= $a; $x++)
{
     list($b, $c, $d) = explode(" ", trim(fgets(STDIN)));
     print $b - min($c, $d) + 1 . "\n";
}
?>


<?php
function number_taxi($str){
/*$arr = explode("-", $str);
	for ($i = 0; $i < count($arr) - 1; $i++) {
		if ($arr[$i] !== $arr[$i + 1]) return false;
	}
*/
	$str = str_replace("-", "", $str);
	$arr = str_split($str);
	$temp = $arr[0];
	foreach ($arr as $as_i) {
		if ($temp !== $as_i) return false;
	}
	return true;
}

function number_pizza($str){
/*	$arr = explode("-", $str);
	$temp_c_arr = array();
	$temp_c = 0;
	//for ($i = 0; $i < count($arr) - 1; $i++) {
	for ($i = 0; $i < count($arr); $i++) {
		$temp_c_arr = str_split($arr[$i]);
		//if ($temp_c_arr[0] > $temp_c_arr[1]) return false;
		if ($temp_c_arr[0] < $temp_c_arr[1]) return false;
		else if ($temp_c_arr[0] === $temp_c_arr[1]) $temp_c++;
	}
	if ($temp_c === 3) return false;
*/
	$str = str_replace("-", "", $str);
	$arr = str_split($str);
	$temp = 10;
	foreach ($arr as $as_i) {
		if ($temp <= $as_i) return false;
		$temp = $as_i;
	}
	return true;
}
/*
function arr_make_names($arr) {
	$temp_arr = array();
	foreach ($arr as $as_i) {
		if (is_array($as_i) === true) {
			$temp_arr[] = get_array_message($as_i, ", ");
		} else {
			$temp_arr[] = $as_i;
		}
	}
	return $temp_arr;
}
*/
function change_count_name(&$arr_c_el, &$arr_n_el, $c, $name){
	if ($arr_c_el < $c) {
		$arr_c_el = $c;
		$arr_n_el = $name;
	} else if ($arr_c_el === $c) {
		if ($arr_n_el !== "") {
			//$arr_n[0] = $arr_n[0] . ", " . $name;
			$arr_n_el .= ", " . $name;
		} else {
			$arr_n_el = $name;
		}
	}
}

function change_counts_names(&$arr_c, &$arr_n, $c_t, $c_p, $c_g, $name){
	change_count_name($arr_c[0], $arr_n[0], $c_t, $name);
	change_count_name($arr_c[1], $arr_n[1], $c_p, $name);
	change_count_name($arr_c[2], $arr_n[2], $c_g, $name);
}

function print_names($arr){
	print("If you want to call a taxi, you should call: $arr[0].\n");
	print("If you want to order a pizza, you should call: $arr[1].\n");
	print("If you want to go to a cafe with a wonderful girl, you should call: $arr[2].");
}

function solve(){
	//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
	$Token = new Token(rtrim(fgets(STDIN)), " ");
	$inp_n = $Token->nextInt();
	$ans_name_arr = array_fill(0, 3, "");
	$ans_count_arr = array_fill(0, 3, -1);
	for ($i = 0; $i < $inp_n; $i++) {
		//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
		$Token = new Token(rtrim(fgets(STDIN)), " ");
		$inp_s = $Token->nextInt();
		//$inp_name = $Token->nextInt();
		$inp_name = $Token->nextToken();
		$temp_c_taxi = 0;
		$temp_c_pizza = 0;
		$temp_c_girl = 0;
		for ($j = 0; $j < $inp_s; $j++) {
			//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
			$Token = new Token(rtrim(fgets(STDIN)), " ");
			$inp_number = $Token->nextToken();
			if (number_taxi($inp_number) === true) {
				$temp_c_taxi++;
			} else if (number_pizza($inp_number) === true) {
				$temp_c_pizza++;
			} else {
				$temp_c_girl++;
			}
		}
		change_counts_names($ans_count_arr, $ans_name_arr, $temp_c_taxi, $temp_c_pizza, $temp_c_girl, $inp_name);
	}
	print_names($ans_name_arr);
}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $_
//overwritten function $aa---_

class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}

/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			//$message .= "$value" . " ";
			$message .= $value . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}

function aarray_printf(array $array, $str) {
		$message = "";
		foreach ($array as $value) {
			$message .= $value . $str;
		}
		$message = rtrim($message, $str);
		printf('%s', $message);
}
/*
function get_array_message(array $array, $str) {
		$message = "";
		foreach ($array as $value) {
			//$message .= "$value" . "$str";
			$message .= $value . $str;
		}
		$message = rtrim($message, $str);
		return $message;
}
*/
?>

<?php
function number_taxi($str){
/*$arr = explode("-", $str);
	for ($i = 0; $i < count($arr) - 1; $i++) {
		if ($arr[$i] !== $arr[$i + 1]) return false;
	}
*/
	$str = str_replace("-", "", $str);
	$arr = str_split($str);
	$temp = $arr[0];
	foreach ($arr as $as_i) {
		if ($temp !== $as_i) return false;
	}
	return true;
}

function number_pizza($str){
/*	$arr = explode("-", $str);
	$temp_c_arr = array();
	$temp_c = 0;
	//for ($i = 0; $i < count($arr) - 1; $i++) {
	for ($i = 0; $i < count($arr); $i++) {
		$temp_c_arr = str_split($arr[$i]);
		//if ($temp_c_arr[0] > $temp_c_arr[1]) return false;
		if ($temp_c_arr[0] < $temp_c_arr[1]) return false;
		else if ($temp_c_arr[0] === $temp_c_arr[1]) $temp_c++;
	}
	if ($temp_c === 3) return false;
*/
	$str = str_replace("-", "", $str);
	$arr = str_split($str);
	$temp = 10;
	foreach ($arr as $as_i) {
		if ($temp <= $as_i) return false;
		$temp = $as_i;
	}
	return true;
}
/*
function arr_make_names($arr) {
	$temp_arr = array();
	foreach ($arr as $as_i) {
		if (is_array($as_i) === true) {
			$temp_arr[] = get_array_message($as_i, ", ");
		} else {
			$temp_arr[] = $as_i;
		}
	}
	return $temp_arr;
}
*/

function change_counts_names(&$arr_c, &$arr_n, $c_t, $c_p, $c_g, $name){
	if ($arr_c[0] < $c_t) {
		$arr_c[0] = $c_t;
		$arr_n[0] = $name;
	} else if ($arr_c[0] === $c_t) {
		if ($arr_n[0] !== "") {
			//$arr_n[0] = $arr_n[0] . ", " . $name;
			$arr_n[0] .= ", " . $name;
		} else {
			$arr_n[0] = $name;
		}
	}
	if ($arr_c[1] < $c_p) {
		$arr_c[1] = $c_p;
		$arr_n[1] = $name;
	} else if ($arr_c[1] === $c_p) {
		if ($arr_n[1] !== "") {
			//$arr_n[1] = $arr_n[1] . ", " . $name;
			$arr_n[1] .= ", " . $name;
		} else {
			$arr_n[1] = $name;
		}
	}
	if ($arr_c[2] < $c_g) {
		$arr_c[2] = $c_g;
		$arr_n[2] = $name;
	//} else if ($arr_c[2] = $c_g) {
	} else if ($arr_c[2] === $c_g) {
		if ($arr_n[2] !== "") {
			//$arr_n[2] = "$arr_n[1], $name";
			//$arr_n[2] = $arr_n[2] . ", " . $name;
			$arr_n[2] .= ", " . $name;
		} else {
			$arr_n[2] = $name;
		}
	}
}

function print_names($arr){
	print("If you want to call a taxi, you should call: $arr[0].\n");
	print("If you want to order a pizza, you should call: $arr[1].\n");
	print("If you want to go to a cafe with a wonderful girl, you should call: $arr[2].");
}

function solve(){
	//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
	$Token = new Token(rtrim(fgets(STDIN)), " ");
	$inp_n = $Token->nextInt();
	$ans_name_arr = array_fill(0, 3, "");
	$ans_count_arr = array_fill(0, 3, -1);
	for ($i = 0; $i < $inp_n; $i++) {
		//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
		$Token = new Token(rtrim(fgets(STDIN)), " ");
		$inp_s = $Token->nextInt();
		//$inp_name = $Token->nextInt();
		$inp_name = $Token->nextToken();
		$temp_c_taxi = 0;
		$temp_c_pizza = 0;
		$temp_c_girl = 0;
		for ($j = 0; $j < $inp_s; $j++) {
			//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
			$Token = new Token(rtrim(fgets(STDIN)), " ");
			$inp_number = $Token->nextToken();
			if (number_taxi($inp_number) === true) {
				$temp_c_taxi++;
			} else if (number_pizza($inp_number) === true) {
				$temp_c_pizza++;
			} else {
				$temp_c_girl++;
			}
		}
		change_counts_names($ans_count_arr, $ans_name_arr, $temp_c_taxi, $temp_c_pizza, $temp_c_girl, $inp_name);
	}
	print_names($ans_name_arr);
}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $_
//overwritten function $aa---_

class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}

/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			//$message .= "$value" . " ";
			$message .= $value . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}

function aarray_printf(array $array, $str) {
		$message = "";
		foreach ($array as $value) {
			$message .= $value . $str;
		}
		$message = rtrim($message, $str);
		printf('%s', $message);
}
/*
function get_array_message(array $array, $str) {
		$message = "";
		foreach ($array as $value) {
			//$message .= "$value" . "$str";
			$message .= $value . $str;
		}
		$message = rtrim($message, $str);
		return $message;
}
*/
?>

<?php
error_reporting(0);
/* Class For Read Input - laurenceHR
*/
class stdIn{
    var $ntxt = 0;
    var $nline = 0;
    var $arr_txt;
    var $arr_line;
    var $linex;
    var $liney;
    function stdIn($local = false){
        if($local){
            $dir = fopen("input.txt", 'r');
        }else{
            $dir = fopen("php://stdin", 'r');
        }
        $datatxt = stream_get_contents($dir);
        $del = Array("\n","\r","\n\r");
        $data = explode("\n",$datatxt);
        $il = 0;$id = 0;//
        foreach($data as $line){
            if(strlen($line) > 0){
                $line = str_replace($del,'',$line);
                $dataex[] = $line;
                $text = explode(" ",$line);
                foreach($text as $txt){
                    $arr_txt[] = $txt;
                    $this->linex[$id] = $il;
                    $this->liney[$il] = $id;
                    $id++;//
                }
            }
        $il++;//
        }
        $this->arr_line = $dataex;
        $this->arr_txt  = $arr_txt;
    }
    function G(){// Get Last Txt
        $ret = $this->arr_txt[$this->ntxt++];
        $this->nline = $this->linex[$this->ntxt];
        return $ret;
    }
    function GL(){ //Get Last Line
        $this->ntxt = $this->liney[$this->nline]+1;
        return $this->arr_line[$this->nline++];
    }
}
$dxs = new stdIn(false);
//define("I",$dxs);
//define("STL",$dxs->GL());
//////////////////////////////////////////////////////////////

//echo ":".print_r($inp->lineal,true).":";
function typeN($nums){
    $number = explode("-",$nums);
    $dig11 = (int)($number[0]/10);$dig12 = (int)($number[0]%10);
    $dig21 = (int)($number[1]/10);$dig22 = (int)($number[1]%10);
    $dig31 = (int)($number[2]/10);$dig32 = (int)($number[2]%10);
    if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){return 'pizza';}
    else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){return 'taxi';}
    else{return 'girl';}
}
function joinA($c,$txt){$i=0;$ret = "";
    foreach($txt as $it){if($i>0){$ret .= $c." ";}
    $ret .= $it;$i++;}
    return $ret;
}
$max['taxi']=0;$max['pizza']=0;$max['girl']=0;
$n = $dxs->G();
for($i=0;$i<$n;$i++){
    $nums = $dxs->G();
    $name = $dxs->G();
    $total[$name]['taxi']=0;$total[$name]['pizza']=0;$total[$name]['girl']=0;
    for($j=0;$j<$nums;$j++){
        $telf = $dxs->G();$typ = typeN($telf);
        $nt = ++$total[$name][$typ];
        if($max[$typ]<$nt){$max[$typ]=$nt;}
    }
}
//print_r($total);
//print_r($max);
foreach($total as $name => $nmrs){
    foreach($nmrs as $type => $val){
        if($val == $max[$type]){$ret[$type][] = $name;}
    }
}
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";

?>

<?php
error_reporting(0);

function joinA($c,$txt){
    $i=0;$ret = "";
    foreach($txt as $it){
        if($i>0){$ret .= $c." ";}
        $del = Array("\n","\r","\n\r");
        $ret .= str_replace($del,'',$it);
        $i++;
    }
    return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
$max['taxi'] = 0;
$max['pizza'] = 0;
$max['girl'] = 0;
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";

    // Depura Linea //
    $del = Array("\n","\r","\n\r");
    $intxtln = str_replace($del,'',$intxt[$nl]);//echo "<".$intxtn."
";
    if(strlen($intxtln) == 0){break;}
    //

    $lne = explode(" ",$intxtln);$nl++;

    $t = $lne[0]; //echo $t."
";
    $name = $lne[1];//echo $name."
";
    $total[$name]['taxi'] = 0;
    $total[$name]['pizza'] = 0;
    $total[$name]['girl'] = 0;
    for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

        $number = explode("-",$intxt[$nl]);$nl++;
        $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);
        $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);
        $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);

        if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){
            $mpizza = @++$total[$name]['pizza'];
            if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
        }else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){
            $mtaxi = @++$total[$name]['taxi'];
            if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
        }else{
            $mgirl =@++$total[$name]['girl'];
            if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
        }

    }
}
//print_r($total);
foreach($total as $name => $tot){
    foreach($tot as $type => $val){
        if($val == $max[$type]){$ret[$type][] = $name;}
    }
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
function number_taxi($str){
/*$arr = explode("-", $str);
	for ($i = 0; $i < count($arr) - 1; $i++) {
		if ($arr[$i] !== $arr[$i + 1]) return false;
	}
*/
	$str = str_replace("-", "", $str);
	$arr = str_split($str);
	$temp = $arr[0];
	foreach ($arr as $as_i) {
		if ($temp !== $as_i) return false;
	}
	return true;
}

function number_pizza($str){
/*	$arr = explode("-", $str);
	$temp_c_arr = array();
	$temp_c = 0;
	//for ($i = 0; $i < count($arr) - 1; $i++) {
	for ($i = 0; $i < count($arr); $i++) {
		$temp_c_arr = str_split($arr[$i]);
		//if ($temp_c_arr[0] > $temp_c_arr[1]) return false;
		if ($temp_c_arr[0] < $temp_c_arr[1]) return false;
		else if ($temp_c_arr[0] === $temp_c_arr[1]) $temp_c++;
	}
	if ($temp_c === 3) return false;
*/
	$str = str_replace("-", "", $str);
	$arr = str_split($str);
	$temp = 10;
	foreach ($arr as $as_i) {
		if ($temp <= $as_i) return false;
		$temp = $as_i;
	}
	return true;
}
/*
function arr_make_names($arr) {
	$temp_arr = array();
	foreach ($arr as $as_i) {
		if (is_array($as_i) === true) {
			$temp_arr[] = get_array_message($as_i, ", ");
		} else {
			$temp_arr[] = $as_i;
		}
	}
	return $temp_arr;
}
*/

function change_counts_names(&$arr_c, &$arr_n, $c_t, $c_p, $c_g, $name){
	if ($arr_c[0] < $c_t) {
		$arr_c[0] = $c_t;
		$arr_n[0] = $name;
	} else if ($arr_c[0] === $c_t) {
		if ($arr_n[0] !== "") {
			//$arr_n[0] = $arr_n[0] . ", " . $name;
			$arr_n[0] .= ", " . $name;
		} else {
			$arr_n[0] = $name;
		}
	}
	if ($arr_c[1] < $c_p) {
		$arr_c[1] = $c_p;
		$arr_n[1] = $name;
	} else if ($arr_c[1] === $c_p) {
		if ($arr_n[1] !== "") {
			//$arr_n[1] = $arr_n[1] . ", " . $name;
			$arr_n[1] .= ", " . $name;
		} else {
			$arr_n[1] = $name;
		}
	}
	if ($arr_c[2] < $c_g) {
		$arr_c[2] = $c_g;
		$arr_n[2] = $name;
	//} else if ($arr_c[2] = $c_g) {
	} else if ($arr_c[2] === $c_g) {
		if ($arr_n[2] !== "") {
			//$arr_n[2] = "$arr_n[1], $name";
			//$arr_n[2] = $arr_n[2] . ", " . $name;
			$arr_n[2] .= ", " . $name;
		} else {
			$arr_n[2] = $name;
		}
	}
}

function print_names($arr){
	print("If you want to call a taxi, you should call: $arr[0]\n");
	print("If you want to order a pizza, you should call: $arr[1]\n");
	print("If you want to go to a cafe with a wonderful girl, you should call: $arr[2]");
}

function solve(){
	//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
	$Token = new Token(rtrim(fgets(STDIN)), " ");
	$inp_n = $Token->nextInt();
	$ans_name_arr = array_fill(0, 3, "");
	$ans_count_arr = array_fill(0, 3, -1);
	for ($i = 0; $i < $inp_n; $i++) {
		//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
		$Token = new Token(rtrim(fgets(STDIN)), " ");
		$inp_s = $Token->nextInt();
		//$inp_name = $Token->nextInt();
		$inp_name = $Token->nextToken();
		$temp_c_taxi = 0;
		$temp_c_pizza = 0;
		$temp_c_girl = 0;
		for ($j = 0; $j < $inp_s; $j++) {
			//$Token = new Token(rtrim(fgets(STDIN), "\n"), " ");
			$Token = new Token(rtrim(fgets(STDIN)), " ");
			$inp_number = $Token->nextToken();
			if (number_taxi($inp_number) === true) {
				$temp_c_taxi++;
			} else if (number_pizza($inp_number) === true) {
				$temp_c_pizza++;
			} else {
				$temp_c_girl++;
			}
		}
		change_counts_names($ans_count_arr, $ans_name_arr, $temp_c_taxi, $temp_c_pizza, $temp_c_girl, $inp_name);
	}
	print_names($ans_name_arr);
}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $_
//overwritten function $aa---_

class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}

/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			//$message .= "$value" . " ";
			$message .= $value . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}

function aarray_printf(array $array, $str) {
		$message = "";
		foreach ($array as $value) {
			$message .= $value . $str;
		}
		$message = rtrim($message, $str);
		printf('%s', $message);
}
/*
function get_array_message(array $array, $str) {
		$message = "";
		foreach ($array as $value) {
			//$message .= "$value" . "$str";
			$message .= $value . $str;
		}
		$message = rtrim($message, $str);
		return $message;
}
*/
?>

<?php
error_reporting(0);
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
$max['taxi'] = 0;
$max['pizza'] = 0;
$max['girl'] = 0;
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";

	// Depura Linea //
	$del = Array("\n","\r","\n\r");
	$intxtln = str_replace($del,'',$intxt[$nl]);//echo "<".$intxtn."
";
	if(strlen($intxtln) == 0){break;}
	//

	$lne = explode(" ",$intxtln);$nl++;

	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	$total[$name]['taxi'] = 0;
	$total[$name]['pizza'] = 0;
	$total[$name]['girl'] = 0;
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}

	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){$ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";
		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}
	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){ $ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php

$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";
		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1 > $num2 && $num2 > $num3){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}
	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){ $ret[$type][] = $name;}
	}
}
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".implode(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".implode(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".implode(",",$ret['girl']).".\n";
?>

<?php
error_reporting(0);
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
//$dir = fopen("php://stdin", 'r');
$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ echo "->".$intxt[$nl]."
";

		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}

	}
	//if($t==0){$nl++;}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){$ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
error_reporting(0);
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){ //echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}

	}
	//if($t==0){$nl++;}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){$ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
error_reporting(0);
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){ //echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}

	}
	if($t==0){
		@$total[$name]['taxi'] = 0;
		@$total[$name]['pizza'] = 0;
		@$total[$name]['girl'] = 0;
	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){$ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
function joinA($c,$txt){
    $i=0;$ret = "";
    foreach($txt as $it){
        if($i>0){$ret .= $c." ";}
        $del = Array("\n","\r","\n\r");
        $ret .= str_replace($del,'',$it);
        $i++;
    }
    return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";
    $lne = explode(" ",$intxt[$nl]);$nl++;
    $t = $lne[0]; //echo $t."
";
    $name = $lne[1];//echo $name."
";
    for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";
        $number = explode("-",$intxt[$nl]);$nl++;
        $num1 = $number[0];
        $num2 = $number[1];
        $num3 = $number[2];

        if($num1+$num2+$num3 == 3*$num1){
            $mtaxi = @++$total[$name]['taxi'];
            if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
        }else if($num1 > $num2 && $num2 > $num3){
            $mpizza = @++$total[$name]['pizza'];
            if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
        }else{
            $mgirl =@++$total[$name]['girl'];
            if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
        }
    }
}
//print_r($total);
foreach($total as $name => $tot){
    foreach($tot as $type => $val){
        if($val == $max[$type]){ $ret[$type][] = $name;}
    }
}
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".\n";
?>

<?php
error_reporting(0);
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt)-1;$nl){ //echo "<".$intxt[$nl]."
";
	$del = Array("\n","\r","\n\r");
	//$lne = str_replace($del,'',$lne);
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}

	}
	if($t==0){
		@$total[$name]['taxi'] = 0;
		@$total[$name]['pizza'] = 0;
		@$total[$name]['girl'] = 0;
	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){$ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$del = Array("\n","\r","\n\r");
		$ret .= str_replace($del,'',$it);
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";
		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10  &&  $num3/10>$num3%10){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}
	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){ $ret[$type][] = $name;}
	}
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']);
?>

<?php
function joinA($c,$txt){
	$i=0;$ret = "";
	foreach($txt as $it){
		if($i>0){$ret .= $c." ";}
		$ret .= $it;
		$i++;
	}
	return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";
	$lne = explode(" ",$intxt[$nl]);$nl++;
	$t = $lne[0]; //echo $t."
";
	$name = $lne[1];//echo $name."
";
	for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";
		$number = explode("-",$intxt[$nl]);$nl++;
		$num1 = $number[0];
		$num2 = $number[1];
		$num3 = $number[2];

		if($num1+$num2+$num3 == 3*$num1){
			$mtaxi = @++$total[$name]['taxi'];
			if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
		}else if($num1 > $num2 && $num2 > $num3){
			$mpizza = @++$total[$name]['pizza'];
			if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
		}else{
			$mgirl =@++$total[$name]['girl'];
			if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
		}
	}
}
//print_r($total);
foreach($total as $name => $tot){
	foreach($tot as $type => $val){
		if($val == $max[$type]){ $ret[$type][] = $name;}
	}
}
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
error_reporting(0);

function joinA($c,$txt){
    $i=0;$ret = "";
    foreach($txt as $it){
        if($i>0){$ret .= $c." ";}
        $del = Array("\n","\r","\n\r");
        $ret .= str_replace($del,'',$it);
        $i++;
    }
    return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
$max['taxi'] = 0;
$max['pizza'] = 0;
$max['girl'] = 0;
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";

    // Depura Linea //
    $del = Array("\n","\r","\n\r");
    $intxtln = str_replace($del,'',$intxt[$nl]);//echo "<".$intxtn."
";
    if(strlen($intxtln) == 0){break;}
    //

    $lne = explode(" ",$intxtln);$nl++;

    $t = $lne[0]; //echo $t."
";
    $name = $lne[1];//echo $name."
";
    $total[$name]['taxi'] = 0;
    $total[$name]['pizza'] = 0;
    $total[$name]['girl'] = 0;
    for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

        $number = explode("-",$intxt[$nl]);$nl++;
        $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);
        $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);
        $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);

        if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){
            $mpizza = @++$total[$name]['pizza'];
            if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
        }else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){
            $mtaxi = @++$total[$name]['taxi'];
            if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
        }else{
            $mgirl =@++$total[$name]['girl'];
            if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
        }

    }
}
//print_r($total);
foreach($total as $name => $tot){
    foreach($tot as $type => $val){
        $ret[$type][] = $name;
    }
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>

<?php
error_reporting(0);

function joinA($c,$txt){
    $i=0;$ret = "";
    foreach($txt as $it){
        if($i>0){$ret .= $c." ";}
        $del = Array("\n","\r","\n\r");
        $ret .= str_replace($del,'',$it);
        $i++;
    }
    return $ret;
}
$dir = fopen("php://stdin", 'r');
//$dir = fopen("input.txt", 'r');
$input = stream_get_contents($dir);
//print_r($input);
$intxt=explode("\n",$input);
$n = $intxt[0];
$max['taxi'] = 0;
$max['pizza'] = 0;
$max['girl'] = 0;
for($nl=1;$nl<count($intxt);$nl){// echo "<".$intxt[$nl]."
";

    // Depura Linea //
    $del = Array("\n","\r","\n\r");
    $intxtln = str_replace($del,'',$intxt[$nl]);//echo "<".$intxtn."
";
    if(strlen($intxtln) == 0){break;}
    //

    $lne = explode(" ",$intxtln);$nl++;

    $t = $lne[0]; //echo $t."
";
    $name = $lne[1];//echo $name."
";
    $total[$name]['taxi'] = 0;
    $total[$name]['pizza'] = 0;
    $total[$name]['girl'] = 0;
    for($j=1;$j<=$t;$j++){ //echo "->".$intxt[$nl]."
";

        $number = explode("-",$intxt[$nl]);$nl++;
        $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);
        $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);
        $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);

        if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){
            $mpizza = @++$total[$name]['pizza'];
            if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}
        }else if(($dig11 + $dig12)==($dig21 + $dig22) && ($dig21 + $dig22)==($dig32 + $dig31)){
            $mtaxi = @++$total[$name]['taxi'];
            if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}
        }else{
            $mgirl =@++$total[$name]['girl'];
            if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}
        }

    }
}
//print_r($total);
foreach($total as $name => $tot){
    foreach($tot as $type => $val){
        if($val == $max[$type]){$ret[$type][] = $name;}
    }
}
//echo "\n";
//print_r($ret);
//solution
echo "If you want to call a taxi, you should call: ".joinA(",",$ret['taxi']).".\n";
echo "If you want to order a pizza, you should call: ".joinA(",",$ret['pizza']).".\n";
echo "If you want to go to a cafe with a wonderful girl, you should call: ".joinA(",",$ret['girl']).".";
?>