<?php

$n = fgets(STDIN);
$num = fgets(STDIN);

$numbers = explode(' ', $num);

$max = 1;
$currentNum = $numbers[0];
$currentLenth = 1;

for ($i = 1; $i < $n; $i++)
{
	if ((int)$currentNum <= (int)$numbers[$i])
	{
		$currentLenth += 1;
	}
	else
	{
		if ($currentLenth > $max)
		{
			$max = $currentLenth;
		}

		$currentLenth = 1;
	}

	$currentNum = $numbers[$i];
}

if ($currentLenth > $max)
{
	$max = $currentLenth;
}

// $max = 0;
// $currentLenth = 0;

// for ($i = 0; $i < $n; $i++)
// {
// 	if (isset($numbers[$i + 1]))
// 	{
// 		if ($numbers[$i] <= $numbers[$i + 1])
// 		{
// 			$currentLenth += 1;
// 		}
// 		else
// 		{
// 			$
// 		}
// 	}
// }

echo $max;

<?php

$number = fgets(STDIN);
$line = fgets(STDIN);

$line = trim($line);
$line = explode(' ', $line);	  	// cоздаем массив из строки
$result = [];

for ($i=0; $i < $number; $i++) {
	$oneString = 1;
	while ($line[$i+1] >= $line[$i]) {
		$oneString++;
		$i++;
	}
	$result[] = $oneString;
}

echo max($result);

<?php
//$file = fopen('input.in', 'r');
$file = STDIN;
$n = trim(fgets($file));
$aArray = explode(" ", trim(fgets($file)));
$result = 1;
$temp = 1;
$c = $aArray[0];
for ($i = 1; $i < $n; $i++) {
    if ($aArray[$i]<$c) {
        $result = max($result, $temp);
        $temp = 1;
        $c = $aArray[$i];
    } else {
        $c = $aArray[$i];
        $temp++;
    }
}
$result = max($result, $temp);
echo $result;

<?php

error_reporting(0);
$n = (int) fgets(STDIN);
$arr = array_map('intval', preg_split('/ /', fgets(STDIN)));
$res = array();
$counter = 1;
for($i=0; $i < count($arr); $i++) {
	if($arr[$i] <= $arr[$i+1]) {
		$counter += 1;
	} else {
		array_push($res, $counter);
		$counter = 1;
	}
}

echo max($res);

<?
$n=trim(fgets(STDIN));
$arr = explode(' ', trim(fgets(STDIN)));

$val = $arr[0];
$count = 1;
$max  = 1;
for($i=1;$i < $n; $i++)
{
  if($arr[$i]<$val)
   $count = 1;
  else
    $count++;
  $val = $arr[$i];
  $max = max($max,$count);
}
echo $max;

<?php
	$n = trim(fgets(STDIN));
	$money = explode(" ", trim(fgets(STDIN)));

	$count = 1;
	$arr_result = array();
	for($i=0;$i<$n;$i++)
	{
		if($i < ($n-1))
		{
			if($money[$i] <= $money[$i+1])
			{
				$count = $count + 1;
			}
			else
			{
				array_push($arr_result, $count);
				$count = 1;
			}
		}
		else
		{
			array_push($arr_result, $count);
			$count = 1;
		}
	}
	echo max($arr_result);
?>

<?php
  $n = fgets(STDIN);
  $a = explode(' ', trim(fgets(STDIN)));
  $bef = $cnt = $res = 0;
  for ($i = 0; $i < $n; $i++) {
    if ($a[$i] >= $bef)
      $cnt++;
    else
      $cnt = 1;
    $bef = $a[$i];
    $res = max($cnt, $res);
  }
  print($res);
?>

<?php

$n = (int) readline();
$arr = array_map('intval', explode(' ', fgets(STDIN)));
$max = 1;
$start_index = 0;
$prev = 0;
$cur_max = 1;
for($i =1;$i< $n ;$i++){
    if($arr[$i] < $arr[$i -1]){
        $cur_max = $i - $start_index;
        if($cur_max > $max){
            $max = $cur_max;
        }
        $start_index = $i;
    }
    if($i == $n-1){
        $cur_max = $i - $start_index +1;
        if($cur_max > $max){
            $max = $cur_max;
        }
    }
}

echo $max;

<?php

$a =(int)readline();
$ab = trim(fgets(STDIN));
$b = explode(" ", $ab);
$nrcount = 1;
$count= 1;
$pozitia = 1;

for($i=0; $i<$a-1;$i++) {
	if($b[$i] <= $b[$pozitia]){
		$nrcount++;
	}else{
		$nrcount = 1 ;
		 }
 	if((int)$count < (int)$nrcount){
		$count = $nrcount;
	}
	$pozitia ++;
}

echo $count;

<?php
$n = trim(fgets(STDIN));
$progression= explode(" ",trim(fgets(STDIN)));
$d=array(0);$k=0;$mul=0;
for ($i=0;$i<$n-1;$i++)
{
    if ($progression[$i]<=$progression[$i+1])
    {
        $mul++;
    }
    else
    {
        $d[$k]=$mul;
        $k++;
        $mul=0;
    }
}
$d[]=$mul;
rsort($d);
echo $d[0]+1;

<?php

$arr = array();
$tmp; // string
$n;
$i; // index
$ans; // answer

while(fgets(STDIN)){
    $tmp = fgets(STDIN);
    $arr = explode(' ',$tmp);
    //var_dump($arr);
    $n = str_word_count($tmp,0,' ') + 1;
    for($i = $tmp = $ans = 0 ; $i < $n ; $i ++){
        if( $i > 0 && (int)$arr[$i] < (int)$arr[$i-1] ){
            $ans = $tmp > $ans ? $tmp : $ans;
            $tmp = 1;
        }
        else{
            $tmp ++ ;
        }
    }
    echo $tmp > $ans ? $tmp : $ans;
}

?>

<?php
$n = fgets(STDIN);
settype($n,'int');
$input=explode(' ',trim(fgets(STDIN)));
$result=[];
$j=0;
for ($i=0; $i < $n-1 ; $i++) {
     if($input[$i] <= $input[$i+1])
     {
      @$result[$j]+=1;
     }else{
           $j++;
     }
}
echo max($result)+1;

<?php

$num = (int)readline();

$array = explode(' ', trim(fgets(STDIN)));

$counter = 1;

$max = 1;

for ($i = 1; $i < $num; $i++) {
    if($i >= $num) break;

    if ($array[$i - 1] <= $array[$i]) {
        $counter++;
    } elseif ($i + $max < $num && $array[$i + $max - 1] <= $array[$i + $max]) {

        // echo "i => $i; max => $max; counter => $counter\n";
        $i += $max;
        $counter = 1;
        $j = $i - 1;
        $k = $i + 1;

        while (($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) || ($k < $num && $array[$k - 1] <= $array[$k])) {
            // echo "j => $j; k => $k;";

            if ($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) {
                $counter++;
                $j--;
            }

            if ($k < $num && $array[$k - 1] <= $array[$k]) {
                $counter++;
                $k++;
            }

            // echo " count => $counter\n";
        }

        $i = $k + 1;

        if ($max < $counter) {
            $max = $counter;
        }

        $counter = 0;
        // $counter = 0;
        // $i = $i + $max;
        // $j = $i;
        // while($j > $max) {
        //     if($j >= $num) break;

        //     if($array[$j] >= $array[$j-1]) {
        //         $counter++;

        //     } else break;

        //     $j--;

        // }

        /* for($j = $i;$j > $max ;$j--) {
            if($array[$j] >= $array[$j-1]) {
                $counter++;

            } else break;

        }*/

    } else {
        $counter = 0;
        $i += $max - 1;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

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

fscanf($stdin, "%d\n", $n);

$nums = explode(" ", trim(fgets($stdin)));

$i = 0;
$max = 1;

foreach ($nums as $key => $num) {
    if ($i > $max) {
        $max = $i;
    }
    $i++;
    if ($key == 0) {
        continue;
    }
    if ($nums[$key - 1] <= $num) {
        continue;
    }
    $i = 1;
}
if ($i > $max) {
    $max = $i;
}

echo $max;

<?php

$num = (int)readline();

$array = explode(' ', trim(fgets(STDIN)));

$counter = 1;

$new_arr = array(1);

$max = 1;

for ($i = 0; $i < $num - 1; $i++) {
    if ($array[$i] <= $array[$i+1]) {
        $counter++;
    } else  {
        $counter = 1;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$temp1=1;
$temp2=1;

for ($i=0; $i < $n-1 ; $i++) {
	if ($a[$i] <= $a[$i+1]) {
		$temp1++;
	}else{
		if ($temp2 < $temp1)
			$temp2=$temp1;
		$temp1=1;
	}
}

if ($temp1 < $temp2) {
	echo $temp2;
}else{
	echo $temp1;
}

?>

<?php

$n = (int) readline();
$arr = explode(' ', fgets(STDIN));
$max = 1;
$start_index = 0;
$prev = 0;
$cur_max = 1;
for($i =1;$i< $n ;$i++){
    if($arr[$i] < $arr[$i -1]){
        $cur_max = $i - $start_index;
        if($cur_max > $max){
            $max = $cur_max;
        }
        $start_index = $i;
    }
    if($i == $n-1){
        $cur_max = $i - $start_index +1;
        if($cur_max > $max){
            $max = $cur_max;
        }
    }
}

echo $max;

<?php

$n = fgets(STDIN);
$num = fgets(STDIN);

$numbers = explode(' ', $num);

$max = 1;
$currentNum = $numbers[0];
$currentLenth = 1;

for ($i = 1; $i < $n; $i++)
{
	if ($currentNum <= $numbers[$i])
	{
		$currentLenth += 1;
	}
	else
	{
		if ($currentLenth > $max)
		{
			$max = $currentLenth;
		}

		$currentLenth = 1;
	}

	$currentNum = $numbers[$i];
}

if ($currentLenth > $max)
{
	$max = $currentLenth;
}

// $max = 0;
// $currentLenth = 0;

// for ($i = 0; $i < $n; $i++)
// {
// 	if (isset($numbers[$i + 1]))
// 	{
// 		if ($numbers[$i] <= $numbers[$i + 1])
// 		{
// 			$currentLenth += 1;
// 		}
// 		else
// 		{
// 			$
// 		}
// 	}
// }

echo $max;

<?php

$n = fgets(STDIN);
$num = fgets(STDIN);

$numbers = explode(' ', $num);

$max = 1;
$currentNum = $numbers[0];
$currentLenth = 1;

for ($i = 1; $i < $n; $i++)
{
	if ($currentNum <= $numbers[$i])
	{
		$currentLenth += 1;
	}
	else
	{
		if ($currentLenth > $max)
		{
			$max = $currentLenth;
			$currentLenth = 1;
		}
	}

	$currentNum = $numbers[$i];
}

if ($currentLenth > $max)
{
	$max = $currentLenth;
}

// $max = 0;
// $currentLenth = 0;

// for ($i = 0; $i < $n; $i++)
// {
// 	if (isset($numbers[$i + 1]))
// 	{
// 		if ($numbers[$i] <= $numbers[$i + 1])
// 		{
// 			$currentLenth += 1;
// 		}
// 		else
// 		{
// 			$
// 		}
// 	}
// }

echo $max;

<?php

$arr = array();
$tmp; // string
$n;
$i; // index
$ans; // answer

while(fgets(STDIN)){
    $tmp = fgets(STDIN);
    $arr = explode(' ',$tmp);
    //var_dump($arr);
    $n = str_word_count($tmp,0,' ') + 1;
    for($i = $tmp = $ans = 0 ; $i < $n ; $i ++){
        if( $i > 0 && (int)$arr[i] < (int)$arr[i-1] ){
            $ans = $tmp > $ans ? $tmp : $ans;
            $tmp = 1;
        }
        else{
            $tmp ++ ;
        }
    }
    echo $tmp > $ans ? $tmp : $ans;
}

?>

<?php

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

fscanf($stdin, "%d\n", $n);

$nums = explode(" ", trim(fgets($stdin)));

$i = 0;
$max = 1;

foreach ($nums as $key => $num) {
    $i++;
    if ($key == 0) {
        continue;
    }
    if ($nums[$key - 1] <= $num) {
        continue;
    }
    if ($i > $max) {
        $max = $i;
    }
    $i = 0;
}
if ($i > $max) {
    $max = $i;
}

echo $max;

<?php

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

fscanf($stdin, "%d\n", $n);

$nums = explode(" ", trim(fgets($stdin)));

$i = 0;
$max = 1;

foreach ($nums as $key => $num) {
    $i++;
    if ($key == 0) {
        continue;
    }
    if ($nums[$key - 1] <= $num) {
        continue;
    }
    if ($i > $max) {
        $max = $i;
    }
    echo $key . PHP_EOL;
    $i = 0;
}
if ($i > $max) {
    $max = $i;
}

echo $max;

<?php

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

fscanf($stdin, "%d\n", $n);

$nums = explode(" ", trim(fgets($stdin)));

$i = 0;
$max = 1;

foreach ($nums as $key => $num) {
    $i++;
    if ($key == 0) {
        continue;
    }
    if ($nums[$key - 1] <= $num) {
        continue;
    }
    if ($i > $max) {
        $max = $i;
    }
    $i = 1;
}
if ($i > $max) {
    $max = $i;
}

echo $max;

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$arr=array();
$j=0;

while ($i < $n-1) {
	if ($a[$i]>=$a[$i+1]) {
		$j++;
	}else{
		$j++;
		array_push($arr, $j);
		$j=0;
	}
	$i++;
}

rsort($arr);
echo $arr[0];

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=1;
$ada=false;
while ($i <= count($a)) {
	if ($ada) {
		if ($a[$i]==$a[$i-1]) {
			$ada=true;
		}else{
			break;
		}
	}else{
		if ($a[$i]==$a[$i-1]) {
			$ada=true;
		}
	}
	$i++;
}

if ($ada) {
	echo $i;
}else{
	echo 0;
}

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$ada=false;
while ($i < count($a)) {
	if ($ada) {
		if ($a[$i] == $a[$i+1]) {
			$ada=true;
		}else{
			break;
		}
	}else{
		if ($a[$i] == $a[$i+1]) {
			$ada=true;
		}
	}
	$i++;
}

if ($ada) {
	echo $i+1;
}else{
	echo 0;
}

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$temp1=1;
$temp2=1;

while ($i < $n-1) {
	if ($n[$i] <= $n[$i+1]) {
		$temp1++;
	}else{
		if ($temp2 < $temp1) {
			$temp2=$temp1;
		}else{
			$temp1=1;
		}
	}
	$i++;
}

if ($temp1 < $temp2) {
	echo $temp2;
}else{
	echo $temp1;
}

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$temp1=1;
$temp2=1;

while ($i < $n-1) {
	if ($n[$i] <= $n[$i+1]) {
		$temp1++;
	}else{
		if ($temp2 < $temp1)
			$temp2=$temp1;
		$temp1=1;
	}
	$i++;
}

if ($temp1 < $temp2) {
	echo $temp2;
}else{
	echo $temp1;
}

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$temp1=1;
$temp2=1;

while ($i < $n-1) {
	if ($n[$i] <= $n[$i+1]) {
		$temp1++;
	}else{
		if ($temp2 < $temp1) {
			$temp2=$temp1;
		}
		$temp1=1;
	}
	$i++;
}

if ($temp1 < $temp2) {
	echo $temp2;
}else{
	echo $temp1;
}

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$temp1=1;
$temp2=1;

for ($i=0; $i < $n-1 ; $i++) {
	if ($n[$i] <= $n[$i+1]) {
		$temp1++;
	}else{
		if ($temp2 < $temp1)
			$temp2=$temp1;
		$temp1=1;
	}
}

if ($temp1 < $temp2) {
	echo $temp2;
}else{
	echo $temp1;
}

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$arr=array();
$j=0;

while ($i < $n) {
	if ($a[$i]>=$a[$i+1]) {
		$j++;
	}else{
		$j++;
		array_push($arr, $j);
		$j=0;
	}
	$i++;
}

rsort($arr);
echo $arr[0];

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$arr=array();
$j=1;

while ($i < $n) {
	if ($a[$i]>=$a[$i+1]) {
		$j++;
	}else{
		array_push($arr, $j);
		$j=1;
	}
	$i++;
}

rsort($arr);
echo $arr[0];

?>

<?php
$n=trim(fgets(STDIN));
$a=explode(" ", trim(fgets(STDIN)));
$i=0;
$arr=array();
$j=0;

while ($i < $n-1) {
	if ($a[$i]>=$a[$i+1]) {
		$j++;
	}else{
		$j++;
		array_push($arr, $j);
	}
	$i++;
}

rsort($arr);
echo $arr[0];

?>

<?php

$number = fgets(STDIN);
$line = fgets(STDIN);

$line = trim($line);
$line = explode(' ', $line);	  	// cоздаем массив из строки
$result = [];

for ($i=0; $i < $number; $i++) {
	if ($line[$i+1] >= $line[$i]) {
		$oneString = 1;
		while ($line[$i+1] >= $line[$i]) {
			$oneString++;
			$i++;
		}
		$result[] = $oneString;
	} elseif ((count($line) == 1) ||(count($line) == 0)) {
		print_r(1);
	}
}

echo max($result);

<?php

$number = fgets(STDIN);
$line = fgets(STDIN);

$line = trim($line);
$line = explode(' ', $line);	  	// cоздаем массив из строки
$result = [];

for ($i=0; $i < $number; $i++) {
	if ($line[$i+1] >= $line[$i]) {
		$oneString = 1;
		while ($line[$i+1] >= $line[$i]) {
			$oneString++;
			$i++;
		}
		$result[] = $oneString;
	} elseif (count($line) == 1) {
		print_r(1);
	}
}

echo max($result);

<?php

$number = fgets(STDIN);
$line = fgets(STDIN);

$line = trim($line);
$line = explode(' ', $line);	  	// cоздаем массив из строки
$result = [];

for ($i=0; $i < $number; $i++) {
	if ($line[$i+1] >= $line[$i]) {
		$oneString = 1;
		while ($line[$i+1] >= $line[$i]) {
			$oneString++;
			$i++;
		}
		$result[] = $oneString;
	}
}

if((max($line) == 1) || (max($line) == 0)) {
	print_r(1);
}

echo max($result);

<?php
$number = fgets(STDIN);
$line = fgets(STDIN);

$line = trim($line);
$line = explode(' ', $line);	  	// cоздаем массив из строки
$result = [];

for ($i=0; $i < $number; $i++) {
	if ($line[$i+1] >= $line[$i]) {
		$oneString = 1;
		while ($line[$i+1] >= $line[$i]) {
			$oneString++;
			$i++;
		}
		$result[] = $oneString;
	}
}

echo max($result);

<?php
$number = fgets(STDIN);
$line = fgets(STDIN);

$line = trim($line);
$line = explode(' ', $line);	  	// cоздаем массив из строки
$result = [];

for ($i=0; $i < $number; $i++) {
	if ($line[$i+1] >= $line[$i]) {
		$oneString = 1;
		while ($line[$i+1] >= $line[$i]) {
			$oneString++;
			$i++;
		}
		$result[] = $oneString;
	}
}

if((count($line) == 1) || (count($line) == 0)) {
	print_r(1);
}

echo max($result);

<?php

error_reporting(0);
$n = (int) fgets(STDIN);
$arr = array_map('intval', preg_split('/ /', fgets(STDIN)));
$counter = 1;
for($i=0; $i < count($arr); $i++) {
	if($arr[$i] <= $arr[$i+1]) {
		$counter += 1;
		$temp = $counter;
	} else {
		$till_now = $temp;
		$counter = 1;
	}
}

if($till_now > $temp) {
	echo $till_now;
} else {
	echo $temp;
}

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array(1);

$max = 0;

for ($i = 0; $i < $num - 1; $i++) {
    if ($array[$i] <= $array[$i+1]) {
        $counter++;
    } else  {
        $counter = 1;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array();

for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] <= $array[$i+1]) {
        $counter++;
        array_push($new_arr , $counter);
    } else {
        echo true;
        $counter = 0;
    }

}

echo max($new_arr);

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array();

for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] <= $array[$i+1]) {
        $counter++;
        array_push($new_arr , $counter);
    } else {

        $counter = 1;
    }

}

echo max($new_arr);

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array();
if($num == 1) echo '';
else {
for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] <= $array[$i+1]) {
        $counter++;
        array_push($new_arr , $counter);
    } else {

        $counter = 1;
    }

}
}
echo max($new_arr);

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array(1);

for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] <= $array[$i+1]) {
        $counter++;

    } else {

        $counter = 1;
    }

}
array_push($new_arr , $counter);

echo max($new_arr);

<?php

$num = (int)readline();

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

$counter = 1;

$max = 1;

for ($i = 1; $i < $num; $i++) {
    if($i >= $num) break;

    if ($array[$i - 1] <= $array[$i]) {
        $counter++;
    } elseif ($i + $max < $num && $array[$i + $max - 1] <= $array[$i + $max]) {
        $i += $max;
        $counter = 1;
        $j = $i - 1;
        $k = $i + 1;

        while (($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) || ($k < $num && $array[$k - 1] <= $array[$k])) {
            if ($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) {
                $counter++;
                $j--;
            }

            if ($k < $num && $array[$k - 1] <= $array[$k]) {
                $counter++;
                $k++;
            }
        }

        $i = $k;

        // $counter = 0;
        // $i = $i + $max;
        // $j = $i;
        // while($j > $max) {
        //     if($j >= $num) break;

        //     if($array[$j] >= $array[$j-1]) {
        //         $counter++;

        //     } else break;

        //     $j--;

        // }

        /* for($j = $i;$j > $max ;$j--) {
            if($array[$j] >= $array[$j-1]) {
                $counter++;

            } else break;

        }*/

    } else {
        $i += $max;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array(1);

$max = -9999;

for ($i = 0; $i < $num - 1; $i++) {
    if ($array[$i] <= $array[$i+1]) {
        $counter++;
    } else  {
        $counter = 1;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

$num = (int)readline();

$array = explode(' ', trim(fgets(STDIN)));

$counter = 1;

$max = 1;

for ($i = 1; $i < $num; $i++) {
    if($i >= $num) break;

    if ($array[$i - 1] <= $array[$i]) {
        $counter++;
    } elseif ($i + $max < $num && $array[$i + $max - 1] <= $array[$i + $max]) {

        // echo "i => $i; max => $max; counter => $counter\n";
        $i += $max;
        $counter = 1;
        $j = $i - 1;
        $k = $i + 1;

        while (($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) || ($k < $num && $array[$k - 1] <= $array[$k])) {
            // echo "j => $j; k => $k;";

            if ($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) {
                $counter++;
                $j--;
            }

            if ($k < $num && $array[$k - 1] <= $array[$k]) {
                $counter++;
                $k++;
            }

            // echo " count => $counter\n";
        }

        $i = $k + 1;

        if ($max < $counter) {
            $max = $counter;
        }

        $counter = 0;
        // $counter = 0;
        // $i = $i + $max;
        // $j = $i;
        // while($j > $max) {
        //     if($j >= $num) break;

        //     if($array[$j] >= $array[$j-1]) {
        //         $counter++;

        //     } else break;

        //     $j--;

        // }

        /* for($j = $i;$j > $max ;$j--) {
            if($array[$j] >= $array[$j-1]) {
                $counter++;

            } else break;

        }*/

    } else {
        $counter = 0;
        $i += $max;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array();

for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] >= $array[$i+1]) {
        $counter++;
    } else {
        array_push($new_arr , $counter);
        $counter = 0;
    }

}

echo max($new_arr);

<?php

$num = (int)readline();

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

$counter = 1;

$max = 1;

for ($i = 1; $i < $num; $i++) {
    if($i >= $num) break;

    if ($array[$i - 1] <= $array[$i]) {
        $counter++;
    } elseif ($i + $max < $num && $array[$i + $max - 1] < $array[$i + $max]) {
        $i += $max;
        $counter = 1;
        $j = $i - 1;
        $k = $i + 1;

        while (($j > $i - $max - 2 && $array[$j] < $array[$j + 1]) || ($k < $num && $array[$k - 1] < $array[$k])) {
            if ($j > $i - $max - 2 && $array[$j] < $array[$j + 1]) {
                $counter++;
                $j--;
            }

            if ($k < $num && $array[$k - 1] < $array[$k]) {
                $counter++;
                $k++;
            }
        }

        $i = $k;

        // $counter = 0;
        // $i = $i + $max;
        // $j = $i;
        // while($j > $max) {
        //     if($j >= $num) break;

        //     if($array[$j] >= $array[$j-1]) {
        //         $counter++;

        //     } else break;

        //     $j--;

        // }

        /* for($j = $i;$j > $max ;$j--) {
            if($array[$j] >= $array[$j-1]) {
                $counter++;

            } else break;

        }*/

    } else {
        $i += $max;
    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

$num = (int)readline();

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

$counter = 1;

$max = 0;

for ($i = 0; $i < $num - 1; $i++) {
    if($i >= $num) break;

    if ($array[$i] <= $array[$i+1]) {
        $counter++;
    } else {
        $i = $i + $max;
        $j = $i;
        while($j > $max) {
            if($j >= $num) break;
            if($array[$j] >= $array[$j-1]) {
                $counter++;

            } else break;

            $j--;

        }

    }

    if ($max < $counter) {
        $max = $counter;
    }

}

echo $max;

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array(1);

for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] <= $array[$i+1]) {
        $counter++;

    } else {
        array_push($new_arr , $counter);
        $counter = 1;
    }

}

echo max($new_arr);

<?php

$num = (int)readline();

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

$counter = 1;

$new_arr = array();

for($i = 0;$i < $num - 1;$i++) {
    if($array[$i] <= $array[$i+1]) {
        $counter++;
        array_push($new_arr , $counter);
    } else {

        $counter = 0;
    }

}

echo max($new_arr);


<?php

function dd(...$args)
{
    var_dump(...$args);
    die;
}

define('TXTIN', fopen('input.txt', 'r'));
define('TXTOUT', fopen('output.txt', 'w'));

//$input = TXTIN;
$input = STDIN;
//$output = TXTOUT;
$output = STDOUT;

function foo($notebooks, $n)
{
    $answer = 1;
    $min = 1001;

    for ($i = 0; $i < $n; $i++) {
        for ($j = $n - 1; $j >= 0; $j--) {
            if (
                $notebooks[$i]['speed'] < $notebooks[$j]['speed'] &&
                $notebooks[$i]['ram'] < $notebooks[$j]['ram'] &&
                $notebooks[$i]['hdd'] < $notebooks[$j]['hdd']
            ) {
                $notebooks[$i]['cost'] = 1001;
            }
        }

        if ($notebooks[$i]['cost'] < $min) {
            $min = $notebooks[$i]['cost'];
            $answer = $i;
        }
    }

    return $answer;
}

$r = 0;
$notebooks = [];

list($n) = fscanf($input, "%d\n");

for ($i = 0; $i < $n; $i++) {
    list(
        $notebooks[$i]['speed'],
        $notebooks[$i]['ram'],
        $notebooks[$i]['hdd'],
        $notebooks[$i]['cost']
    ) = fscanf($input, "%d %d %d %d\n");
}

$r = foo($notebooks, $n);

fwrite($output, $r + 1);

<?php
$a = trim(fgets(STDIN));
$b = array();
$c = array();
$d = array();
$e = array();
for($x = 1; $x <= $a; $x++)
{
    list($f, $g, $h, $i) = explode(" ", trim(fgets(STDIN)));
    array_push($b, $f); // скорость процессора
    array_push($c, $g); // объем памяти
    array_push($d, $h); // размер диска
    array_push($e, $i); // цена
}
asort($e);
$j = array_keys($e);
$k = 0;
for($x = 0; $x < $a; $x++)
{
    $k = 0;
    for($y = 0; $y < $a; $y++)
    {
        if(($b[$j[$x]] < $b[$y]) && ($c[$j[$x]] < $c[$y]) && ($d[$j[$x]] < $d[$y]))
        {
            $k = 1;
            continue;
        }
    }
    if($k == 0)
    {
        break;
    }
}
print $j[$x] + 1;
?>

<?php
$a = trim(fgets(STDIN));
$b = array();
$c = array();
$d = array();
$e = array();
for($x = 1; $x <= $a; $x++)
{
    list($f, $g, $h, $i) = explode(" ", trim(fgets(STDIN)));
    array_push($b, $f); // скорость процессора
    array_push($c, $g); // объем памяти
    array_push($d, $h); // размер диска
    array_push($e, $i); // цена
}
asort($e);
$j = array_keys($e);
$k = 0;
for($x = 0; $x < $a; $x++)
{
    for($y = 0; $y < $a; $y++)
    {
        if(($b[$j[$x]] < $b[$y]) && ($c[$j[$x]] < $c[$y]) && ($d[$j[$x]] < $d[$y]))
        {
            continue;
        }
        else
        {
            $k = 1;
            break;
        }
    }
    if($k == 1)
    {
        break;
    }
}
print $j[$x];
?>


<?php
// define('DEBUG', true);
define('DEBUG', false);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%d %d %d %d %d", $n, $h, $a, $b, $k);
for ($i = 0; $i < $k; $i++) {
	fscanf(STDIN, "%d %d %d %d", $ta, $fa, $tb, $fb);
	if ($ta == $tb) {
		$answer = abs($fa - $fb);
	} else {
		$flag_a = false;
		$flag_b = false;
		$cost_a = $cost_b = 0;

		if ($fa <= $a && $b <= $fa) {

		} else {
			if ($fa < $a) {
				$cost_a = $a - $fa;
			} elseif ($fa > $b) {
				$cost_a = $b - $fa;
			}
		}
		if ($fb <= $a && $b <= $fb) {

		} else {
			if ($fb < $a) {
				$cost_b = $a - $fb;
			} elseif ($fb > $b) {
				$cost_b = $b - $fb;
			}
		}

		if (DEBUG) {
			echo $cost_a, "!", $cost_b, PHP_EOL;
		}

		if ($cost_a * $cost_b <= 0) {
			// $cost_a = $cost_b = 0;
			$cost_a = abs($fb - $fa);
			$cost_b = 0;
		}
		if (DEBUG) {
			echo $cost_a, "*", $cost_b, PHP_EOL;
		}

		$answer = abs($cost_a) + abs($cost_b) + abs($ta - $tb);
	}
	echo $answer . PHP_EOL;
}

<?php
// define('DEBUG', true);
define('DEBUG', false);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%d %d %d %d %d", $n, $h, $a, $b, $k);
for ($i = 0; $i < $k; $i++) {
	fscanf(STDIN, "%d %d %d %d", $ta, $fa, $tb, $fb);
	$a_cost = 0;
	$b_cost = 0;
	$f_cost = 0;
	$t_cost = 0;
	if ($ta != $tb) {
		if ($fa > $b) {
			$a_cost = $fa - $b;
		} elseif ($fa < $a) {
			$a_cost = $fa - $a;
		} else {
			$a_cost = 0;
		}
		if ($fb > $b) {
			$b_cost = $fb - $b;
		} elseif ($fb < $a) {
			$b_cost = $fb - $a;
		} else {
			$b_cost = 0;
		}
		if (DEBUG) {
			echo $a_cost, "*", $b_cost . PHP_EOL;
		}

		if ($a_cost * $b_cost < 0) {
			$a_cost = $b_cost = 0;
		} else {
			$a_cost = abs($a_cost);
			$b_cost = abs($b_cost);
		}
		$f_cost = abs($fa - $fb);
		$t_cost = abs($ta - $tb);
	} else {
		$f_cost = abs($fa - $fb);
	}
	if (DEBUG) {
		echo "{$a_cost} {$b_cost}\n";
	}

	$cost = $a_cost + $b_cost + $f_cost + $t_cost;

	echo $cost . PHP_EOL;
}

<?php
// define('DEBUG', true);
define('DEBUG', false);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%d %d %d %d %d", $n, $h, $a, $b, $k);
for ($i = 0; $i < $k; $i++) {
	fscanf(STDIN, "%d %d %d %d", $ta, $fa, $tb, $fb);
	$a_cost = 0;
	$b_cost = 0;
	$f_cost = 0;
	$t_cost = 0;
	if ($ta != $tb) {
		if ($fa > $b) {
			$a_cost = $fa - $b;
		} elseif ($fa < $a) {
			$a_cost = $fa - $a;
		} else {
			$a_cost = 0;
		}
		if ($fb > $b) {
			$b_cost = $fb - $b;
		} elseif ($fb < $a) {
			$b_cost = $fb - $a;
		} else {
			$b_cost = 0;
		}
		if (DEBUG) {
			echo $a_cost, "*", $b_cost . PHP_EOL;
		}

		if ($a_cost * $b_cost <= 0) {
			$a_cost = $b_cost = 0;
		} else {
			$a_cost = abs($a_cost);
			$b_cost = abs($b_cost);
		}
		$f_cost = abs($fa - $fb);
		$t_cost = abs($ta - $tb);
	} else {
		$f_cost = abs($fa - $fb);
	}
	if (DEBUG) {
		echo "{$a_cost} {$b_cost}\n";
	}

	$cost = $a_cost + $b_cost + $f_cost + $t_cost;

	echo $cost . PHP_EOL;
}


<?php

$in = 'php://stdin';
//$in = 'input.txt';

$data = file($in);

array_shift($data);

$prices = explode(' ', array_shift($data));

while (!$data[count($data) - 1]) {
	array_pop($data);
}

$mprices = $prices;

sort($prices, SORT_NUMERIC);
rsort($mprices, SORT_NUMERIC);

$fruits = array_count_values($data);
rsort($fruits, SORT_NUMERIC);

$a = $b = 0;
foreach ($fruits as $num) {
	$a += $num * array_shift($prices);
	$b += $num * array_shift($mprices);
}

echo "$a $b";

<?php
$nFruits = explode(' ', trim(fgets(STDIN)));
$nFruits = $nFruits[1];
$prices = explode(' ', trim(fgets(STDIN)));
$pricesDESC = $prices;

sort($prices, SORT_NUMERIC);
rsort($pricesDESC, SORT_NUMERIC);

for ($i=0;$i<$nFruits;$i++) {
    $fruits[] = trim(fgets(STDIN));
}

$fruits = array_count_values($fruits);
rsort($fruits, SORT_NUMERIC);

$a = $b = 0;
foreach ($fruits as $num) {
    $a += $num * array_shift($prices);
    $b += $num * array_shift($pricesDESC);
}

echo "$a $b";
?>

<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
sort($c);
$d = array();
$g = 0;
$h = array();
$i = array();
$l = array();
for($x = 1; $x <= $b; $x++)
{
    $e = trim(fgets(STDIN));
    array_push($d, $e);
}
$f = array_unique($d);
sort($f);
for($x = 0; $x < count($f); $x++)
{
    for($y = 0; $y < count($d); $y++)
    {
        if($f[$x] == $d[$y])
        {
            $g++;
        }
    }
    array_push($h, $g);
    $g = 0;
}
rsort($h);
for($x = 0; $x < count($h); $x++)
{
    $j = $h[$x] * $c[$x];
    array_push($i, $j);
}
$j = array_sum($i);
rsort($c);
for($x = 0; $x < count($h); $x++)
{
    $k = $h[$x] * $c[$x];
    array_push($l, $k);
}
$k = array_sum($l);
print $j . " " . $k;
?>

<?php

$in = 'php://stdin';
//$in = 'input.txt';

$data = file($in);

array_shift($data);

$prices = explode(' ', array_shift($data));

if (!$data[count($data) - 1]) {
	array_pop($data);
}

$mprices = $prices;

sort($prices);
rsort($mprices);

$fruits = array_count_values($data);
rsort($fruits);

$a = $b = 0;
foreach ($fruits as $num) {
	$a += $num * array_shift($prices);
	$b += $num * array_shift($mprices);
}

echo "$a $b";

<?php

$in = 'php://stdin';
//$in = 'input.txt';

$data = file($in);

array_shift($data);

$prices = explode(' ', array_shift($data));

while (!$data[count($data) - 1]) {
	array_pop($data);
}

$mprices = $prices;

sort($prices);
rsort($mprices);

$fruits = array_count_values($data);
rsort($fruits);

$a = $b = 0;
foreach ($fruits as $num) {
	$a += $num * array_shift($prices);
	$b += $num * array_shift($mprices);
}

echo "$a $b";

<?php
$nFruits = explode(' ', trim(fgets(STDIN)));
$nFruits = $nFruits[1];
$prices = explode(' ', trim(fgets(STDIN)));
$pricesDESC = $prices;

sort($prices, SORT_NUMERIC);
rsort($pricesDESC, SORT_NUMERIC);

for ($i=0;$i<$nFruits;$i++) {
    $fruits[] = trim(fgets(STDIN));
}

$fruits = array_count_values($fruits);
rsort($fruits, SORT_NUMERIC);

print_r($fruits);

$a = $b = 0;
foreach ($fruits as $num) {
    $a += $num * array_shift($prices);
    $b += $num * array_shift($pricesDESC);
}

echo "$a $b";
?>

<?php
trim(fgets(STDIN));
$prices = explode(' ', trim(fgets(STDIN)));
$pricesDESC = $prices;

sort($prices, SORT_NUMERIC);
rsort($pricesDESC, SORT_NUMERIC);

while ($fruits[] = trim(fgets(STDIN)))

$fruits = array_count_values($fruits);
rsort($fruits, SORT_NUMERIC);

$a = $b = 0;
foreach ($fruits as $num) {
    $a += $num * array_shift($prices);
    $b += $num * array_shift($pricesDESC);
}

echo "$a $b";
?>

<?php
trim(fgets(STDIN));
$prices = explode(' ', trim(fgets(STDIN)));
$pricesDESC = $prices;

sort($prices, SORT_NUMERIC);
rsort($pricesDESC, SORT_NUMERIC);

while ($fruits[] = trim(fgets(STDIN)))

$fruits = array_count_values($fruits);
rsort($fruits, SORT_NUMERIC);

print_r($fruits);

$a = $b = 0;
foreach ($fruits as $num) {
    $a += $num * array_shift($prices);
    $b += $num * array_shift($pricesDESC);
}

echo "$a $b";
?>


<?php
    define("MAXN", 1024) ;
    define("GAP_VAL", 1e-7) ;

    function gap($n)
    {
        return $n < GAP_VAL ;
    }

    $t = intval(trim(fgets(STDIN))) ;
    while($t --)
    {
        $n = intval(trim(fgets(STDIN))) ;

        echo intval($n / 2) . "\n" ;
    }
?>

<?php declare(strict_types = 1);
    $stdin = fopen('php://stdin', 'r');
    $test = fgets($stdin);
    for ($itest = 0; $itest < $test; $itest++) {
        $n = (int)fgets($stdin);
        $res = (int)($n / 2);
        echo $res."\n";
    }
?>

<?php declare(strict_types = 1);
    $stdin = fopen('php://stdin', 'r');
    $test = fgets($stdin);
    for ($itest = 0; $itest < $test; $itest++) {
        $n = (int)fgets($stdin);
        $res = (int)($n / 2);
        echo "$res<br>";
    }
?>


<?php

$num = trim(fgets(STDIN));
$aList = explode(' ', trim(fgets(STDIN)));

$count = 0;
$minCount = PHP_INT_MAX;
$minValue = PHP_INT_MAX;
foreach ($aList as $value)
{
    $value = (int)$value;
    if ($minValue > $value)
    {
        $minValue = $value;
        $minCount = PHP_INT_MAX;
        $count = 0;
    }
    else if ($minValue === $value)
    {
        $count++;
        $minCount = min($count, $minCount);
        $count = 0;
    }
    else
    {
        $count++;
    }

}

echo $minCount;


<?php
#1173B
$n = (int)trim(fgets(STDIN));
$size = 2;
while ((2 * $size - 1) < $n) {
    $size++;
}
echo $size . PHP_EOL;
for ($i = 1; $i <= $size; $i++) {
    echo '1 ' . $i . PHP_EOL;
}
for ($i = 2, $j = $size + 1; $j <= $n; $i++, $j++) {
    echo $i . ' ' . $size . PHP_EOL;
}


<?// BismiLahi Rahmani Rahim ?>

<?php

fscanf(STDIN, "%d %d", $n, $k);
$a = explode(" ", trim(fgets(STDIN)));

sort($a);

if ($k > $n) {
	printf("-1");
} else {
	printf("%d 0", $a[$n-$k]);
}

?>

<?php
fscanf(STDIN,"%d%d",$n,$k);
$a=explode(" ", trim(fgets(STDIN)));
foreach($a as $i=>$b) $c[$i]=(int)$b;
sort($c, SORT_NUMERIC);
echo ($k>$n)?-1:$c[$n-$k]." 0";
?>

<?php
$params = explode(' ', trim(fgets(STDIN)));
$n = $params[0];
$k = $params[1];
unset($params);

$squares = explode(' ', trim(fgets(STDIN)));
foreach ($squares as $i => $square){
	$squares[$i] = (int)$square;
}
sort($squares, SORT_NUMERIC);

if ($k <= $n){
	fputs(STDOUT, $squares[$n - $k].' 0');
}else{
	fputs(STDOUT, '-1');
}

<?php
list($n, $k)=explode(' ', trim(fgets(STDIN)));
$a=explode(' ', trim(fgets(STDIN)));
foreach($a as $i=>$b) $c[$i]=(int)$b;
sort($c, SORT_NUMERIC);
if($k<=$n) echo $c[$n-$k].' 0';
else echo -1;
?>

<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
rsort($c);
if($b > count($c))
{
    print "-1";
}
else
{
    if($c[$b] != $c[$b + 1])
    {
        print $c[$b - 1] . " " . $c[$b - 1];
    }
    else
    {
        print "-1";
    }
}
?>

<?php
list($n, $k)=explode(' ', trim(fgets(STDIN)));
$a=explode(' ', trim(fgets(STDIN)));
array_multisort($a, SORT_NUMERIC, SORT_ASC);
for($i=0; $i<count($a); $i++) {
if(($i+1==$k) && ($a[$i+1]!=$a[$i])) {
  echo "{$a[$i]} 0"; exit(); }
}
echo -1;
?>


<?php
$a = trim(fgets(STDIN));
$c = 0;
$d = 0;
$e = array();
$f = array();
for($x = 1; $x <= $a; $x++)
{
    $b = trim(fgets(STDIN));
    if($b > 0)
    {
        $c += $b;
        array_push($e, $b);
    }
    elseif($b < 0)
    {
        $d += abs($b);
        array_push($f, abs($b));
    }
}
if($c > $d)
{
    print "first";
}
elseif($c < $d)
{
    print "second";
}
elseif($c == $d)
{
    $h = max(count($e), count($f));
    $g = 0;
    for($x = 0; $x < $h; $x++)
    {
        if($e[$x] != $f[$x])
        {
            $g = 1;
            if($e[$x] > $f[$x])
            {
                print "first";
                break;
            }
            elseif($e[$x] < $f[$x])
            {
                print "second";
                break;
            }
        }
    }
    if($g == 0)
    {
        if($b > 0)
        {
            print "first";
        }
        else
        {
            print "second";
        }
    }
}
?>

<?php
$a = trim(fgets(STDIN));
$c = 0;
$d = 0;
$e = array();
$f = array();

for ($i=1; $i<=$a; $i++) {
    $b = trim(fgets(STDIN));
    if ($b > 0) {
        $c += $b;
        array_push($e, $b);
    } else if($b < 0) {
        $d += abs($b);
        array_push($f, abs($b));
    }
}
if ($c > $d) {
    echo "first";
} else if ($c < $d) {
    echo "second";
} else if ($c == $d) {
    $h = max(count($e), count($f));
    $g = 0;
    for ($i=0; $i<$h; $i++) {
        if ($e[$i] != $f[$i]) {
            $g = 1;
            if ($e[$i] > $f[$i]) {
                echo "first";
                break;
            } else if ($e[$i] < $f[$i]) {
                echo "second";
                break;
            }
        }
    }
    if ($g == 0) {
        if ($b > 0) {
            echo "first";
        } else {
            echo "second";
        }
    }
}
?>

<?php
$a = trim(fgets(STDIN));
$c = 0;
$d = 0;
$e = array();
$f = array();
for($x = 1; $x <= $a; $x++)
{
    $b = trim(fgets(STDIN));
    if($b > 0)
    {
        $c += $b;
        array_push($e, $b);
    }
    elseif($b < 0)
    {
        $d += abs($b);
        array_push($f, abs($b));
    }
}
if($c > $d)
{
    print "first";
}
elseif($c < $d)
{
    print "second";
}
elseif($c == $d)
{
    $e = max(count($e), count($f));
    $g = 0;
    for($x = 0; $x < $e; $x++)
    {
        if($e[$x] != $f[$x])
        {
            $g = 1;
            if($e[$x] > $f[$x])
            {
                print "first";
                break;
            }
            elseif($e[$x] < $f[$x])
            {
                print "second";
                break;
            }
        }
    }
    if($g == 0)
    {
        if($b > 0)
        {
            print "first";
        }
        else
        {
            print "second";
        }
    }
}
?>

<?php
$a = trim(fgets(STDIN));
$c = 0;
$d = 0;
$e = array();
$f = array();
for($x = 1; $x <= $a; $x++)
{
    $b = trim(fgets(STDIN));
    if($b > 0)
    {
        $c += $b;
        array_push($e, $b);
    }
    elseif($b < 0)
    {
        $d += abs($b);
        array_push($f, abs($b));
    }
}
if($c > $d)
{
    print "first";
}
elseif($c < $d)
{
    print "second";
}
elseif($c == $d)
{
    $e = max(count($e), count($f));
    $f = 0;
    for($x = 0; $x < $e; $x++)
    {
        if($e[$x] != $f[$x])
        {
            $f = 1;
            if($e[$x] > $f[$x])
            {
                print "first";
                break;
            }
            elseif($e[$x] < $f[$x])
            {
                print "second";
                break;
            }
        }
    }
    if($f == 0)
    {
        if($b > 0)
        {
            print "first";
        }
        else
        {
            print "second";
        }
    }
}
?>


<?php

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

$words = [];
while ($n--) {
    $words[] = (string) trim(fgets(STDIN));
}

foreach ($words as $word) {
    if (strlen($word) > 10) {
        echo $word[0] . strlen(substr($word, 1, -1)) . $word[strlen($word) - 1]. "\n";
    } else {
        echo $word . "\n";
    }
}

<?php

function read_words() {

	fscanf(STDIN, "%d", $n);
	$words = array();

	while ($n--) {
		fscanf(STDIN, "%s", $w);
		$words[] = $w;
	}

	return $words;
}

function abbreviate_words($words) {
	return array_map(function ($w) {
		$l = strlen($w);
		if ($l > 10) {
			return $w[0] . ($l - 2) . $w[$l - 1];
		} else {
			return $w;
		}
	}, $words);
}

function print_words($words, $split) {
	print_r(implode($split, $words));
}

$words = read_words();
$abbr_words = abbreviate_words($words);
print_r(implode("\n", $abbr_words));
// print_words($abbr_words, "\n");

<?php
    $input = file_get_contents('php://stdin');
    $arr = explode("\r\n", $input);
    for ($i = 0; $i < count($arr); $i++) {
        if ($i == 0) continue;
        echo ((strlen($arr[$i]) > 10)? substr($arr[$i], 0, 1) . (strlen($arr[$i])-2) . substr($arr[$i], -1) : $arr[$i]) . (($i != count($arr) - 1)? "\r\n" : "");
    }
?>

<?php
$lines = (int)fgets(STDIN);
if($lines >= 1 && $lines <= 100)
{
    $words = [];
    for($i = 0;$i < $lines; $i++)
        $words[$i] = fgets(STDIN);
    foreach($words as $word)
    {
        if(strlen($word) > 12)
            echo $word[0]."".(strlen($word) - 4) ."".$word[-3]."\n";
        else
            echo $word;

    }
}
else
{
    echo "Not valid input\n";
}

?>

<?php

function read_words() {

	fscanf(STDIN, "%d", $n);
	$words = array();

	while ($n--) {
		fscanf(STDIN, "%s", $w);
		$words[] = $w;
	}

	return $words;
}

function abbreviate_words($words) {
	return array_map(function ($w) {
		$l = strlen($w);
		if ($l > 10) {
			return $w[0] . ($l - 2) . $w[$l - 1];
		} else {
			return $w;
		}
	}, $words);
}

function print_words($words, $split) {

	foreach ($words as $w) {
		echo $w . "\n";
	}
	echo "\n";
}

$words = read_words();
$abbr_words = abbreviate_words($words);

print_words($abbr_words, "\n");

<?php
$number = readline("Enter a number: ");
$words = array();
if ($number>=1 && $number <=100){
    while ($number--!=0){
        $word = readline("Enter a word: ");
        if (strlen($word)>=1 && strlen($word)<=100){
            $words[] = $word;
        }
    }
}
foreach ($words as $w) {
    $length = strlen($w);
    if ($length<=10){
        echo $w."\n";
    } else {
        echo $w[0].($length-2).$w[$length-1]."\n";
    }
}
?>

<?php

function read_words() {

	fscanf(STDIN, "%d", $n);
	$words = array();

	while ($n--) {
		fscanf(STDIN, "%s", $w);
		$words[] = $w;
	}

	return $words;
}

function abbreviate_words($words) {
	return array_map(
		function ($w) {
			$l = strlen($w);
			return $l > 10 ? $w[0] . ($l - 2) . $w[$l - 1] : $w;
		},
		$words
	);
}

$words = read_words();
$abbr_words = abbreviate_words($words);

print_r(implode("\n", $abbr_words));

<?php fscanf ( STDIN, '%d', $num1 ); while ( fscanf ( STDIN, '%s', $var1) ) { $num = strlen ( $var1 ); if ($num > 10) { 	$var1 = $var1[0] . ($num-2) . $var1[$num-1]; } echo $var1 . "\n";} ?>

<?php
$f = fopen("php://stdin", "r");
$g = trim(stream_get_contents($f));
$in = explode("\n", $g);

for ($i = 0; $i < count($in); $i++) {
  if(!is_numeric(trim($in[$i]))){
    $item = trim($in[$i]);
    $l = strlen($item);
    if ($l > 10) {
      $x = str_split($item);
      echo $x[0] . ($l - 2) . $x[$l - 1];
    } else {
      echo $item;
    }
    echo "\n";
  }
}

<?php

//fscanf(STDIN, "%d\n", $number); // reads number from STDIN
$number = trim(fgets(STDIN)); // reads one line from STDIN
$i=0;

while($i<$number && $line= trim(fgets(STDIN))){

    $str = $line;
    $ln = strlen($str) ;

    if($ln>10){
        fwrite(STDOUT, $str[0].($ln-2).$str[$ln-1]."\n");
    }else{
        fwrite(STDOUT, $str."\n");
    }
}

<?php

$num = readline();

for($i = 0; $i < $num; $i++) {
    $str = readline();

    $len = strlen($str);

    if($len > 10) {
        echo $str[0] . ($len - 2) . $str[$len-1] .  "\n";
    } else {
        echo $str . "\n";
    }

}

<?php
while ($t=fgets(STDIN))
{
    $textmassiv[]=$t;
}
for ($i =0;$i<$textmassiv[0];$i++)
{
    if (strlen(trim($textmassiv[$i+1]))>10)
    {
        echo substr($textmassiv[$i+1],0,1);
        echo strlen(trim($textmassiv[$i+1]))-2;
        echo substr(trim($textmassiv[$i+1]),-1,1)."\n";
    }
    else
    {
        echo trim($textmassiv[$i+1])."\n";
    }
}
?>

<?php
$n = (int)fgets(STDIN);

$words = array();

for ($i = 1; $i <= $n; $i++) {
    $words[$i] = trim(fgets(STDIN));
}

for ($i = 1; $i <= $n; $i++) {
    $word = $words[$i];
    if (strlen($word) > 10) {
        echo substr($word, 0, 1) . (strlen($word) - 2) . substr($word, -1, 1);
    } else {
        echo $word;
    }
    echo "\n";
}

<?php

$stdin = fopen('php://stdin', 'r');
$line1 = fgets($stdin);
$arr=explode(' ',$line1);
$n=$arr[0];

$stdout=fopen('php://stdout','w');
for ($i=0;$i<$n;$i++)
{
    $line = trim(fgets($stdin));
    if (strlen($line)<=10) {$good=$line;} else {$good=$line[0].(strlen($line)-2).$line[strlen($line)-1];}

    $r[$i]=$good."\n";
}

for ($i=0;$i<$n;$i++)
{
    fwrite($stdout,$r[$i]);
}

fclose($stdin);

//fwrite($stdout,$n);
fclose($stdout);

?>

<?php
$input = array();
$tirms = trim(fgets(STDIN));
for($i=0; $i<$tirms; $i++)
	$input[$i] = trim(fgets(STDIN));

foreach ($input as $value)
{
	$num = strlen($value);
	if ($num <= 10)
		$out = $value;
	else
	{
		$n = $num-2;
		$out = substr($value, 0, 1).$n.substr($value, -1, 1);
	}

	echo $out;
	echo "\n";
}

?>

<?php

function go($word)
{
    $length = strlen($word);
    $result = substr($word,0,1);
    $result .= $length-2;
    $result .= substr($word,-1,1);
    return $result ;
}

$line_number = 0;
while($f = fgets(STDIN)){
    $line_number++;
    if($line_number == 1)
        $count = trim($f);
    else
    {
        $word=trim($f);
        if(strlen($word)>10) {
            $s=go($word);
            echo $s.PHP_EOL;
        }
        else
            echo $word.PHP_EOL;
    }
}

<?php
fscanf(STDIN, "%d", $length);
for($i = 0; $i < $length; $i ++) {
    fscanf(STDIN, "%s", $s);
    $strLength = strlen($s);
    if($strLength > 10) {
        echo $s[0] . ($strLength-2) . $s[$strLength-1] . "\n";
    } else {
        echo $s . "\n";
    }
}

<?php

$is_first = true;
while ($row = fgets(STDIN)) {
    if ($is_first === true) {
        $is_first = false;
        continue;
    }
    $length = strlen($row) - 2;
    if ($length > 10) {
        echo $row[0] . ($length - 2) . $row[$length - 1] . "\n";
    } else {
        echo $row . "\n";
    }
}

<?php
$_fp = fopen("php://stdin", "r");
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
fscanf($_fp,"%d",$num);

for ($i=0; $i < $num; $i++) {
    fscanf($_fp, "%s", $text[$i]);
}

for ($i=0; $i < $num; $i++) {
    if(strlen($text[$i]) > 10)
    {
        $textArray = str_split($text[$i]);

        $countString = strlen($text[$i]);

        $stringAkhir = $text[$i][$countString - 1];

        $splice = $countString - 2;

        array_splice($textArray, 1, $splice);

        for ($j=0; $j < 2; $j++) {
            array_splice($textArray, $j + 1, 0, strval($splice)[$j]);
        }
        echo implode($textArray) . "\n";
    } else {
        echo $text[$i] . "\n";
    }
}
?>

<?php //php 7.2.24
$l = fgets(STDIN);
while(fscanf(STDIN, "%s", $i)){
    if(strlen($i) > 10){ echo $i[0].(strlen($i)-2).$i[strlen($i)-1]."\n"; }
    else echo $i."\n";
}
?>

<?php

$stdout = fopen(getenv("OUTPUT_PATH"), "w");
$stdin = fopen("php://stdin", "r");

fscanf($stdin, "%d" , $n) ;

for($i=0 ; $i<$n ; $i++)
{
     fscanf( $stdin , "%s" , $s ) ;
     if( strlen( $s ) > 10 )
     {
          echo $s[0] . "" . ( strlen($s)-2 ) . "" . $s[ strlen($s)-1] . "\n" ;
     }
     else
     {
          echo $s . "\n" ;
     }
}

fwrite($stdout);

fclose($stdin);
fclose($stdout);

?>

<?php
// https://codeforces.com/problemset/problem/71/A
fscanf(STDIN, "%d", $n);
for($i = 0; $i < $n; $i++) {
	fscanf(STDIN, "%s", $s);
	$in = strlen($s);
	echo $in <= 10 ? $s . "\n" : $s[0] . ($in-2) . $s[$in-1] . "\n";
}

<?php
class LongWords {
    public function getResult($str) {
        $lowercase = $str;
        $strlen = strlen($lowercase);
        if($strlen > 10) {
            $eachstr = str_split($lowercase);
            $result = $strlen - 2;
            return $eachstr[0].$result.$eachstr[$strlen-1];
        } else{
            return $lowercase;
        }
    }
}
$obj = new LongWords();

function getinput() {
    return trim(fgets(STDIN));
}

$t = (int)getinput();
// print gettype($t);
while($t--) {
    print $obj->getResult(getinput())."\n";
}

<?php
class LongWords {
    public function getResult($str) {
        $str = str_replace(' ', '', $str);
        $lowercase = strtolower($str);
        $strlen = strlen($lowercase);
        //print $strlen;
        if($strlen >= 1 && $strlen <= 100) {
            if($strlen > 10) {
                $eachstr = str_split($lowercase);
                $strlen = $strlen - 1;
                $result = $strlen - 1;
                return $eachstr[0].$result.$eachstr[$strlen];
            } else{
                if(!is_numeric($lowercase)) {
                    return $lowercase;
                }
                return false;
            }
        }
        return false;
    }
}
$obj = new LongWords();

function getinput() {
    return trim(fgets(STDIN));
}

$t = (int)getinput();
// print gettype($t);
while($t--) {
    print $obj->getResult(getinput())."\n";
}

<?php

$input = trim(fgets(STDIN));
$numberOfInputs = (int)$input;

$resultArray = array();

for ($count = 0; $count < $numberOfInputs; $count++) {
    $string = trim(fgets(STDIN));
    $length = strlen($string);
    if ($length > 10) {
        $result = "{$string[0]}" . ($length-2) . "{$string[$length - 1]}";
        array_push($resultArray, $result);
    } else {
        array_push($resultArray, $string);
    }
}
foreach ($resultArray as $result) {
    printf("%s\n",$result) ;
}

<?php
    fscanf(STDIN,'%d',$no_word);
    for ($i=0; $i<$no_word; $i++) {
        fscanf(STDIN,'%s',$word);
        $length = strlen($word);
        if (strlen($word) <= 10) {
            echo $word . "\n";
        } else {
            echo substr($word,0,1) . ($length-2) . substr($word,$length-1,1) . "\n";
        }
    }
?>

<?php

$howMany = readline("How many words?:");
$howManyToInt = intval($howMany);
$wordsArr = [];
for($i = 1;$i < $howManyToInt+1; $i++){

	$word = readline("Enter word ".$i." :");
	array_push($wordsArr, $word);
}

foreach($wordsArr as $word){

	$split = str_split($word);
	if(sizeof($split) > 10){

		for($i = 0;$i < sizeof($split); $i++){

			$last = sizeof($split) -1;
			$comp = sizeof($split) -2;

			echo $split[0].$comp.$split[$last]."\n";
			break;
		}

	}else{
		echo $word."\n";
	}
}

<?php
	fscanf(STDIN, "%d", $n);
	while($n--)
	{
			fscanf(STDIN, "%s", $word);
			$len=strlen($word);
			if ($len <= 10)
			{
				echo $word . "\n";
			}
			else
			{
				echo $word[0] . ($len-2) . ($word[$len-1]) . "\n";
			}
	}
?>

<?php

$numOfLines = readline();
$inputs = array();

for($i = 0 ; $i < $numOfLines ; $i++){
    $input = readline();
    $inputs[] = $input ;
}

foreach($inputs as $result){
    $numOfChar = strlen($result) ;
    if($numOfChar > 10){
        $firstChar = $result[0];
        $lastChar = $result[$numOfChar - 1] ;
        echo "\n".$firstChar.($numOfChar-2).$lastChar ;
    }else{
        echo "\n".$result ;
    }

}

<?php
// 71A Слишком длинные слова

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

$input_line = fgets($in);

$n = (int) $input_line;
$out = '';

for ($i = 1; $i <= $n; $i++ ) {

    $input_line = fgets($in);
    $len = strlen($input_line);
    if ($len < 13) {
        $out .= $input_line;
    } else {
        $out .= $input_line[0] . (string)($len - 4) . substr($input_line, $len - 3, 3);
    }
    // $out .= '\n';
}

echo $out;

?>

<?php
$count = (int) trim(fgets(STDIN));
for ($i = 0; $i < $count; $i++) {
    $word = trim(fgets(STDIN));
    if (($num = strlen($word)) > 10) {
        $word = $word[0] . ($num-2) . $word[$num - 1];
    }
    echo $word."\n";
}

<?php
fscanf(STDIN, '%d', $n);
while(fscanf(STDIN, '%s', $s)) {
	$l = strlen($s);
	if ($l > 10) {
		echo substr($s, 0, 1),($l-2),substr($s,-1),PHP_EOL;
	} else { echo $s,PHP_EOL;}
}
?>

<?php
$count = fgets(STDIN);
for($i = 0; $i < $count; $i++){
$string = trim(fgets(STDIN));

if(strlen($string)<=10){
print($string."\r\n");
continue;
}
$tmp_string = $string{0}.(strlen($string)-2).$string{strlen($string)-1};

print($tmp_string."\r\n");

}
?>

<?php
	//fopen("php://stdin");
	//$n=+readline();
	//fopen("php://stdout");
	fscanf(STDIN,"%d",$n);
	for($i=0;$i<$n;$i++)
	{
		//$str=readline();
		fscanf(STDIN,"%s",$str);
		if (strlen($str)<=10)echo "$str\n";
		else
		{
			$l=strlen($str)-2;
			$ans=$str[0].strval($l).$str[$l+1];
			echo $ans."\n";
		}
	}

?>

<?php
function longWord($in,$arr){

    for($i=0;$i<$in;$i++){
       if(strlen($arr[$i])<=10)
       echo $arr[$i]."\n";
       else
       echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1)."\n";
    }
}
$stdin = fopen("php://stdin","r");
fscanf($stdin,"%d",$in);
$arr=array();
for($i=0;$i<$in;$i++){
    fscanf($stdin, "%s", $arr[$i]);
}
longWord($in,$arr);
?>

<?php
fscanf(STDIN , "%d",$s);
for($i = 0 ; $i < $s ; $i++){

fscanf(STDIN , "%s",$str);

if(strlen($str) <= 10){
	echo $str."\n";
}else{
	echo $str[0].(strlen($str)-2).$str[strlen($str)-1]."\n";
}

}
?>

<?php
list($n)=explode(" ",trim(fgets(STDIN)));
for ($i=0;$i<$n;$i++){
list($a)=explode(" ",trim(fgets(STDIN)));
$num=strlen("$a");
if ($num<=10) print("$a\r\n");
else {$first=substr($a,0,1);
$last=substr($a,-1);
$num-=2;
print"$first$num$last\n";}
}
?>

<?php
/**
 * Secdra @2020
 */
fscanf(STDIN, "%d", $n);
for ($i = 0; $i < $n; $i++) {
    fscanf(STDIN, "%s", $word);
    if (strlen($word) > 10) {
        printf("%s%d%s", $word[0], strlen($word) - 2, $word[-1]);
    } else {
        printf("%s", $word);
    }
    printf("\n");
}
?>

<?php
$n = (int)readline();
for($i = 0; $i < $n; $i++) {
    $input = readline();
    $len = strlen($input);
    if($len <= 10)
        $output[] = $input . "\n";
    else
        $output[] = $input[0] . ($len-2) . $input[$len - 1] . "\n";
}
foreach ($output as $o)
    echo $o;

<?php
error_reporting(E_ALL);

function solve($word)
{
    $word = preg_replace('/\s+/', '', $word);
    if (strlen($word) > 10) {
        if (!ctype_digit($word)) {
            $first = $word{0};
            $last = substr($word, -1);
            return $first . (strlen($word) - 2) . $last;
        }
    } else {
        if (!ctype_digit($word)) {
            return $word;
        }
    }
}

while ($word = fgets(STDIN)) {
    echo solve($word).PHP_EOL;
}
?>

<?php
$a = trim(fgets(STDIN));
for($x = 1; $x <= $a; $x++)
{
     $b = trim(fgets(STDIN));
     if(strlen($b) > 10)
     {
          print $b[0] . (strlen($b) - 2) . $b[strlen($b) - 1] . "\n";
     }
     else
     {
          print $b . "\n";
     }
}
?>

<?php
fscanf(STDIN, "%d", $n);
while($n--)
{
    fscanf(STDIN, "%s", $s);
    $ln = strlen($s) - 2;
    echo $ln > 8 ? $s[0].$ln.$s[$ln+1]:$s;
    echo "\n";
}
?>

<?php
fscanf(STDIN, "%d", $s);
while(fscanf(STDIN, "%s", $s))
{
    $ln = strlen($s) - 2;
    echo $ln > 8 ? $s[0].$ln.$s[$ln+1]:$s;
    echo "\n";
}
?>

<?php
	$n = fgets(STDIN);
	for ($x = 0; $x < $n; $x++) {
		$in = trim(fgets(STDIN));
		$len = strlen($in);
		if ($len > 10) {
			echo $in[0].($len-2).$in[$len-1].PHP_EOL;
		} else {
			echo $in.PHP_EOL;
		}
	}
?>

<?php
$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) <= 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) -2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
// print_r(($dataClear));
for($i = 0; $i < $amount ; $i++){
    if($dataClear[$i] == max(array_keys($dataClear))){
        echo($dataClear[$i]);
    }else{
        echo($dataClear[$i])."\n";
    }
}
?>

<?php

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

$number = (int)trim(fgets($handle));

while($number >= 0){

  $word = trim(fgets($handle));

  $length = strlen($word);

  if($length > 10){

    echo $word[0]. ($length - 2) . $word[$length - 1]."\r";

  }else{

    echo $word."\r";

  }

  $number--;
}

fclose($handle);

<?php

// 85038859 	Jun/25/2020 17:04UTC+1 	celyes 	A - Way Too Long Words 	PHP 	Accepted 	31 ms 	5900 KB

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

$number = (int)trim(fgets($handle));

while($number >= 0){

  $word = trim(fgets($handle));
  $length = strlen($word);
  echo $length > 10 ? $word[0]. ($length - 2) . $word[$length - 1]."\r" : $word."\r";
  $number--;

}

fclose($handle);

<?php
$j = fgets(STDIN);
while($s = fgets(STDIN)) $arr[] = $s;
foreach($arr as $s) {
    $s = trim($s);
    $str_len = strlen($s);
    if($str_len>10) {
        echo $s{0}.($str_len-2).$s{$str_len-1}."\n";
    } else echo $s."\n";
}
?>

<?php

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

$n = trim(fgets(STDIN));

for ($i = 0; $i < $n; $i++) {

	$str = trim(fgets(STDIN));
	$len = strlen($str);

	if ( $len > 10 ) {
		echo $str{0} . ($len - 2) . $str{$len - 1};

	} else {
		echo $str;
	}

	echo "\n";
}

<?php
$stdin = fopen("php://stdin","r");
fscanf($stdin,"%d",$n);
for($i = 0; $i < $n; $i++)
{
    fscanf($stdin, "%s",$s);
    if(strlen($s) > 10) {
        echo $s[0].(strlen($s) - 2).$s[strlen($s) -1 ]."\n";
    } else {
        echo $s."\n";
    }
}

<?php

    $n = trim(fgets(STDIN));
    $arr = [];
    for($i = 0; $i < $n; $i++) {
        $w = trim(fgets(STDIN));
        if (strlen($w) > 10) {
            $length = strlen($w);
            $e = substr($w, -1);
            $a = $w[0] . (string)($length - 2) . $e;
            echo($a . PHP_EOL);
        } else {
            //$arr[$i] = $w;
            echo($w . PHP_EOL);
        }
    }

<?php
	$n = trim(fgets(STDIN));
	$i = 0;
	while($i<$n)
	{
		$str = trim(fgets(STDIN));
		$pjg = strlen($str);
		echo ($pjg <= 10)?$str:substr($str,0,1) . ($pjg-2) . substr($str,-1);
		echo "\n";
		$i++;
	}
?>

<?php
// for example, the input is '5 9'
$result = trim(fgets(STDIN));
list($n) = explode(' ',$result);
for($n;$n > 0;$n--){
    $word = trim(fgets(STDIN));
    $wLen = strlen($word);
    if($wLen > 10)
    {
        echo $word[0] . ($wLen -2 ) . $word[$wLen-1] . "\n";
    }
    else echo $word . "\n";
}
// there will be 14
?>

<?php
  // $input = file_get_contents('./input.txt', 'r');
  $input = file_get_contents('php://stdin', 'r');
  $rows = explode("\n", trim($input));
  $N = (int)$rows[0];
  $arr = array();

  for($i = 0 ; $i < $N; $i++) {
    $row = trim($rows[$i + 1]);
    if (strlen($row) <= 10) {
      $arr[] = $row;
    } else {
      $firstcher =  substr($row, 0, 1);
      $lastcher = substr($row, strlen($row)-1, 1);
      $row = $firstcher . (strlen($row)-2) . $lastcher;
      $arr[] = $row;
    }
  }
  echo implode("\n", $arr);
?>

<?php
    fscanf(STDIN, "%d" , $n);
    $b = [];
    for($i = 0;$i<$n;$i++)
    {
        fscanf(STDIN, "%s", $b[]);
    }

     function reduceStr($i)
     {
         $arr = str_split($i);
         $num = count($arr) - 2;
         if(count($arr) <= 10){
             echo $i;
         }else{
             echo $arr[0] . $num . $arr[$num + 1];
         }
     }

    for($i =  0; $i < count($b); $i++){
        reduceStr($b[$i]);
        echo PHP_EOL;
    }

?>

<?php
function read(){
	return file_get_contents('php://stdin');
}
function put($data){
	$f = fopen('php://stdout' , "w");
	fwrite($f, $data);
	fclose($f);
}
$read = read();
$x = explode("\n", $read);

$out = [];
foreach($x as $k=>$line){
	if($k != 0){
		$out[] = strlen($line)<=11?$line:substr($line, 0,1).(strlen($line)-3).substr($line, strlen($line)-2);
	}
}
put(implode("\n",$out));
?>

<?php
fscanf(STDIN, "%d",$n);
for ($i=0; $i < $n; $i++) {
	fscanf(STDIN,"%s",$words[]);
	if (strlen($words[$i])>10) {
	$words[$i]=$words[$i][0].(strlen($words[$i])-2).$words[$i][strlen($words[$i])-1];
}
}
for ($i=0; $i < $n; $i++) {
	echo "$words[$i]\n";
}
?>

$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) - 2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
for($i = 0; $i < $amount; $i++){
    echo($dataClear[$i]);
}

<?php

    $dir = fopen("php://stdin", 'r');
    $input = stream_get_contents($dir);

// $input = '3
// 1 0 1
// 0 1 1
// 0 0 0';

$arr = explode(PHP_EOL, $input);
for($i=0;$i<$arr[0];$i++){
    if(strlen($arr[$i+1]) < 10)
        echo $arr[$i+1];
    else{
        $str = $arr[$i+1];
        $str_sc = $str[0];
        $str_sc .= strlen($str) - 2;
        $str_sc .= $str[strlen($str)-2];
        echo $str_sc . '\n';
    }
}

<?php
fscanf(STDIN,"%d", $n);

while($n > 0)
{
	fscanf(STDIN, "%s", $w);
	if(strlen($w) < 11)
		fprintf(STDOUT, "%s". $w);
	else
		fprintf(STDOUT, "%s", $w[0] . (strlen($w) - 2) . $w[strlen($w)-1]);
	$n--;
}

<?php
// Open the file
//$file = @fopen("C:\\xampp\\htdocs\\test\\test.txt", 'r');
$file = fopen("php://stdin", 'r');

// Add each line to an array
if ($file) {
//    $array = explode("\n", fread($file, filesize("C:\\xampp\\htdocs\\test\\test.txt")));
    $array = explode("\n", fread($file, filesize("php://stdin")));

    array_shift($array);
    $array = array_values($array);
    $array=preg_replace('/\s+/', '', $array);

    foreach ($array as $key => $value){

//        echo $value;
        if(strlen($value) < 10 ) echo $value;
        else{
            //
            echo $value[0];
            echo strlen($value) - 2;
            echo substr("$value", -1); // returns last
        }

        echo "\n";
    }
//    fclose($file);

}
?>

<?php
fscanf(STDIN, "%d", $s);
while (fscanf(STDIN, "%s", $s)) {
    $ln = strlen($s) - 2;
    echo $ln > 8 ? $s[0].$ln.$s[$ln+1] : $s;
}

<?
$n=fgets(STDIN);
for($i=0;$i<$n;$i++)
    {
        $nam = fgets(STDIN);
        $ln = strlen($nam);
        $lc = strlen($nam);
        if($ln>8) echo substr($nam,0,1).$ln.substr($nam,$lc);
         else echo $nam;
    }
?>

<?php
$count = fgets(STDIN);
for($i = 0; $i < $count; $i++){
$string = trim(fgets(STDIN));

if(strlen($string)<=10) continue;

$tmp_string = $string{0}.(strlen($string)-2).$string{strlen($string)-1};

print($tmp_string."\r\n");

}
?>

<?php

// php://input or input.txt or STDIN
$input = STDIN;

// php://output or output.txt or STDOUT
$output = STDOUT;

define('MAX_LENGTH', 10);

function foo($s)
{
    $sl = strlen($s);

    if ($sl > MAX_LENGTH) {
        return $s[0] . ($sl - 2) . $s[$sl - 1];
    }

    return $s;
}

$results = [];

$n = fread($input, 3);

for ($i = 0; $i < $n; $i++) {
    $s = trim(fread($input, 100));

    $r = foo($s);

    if ($i + 1 < $n) {
        $r .= PHP_EOL;
    }

    fwrite($output, $r);
}

<?php
$handle = fopen ("php://stdin","r");
$word = fgets($handle);
$length = strlen($word);
if($length <= 5){
  echo $word;
}else{
  echo $word[0]. ($length - 3) . $word[$length - 2];
}

fclose($handle);

<?php
// for example, the input is '5 9'
$result = trim(fgets(STDIN));

list($n) = explode(' ',$result);
for($n;$n > 0;$n--){
    $word = trim(fgets(STDIN));
    $wLen = strlen($word);
    if($wLen > 10)
    {
        echo $word[0] . ($wLen -2 ) . $word[$wLen-1];
    }
    else echo $word;
}

// there will be 14
?>

<?php

function read_words() {

	fscanf(STDIN, "%d", $n);
	$words = array();

	while ($n--) {
		$words[] = explode(" ", trim(fgets(STDIN)));
	}

	return $words;
}

function abbreviate_words($words) {
	return array_map(function ($w) {
		$l = strlen($w) - 2;
		if ($l > 10) {
			return $w[0] . ($l - 2) . $w[$l - 1];
		} else {
			return $w;
		}
	}, $words);
}

function print_words($words, $split) {
	foreach ($words as $w) {
		echo $w;
	}
	echo "\n";
}

$words = read_words();
$abbr_words = abbreviate_words($words);

print_words($abbr_words, "\n");

<?php

$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) -2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}

for($i = 0; $i < count($dataClear); $i++){
    echo($dataClear[$i])."\n";
}

?>

<?php

$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)));
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
for($i = 0; $i < $amount; $i++){
    echo($dataClear[$i])."\n";
}

?>

<?php

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

$number = (int)fgets($handle);

while($number >= 0){

  $word = fgets($handle);

  $length = strlen($word);

  if($length <= 10){

    echo $word."\n";

  }else{

    echo $word[0]. ($length - 3) . $word[$length - 2]."\n";

  }

  $number--;
}

fclose($handle);

<?
$n=fgets(STDIN);
for($i=0;$i<$n;$i++)
    {
        $nam = fgets(STDIN);
        $ln = strlen($nam);
        if($ln>10){
            echo substr($nam,0,1);
            echo ($ln)-2;
            echo substr($nam,-1);
          }
         else echo $nam;
    }
?>

<?php
	$in = fgets(STDIN);
	$len = strlen($in);
	if ($len > 10) {
		echo $in[0].$len.$in[$len-1];
	} else {
		echo $in;
	}
?>

<?php
fscanf(STDIN, '%d', $a);
for ($i=0 ; $i<$a ; $i++ ){
    fscanf(STDIN, '%s', $word);
    $b =strlen($word);
    if ($b >= 10) {
        echo $word[0].($b-2).$word[strlen($word)-1] , "
";
    }
    else{echo $word ,"
";}
}

<?

$str = explode("\n", STDIN);
array_shift($str);

foreach ($str as $i => $word)
{
    if(strlen($word) > 10)
    {
        echo substring($word, 0,1) . (strlen($word)-2) . substring($word, -1) . PHP_EOL;
    }
}

<?php
// 71A Слишком длинные слова

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

$input_line = fgets($in);

$n = (int) $input_line;
$out = '';

for ($i = 1; $i <= $n; $i++ ) {

    $input_line = fgets($in);
    $len = strlen($input_line);
    if ($len <= 10) {
        $out .= $input_line;
    } else {
        $out .= $input_line[0] . (string)($len - 2) . $input_line[$len - 1];
    }
    $out .= '\n';
}

echo $out;

?>

<?php
function longWord($in){
    $arr=array();
    for($i=0;$i<$in;$i++){
        $stdin = fopen("php://stdin","r");
        fscanf($stdin,"%d",$arr);
    }
    for($i=0;$i<$in;$i++){
       if(strlen($arr[$i])<=10)
       echo $arr[$i]."
";
       else
       echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1)."
";
    }
}
$stdin = fopen("php://stdin","r");
fscanf($stdin,"%d",$in);
longWord($in);
?>

<?php
$n = trim(fgets(STDIN));
for($i=1;$i<=$n;$i++)
{
    $var = fgets(STDIN);
    if (strlen($var) > 10) {
        echo $var[0] . (strlen($var)-2) . $var[strlen($var)-1];
    }
    else{
        echo $var;
    }
}

<?php
    $arr = explode("\r\n", fgets(STDIN));
    $lengthLimit = $arr[0];
    for ($i=1; $i < count($arr); $i++){
        if (strlen($arr[$i])>$lengthLimit) {
            preg_match("/(.{1})(.+)(.{1})/", $arr[$i], $outArr);
            echo $outArr[1].((string)strlen($outArr[2])).$outArr[3];
        } else {
            echo $arr[$i];
        }
    }

<?php

$num =fgets(STDIN);
for($i=1 ; $i<=$num ; $i++){
$str =fgets(STDIN);
$num1 =strlen($str);
$num2 =$num1-4;
if($num1>10){
echo $str[0]. $num2 . $str[$num1-3] ."\n" ;
}
else {
echo $str ."\n";
}
}

?>

<?php
$fr = fopen("php://stdin", "r");
$fw = fopen("php://stdout", "w");

fscanf($fr, "%d", $n);

// Take inputs
for ($i = 0; $i < $n; $i++) {
	fscanf($fr, "%s", $words[]);
}

foreach($words as $key => $word) {
	if (strlen($word) < 10) {
		fprintf($fw, $word . "\n");
	} else {
		fprintf($fw, abbreviation($word) . "\n");
	}

}

function abbreviation($word)
{
	$firstChar = $word[0];
	$lastChar = substr($word, -1);

	return $firstChar . (strlen($word) - 2) . $lastChar;
}

fclose($fr);
fclose($fw);

<?php

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

$number = (int)fgets($handle);

while($number >= 0){

  $word = fgets($handle);

  $length = strlen($word);

  if($length > 11){

    echo $word[0]. ($length - 4) . $word[$length - 3];

  }else{

    echo $word;

  }

  $number--;
}

fclose($handle);

<?
$n=fgets(STDIN);
for($i=0;$i<$n;$i++)
    {
        $nam = fgets(STDIN);
        if(strlen($nam)>10){
            echo substr($nam,0,1);
            echo strlen($nam)-2;
            echo substr($nam,-1);
          }
         else echo $nam;
    }
?>

<?php
	$n = fgets(STDIN);
	for ($x = 0; $x < $n; $x++) {
		$in = trim(fgets(STDIN));
		$len = strlen($in);
		if ($len > 10) {
			echo $in[0].($len-2).$in[$len-1].'\n';
		} else {
			echo $in.'\n';
		}
	}
?>

fscanf(STDIN, "%d", $length);
for($i = 0; $i < $length; $i ++) {
    fscanf(STDIN, "%s", $s);
    $strLength = strlen($s);
    if($strLength > 10) {
        echo $s[0] . $s[$strLength-1];
    } else {
        echo $s;
    }
}

<?
$n = trim(fgets(STDIN));
for($i=0;$i<$n;$i++){
    $str = trim(fgets(STDIN));
    if(strlen($str)>10){
        $fstr .= $str[0] .  strlen($str)-2 . $str[strlen($str)-1] . "/n";
    }
    else{
        $fstr .= $str;
    }
}
print $fstr;

<?php

$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) -2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
$counter;
if($amount < count($dataClear)){
    $counter = $amount;
}else{
    $counter = count($dataClear);
}

for($i = 0; $i < $counter ; $i++){
    if($dataClear[$i] == end($dataClear)){
        echo($dataClear[$i]);
    }else{
        echo($dataClear[$i])."\n";
    }
}
?>

<?php
function longWord($in){
    $arr=array('word','localization','internationalization','pneumonoultramicroscopicsilicovolcanoconiosis');
    // for($i=0;$i<$in;$i++){
    //     fscanf(STDIN, "%d", $arr[$i]);
    // }
    for($i=0;$i<$in;$i++){
       if(strlen($arr[$i])<=10)
       echo $arr[$i]."
";
       else
       echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1)."
";
    }
}
$stdin = fopen("php://stdin","r");
fscanf($stdin,"%d",$in);
longWord(4);
?>

<?php

$input = trim(fgets(STDIN));
$numberOfInputs = (int)$input;

$resultArray = array();

for ($count = 0; $count < $numberOfInputs; $count++) {
    $string = trim(fgets(STDIN));
    $length = strlen($string);
    if ($length > 10) {
        $result = "{$string[0]}" . $length . "{$string[$length - 1]}";
        array_push($resultArray, $result);
    } else {
        array_push($resultArray, $string);
    }
}
foreach ($resultArray as $result) {
    printf("%s\n",$result) ;
}

<?php
fscanf(STDIN, '%d', $a);
for ($i=0 ; $i<$a ; $i++ ){
    fscanf(STDIN, '%s', $word);
    $b =strlen($word);
    if ($b >= 10) {
        echo $word[0].($b-2).$word[strlen($word)-1] , '
';
    }
    else{echo $word ,'
';}
}

<?php fscanf ( STDIN, '%d', $num1 ); while ( fscanf ( STDIN, '%s', $var1) ) { $num = strlen ( $var1 ); if ($num > 10) { 	$var1 = $var1[0] . ($num-2) . $var1[$num-1]; } echo $var1;} ?>

<?php

fscanf(STDIN, "%d\n", $number);
if ($number >= 1 && $number <= 100) {
    for ($i=1; $i <= $number; $i++) {
        $line[$i] = trim(fgets(STDIN));
    }
    for ($i=1; $i <= $number; $i++) {
        if (strlen($line[$i]) > 10) {
        print(substr_replace($line[$i], strlen($line[$i])-2, 1, strlen($line[$i])-2) . "\n");
        } else { print ($line[$i]);}
    }
}

<?php
$n = trim(fgets(STDIN));
for($i=1;$i<=$n;$i++)
{
    $var = fgets(STDIN);
    if (strlen($var) > 10) {
        $w = $var[0].(strlen($var)-2).$var[strlen($var)-1];
        echo $w;
    }
    else{
        echo $var;
    }
}

<?php

$str = explode("\n", STDIN);
array_shift($str);

foreach ($str as $i => $word)
{
    if(strlen($word) > 10)
    {
        echo substr($word, 0,1) . (strlen($word)-2) . substr($word, -1) . PHP_EOL;
    }
}

<?php
fscanf(STDIN,"%d", $n);

while($n > 0)
{
	fscanf(STDIN, "%s", $w);
	if(strlen($w) < 11)
		fprintf(STDOUT, "%s", $w);
	else
		fprintf(STDOUT, "%s", $w[0] . (strlen($w) - 2) . $w[strlen($w)-1]);
	$n--;
}

<?php
	$n = fgets(STDIN);
	for ($x = 0; $x < $n; $x++) {
		$in = trim(fgets(STDIN));
		$len = strlen($in);
		if ($len > 10) {
			echo $in[0].($len-2).$in[$len-1];
		} else {
			echo $in;
		}
	}
?>

<?php
$j = fgets(STDIN);
while($s = fgets(STDIN)) $arr[] = $s;
foreach($arr as $s) {
    if(strlen($s)>10) {
        echo $s{0}.(strlen($s)-2).$s{strlen($s)-1}."\n";
    } else echo $s."\n";
}
?>

<?php

$input=fgets(STDIN);

$s=strlen($input);
$ss=$s - 2;

echo $input[0].$ss.$input[strlen($input) - 1];

?>

<?php
$f = fopen("php://stdin", "r");
$g = trim(stream_get_contents($f));
$in = explode("\n", $g);

for ($i = 0; $i < count($in); $i++) {
  if(!is_numeric($in[$i])){
    $item = trim($in[$i]);
    $l = strlen($item);
    if ($l > 10) {
      $x = str_split($item);
      echo $x[0] . ($l - 2) . $x[$l - 1];
    } else {
      echo $item;
    }
    echo "\n";
  }
}

<?php

// php://input or input.txt or STDIN
$input = STDIN;

// php://output or output.txt or STDOUT
$output = STDOUT;

define('MAX_LENGTH', 10);

function foo($s)
{
    $sl = strlen($s);

    if ($sl > MAX_LENGTH) {
        return $s[0] . ($sl - 2) . $s[$sl - 1];
    }

    return $s;
}

$n = (int)trim(fgets($input, 3));

for ($i = 0; $i <= $n; $i++) {
    $s = trim(fgets($input, 101));

    $r = foo($s);
    $r .= PHP_EOL;

    echo ltrim($r);
}

<?php
fscanf(STDIN, "%d", $d);
while (fscanf(STDIN, "%s", $s)) {
	if(strlen($s) <= $d){
		echo $s . '<br>';
		continue;
	}else{
		$t = strlen($s);
		echo $s[0];
		echo $t-2;
		echo $s[$t - 1];
	}
}

<?php

function read_words() {

	fscanf(STDIN, "%d", $n);
	$words = array();

	while ($n--) {
		fscanf(STDIN, "%s", $w);
		$words[] = $w;
	}

	return $words;
}

function abbreviate_words($words) {
	return array_map(function ($w) {
		$l = strlen($w);
		if ($l > 10) {
			return $w[0] . ($l - 2) . $w[$l - 1];
		} else {
			return $w;
		}
	}, $words);
}

function print_words($words, $split) {
	foreach ($words as $w) {
		echo $w;
	}
	echo "\n";
}

$words = read_words();
$abbr_words = abbreviate_words($words);

print_words($abbr_words, "\n");

<?php

    $dir = fopen("php://stdin", 'r');
    $input = stream_get_contents($dir);

// $input = '3
// 1 0 1
// 0 1 1
// 0 0 0'

$arr = explode(PHP_EOL, $input);
for($i=0;$i<$arr[0];$i++){
    if(strlen($arr[$i+1]) < 10) {
        echo $arr[$i+1];
    }
    else{
        $str = $arr[$i+1];
        $str_sc = $str[0];
        $str_sc .= strlen($str) - 2;
        $str_sc .= $str[strlen($str)-2];
        echo $str_sc . '\n';
    }
}

<?php
function longWord($in){
    $arr=array();
    for($i=0;$i<$in;$i++){
        $stdin = fopen("php://stdin","r");
        fscanf($stdin,"%d",$arr[$i]);
    }
    for($i=0;$i<$in;$i++){
       if(strlen($arr[$i])<=10)
       echo $arr[$i]."
";
       else
       echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1)."
";
    }
}
$stdin = fopen("php://stdin","r");
fscanf($stdin,"%d",$in);
longWord($in);
?>

<?php
$str = fgets(STDIN);
while ($str = fgets(STDIN)) {
    if(!is_numeric($str)){
        if(strlen($str) > 10){
            echo substr($str, 0,1).(strlen($str)-4).substr($str, strlen($str)-3,1).PHP_EOL;
        }else{
            echo $str.PHP_EOL;
        }
    }
}
?>

<?php

  $dir = fopen("php://stdin", 'r');
  $input = stream_get_contents($dir);

// $input = '3
// werwer
// werwer
// qwrqwerqwerqwerwqrr';

$arr = explode(PHP_EOL, $input);

for($i=1;$i<=$arr[0];$i++){
  if(strlen($arr[$i]) < 10)
    echo $arr[$i] . "\n";
  else{
    $str = $arr[$i][0];
    $str .= strlen($arr[$i])-2;
    $str .= $arr[$i][strlen($arr[$i])-1];
    echo $str;
  }
}

<?php

    $dir = fopen("php://stdin", 'r');
    $input = stream_get_contents($dir);

// $input = '3
// 1 0 1
// 0 1 1
// 0 0 0';

$arr = explode(PHP_EOL, $input);
for($i=0;$i<$arr[0];$i++){
    if(strlen($arr[$i+1]) < 10)
        echo $arr[$i+1];
    else{
        $str = $arr[$i+1];
        $str_sc = $str[0];
        $str_sc .= strlen($str) - 3;
        $str_sc .= $str[strlen($str)-2];
        echo $str_sc;
    }
}

<?php
    fscanf(STDIN,'%d',$no_word);
    for ($i=0; $i<$no_word; $i++) {
        fscanf(STDIN,'%s',$word);
        $length = strlen($word);
        if (strlen($word) < 10) {
            echo $word . "\n";
        } else {
            echo substr($word,0,1) . ($length-2) . substr($word,$length-1,1) . "\n";
        }
    }
?>

<?php
error_reporting(0);

function solve($word)
{
    if (strlen($word) > 10) {
        $first = $word{0};
        $last = $word{((int)strlen($word)-1)};
        return $first. (strlen($word) - 2) . $last;
    } else {
        if (!is_numeric($word)) {
            return $word;
        }
    }
}

$word = trim(fgets(STDIN));
echo solve($word);

?>

<?php

$stdout = fopen(getenv("OUTPUT_PATH"), "w");
$stdin = fopen("php://stdin", "r");

fscanf($stdin, "%d" , $n) ;

for($i=0 ; $i<$n ; $i++)
{
     fscanf( $stdin , "%s" , $s ) ;
     if( strlen( $s ) > 10 )
     {
          echo $s[0] . "" . ( strlen($s)-2 ) . "" . $s[ strlen($s)-2] . "\n" ;
     }
     else
     {
          echo $s . "\n" ;
     }
}

fwrite($stdout);

fclose($stdin);
fclose($stdout);

?>

<?php
$n = readline('');
for($i=0;$i<$n;$i++){
	$word = readline('');
	if(strlen($word)>10){
		$first = $word[0];
		$last = $word[strlen($word)];
		$len = strlen($word)-2;
		echo $first.$len.$last."\n";
	}
	else{
	echo $word."\n";
	}
}

<?php
// Open the file
//$file = @fopen("C:\\xampp\\htdocs\\test\\test.txt", 'r');
$file = fopen("php://stdin", 'r');

// Add each line to an array
if ($file) {
    $array = explode("\n", fread($file, filesize("php://stdin")));

    array_shift($array);
    $array = array_values($array);
    $array=preg_replace('/\s+/', '', $array);

    foreach ($array as $key => $value){

//        echo $value;
        if(strlen($value) < 10 ) echo $value;
        else{
            //
            echo $value[0];
            echo strlen($value) - 2;
            echo substr("$value", -1); // returns "s"
        }

//        echo "<br>";
    }
    fclose($file);

}
?>

<?php
fscanf(STDIN, '%d', $a) ;
$b = strlen($a);
if (gettype($a) == 'int') {
    die;
}
if ($b >= 10) {
    echo $a[0].($b-2).$a[strlen($a)-1];
}
else{echo $a;}

<?php

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

$word = fgets($handle);
$length = strlen($word);
if($length <= 10){
  echo $word;
}else{
  echo $word[0]. ($length - 3) . $word[$length - 2];
}

fclose($handle);

<?php
fscanf(STDIN,"%d", $n);

while($n > 0)
{
	fscanf(STDIN, "%s", $w);
	if(strlen($w) < 11)
		fprintf(STDOUT, "%s". $w);
	else
		fprintf(STDOUT, "%s", $w[0] . (strlen($w) - 2) . $w[strlen($w)-1]);
	$n--;
}
//

$a = fgets(STDIN);
echo $a{0}.(strlen($a)-2).$a{(strlen($a)-1)};

<?php
	$in = fgets(STDIN);
	$len = strlen($in);
	if ($len > 10) {
		echo $in[0].($len-2).$in[$len-1];
	} else {
		echo $in;
	}
?>

#!/usr/bin/python
# ------- start import ------- #
# import sys
# -------   end import ------- #

# ------- start main func ------- #
def main():
    # ------- start grab input ------- #
    word_no     = input()
    number      = 0
    words       = []
    for number in range (word_no):
        word = raw_input()
        print (word[0:4])
    # -------   end grab input ------- #

# -------   end main func ------- #

# ------- start declare main func ------- #
if __name__ == "__main__" : main()
# -------   end declare main func ------- #

<?php
$handle = fopen ("php://stdin","r");
$word = fgets($handle);
$length = strlen($word);
if($length <= 5){
  echo $word;
}else{
  echo $word[0]. ($length - 3) . $word[$length - 2];
}

fclose($handle);

<?php
fscanf(STDIN, "%d", $d);
while (fscanf(STDIN, "%s", $s)) {
	if(strlen($s) <= $d){
		echo $s . '<br>';
		continue;
	}else{
		$t = strlen($s);
		echo $s[0];
		echo $t-2;
		echo $s[$t - 1];
	}
}

<?php
	$in = fgets(STDIN);
	$len = strlen($in);
	if ($len > 10) {
		echo $in[0].$len.$in[$len-1];
	} else {
		echo $in;
	}
?>

<?php
$a = array();
$n = trim(fgets(STDIN));
for($i=0; $i<$n; $i++)
	$a[$i] = trim(fgets(STDIN));

foreach ($a as $value)
{
	$count = count($value);
	if ($count <= 10)
		$asw = $value;
	else
	{
		$c = $count-2;
		$asw = substr($value, 0, 1).$c.substr($value, -1, 1);
	}

	echo $asw;
	echo "\n";
}

<?php
    $n = fgets(STDIN);
    for ($i = 0; $i < $n; $i++){
        $st = fgets(STDIN);
        $st = str_replace('\r\n', '', $st);
        if (strlen($st) > 10) {
            $y = 2;
            if ($i == $n - 1) $y = 1;
            echo $st[0].(strlen($st) - 2).$st[strlen($st) - $y];
            echo PHP_EOL;
        } else echo $st;
    }
?>

<?php
$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) -2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
$counter;
if($amount < count($dataClear)){
    $counter = $amount;
}else{
    $counter = count($dataClear);
}
// echo(end($dataClear));
for($i = 0; $i < $counter ; $i++){
    if($dataClear[$i] == end($dataClear)){
        echo($dataClear[$i]);
    }else{
        echo($dataClear[$i])."\n";
    }
}
?>

<?php
	$n = trim(fgets(STDIN));
	$i = 0;
	while($i<$n)
	{
		$str = trim(fgets(STDIN));
		$pjg = strlen($str);
		echo ($pjg == $n)?$str:substr($str,0,1) . ($pjg-2) . substr($str,-1)."<br />";
		$i++;
	}
?>

<?php
	$in = fgets(STDIN);
	$len = strlen($in);
	if (is_numeric($in)) exit;
	if ($len > 10) {
		echo $in[0].($len-2).$in[$len-1].'\n';
	} else {
		echo $in.'\n';
	}
?>

<?php
//$stdin = fopen('php://stdin', 'r');
$stdin = (fgets(STDIN));
$str = explode("\n", $stdin);
if(count($str)>2){
  //  array_shift($str);

    foreach ($str as $i => $word)
    {
        if(strlen($word) > 10)
        {
            echo substr($word, 0,1) . (strlen($word)-2) . substr($word, -1) . PHP_EOL;
        }
    }
}
?>

<?php

$input = trim(fgets(STDIN));
$numberOfInputs = (int)$input;

$resultArray = array();

for ($count = 0; $count < $numberOfInputs; $count++) {
    $string = trim(fgets(STDIN));
    $length = strlen($string);
    if ($length > 10) {
        $result = "{$string[0]}" . $length . "{$string[$length - 1]}";
        array_push($resultArray, $string . "1");
    } else {
        array_push($resultArray, $string);
    }
}
foreach ($resultArray as $result) {
    echo $result . "<br>";
}

<?php

$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) -2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
$counter;
if($amount < count($dataClear)){
    $counter = $amount;
}else{
    $counter = count($dataClear);
}
for($i = 0; $i < $counter ; $i++){

        echo($dataClear[$i]);
}
?>

<?php
$n = trim(fgets(STDIN));
for($i=1;$i<=$n;$i++)
{
    $w = fgets(STDIN);
    if (strlen($w) > 10) {
         $w=$w[0].(strlen($w)-2).$w[strlen($w)-1];
        echo $w;
    }

}

<?php
	$in = fgets(STDIN);
	$length = strlen($in);
	echo ($length>10)? $in[0].($length-2).$in[$length-1] : $in;
	echo "\n";
?>

<?php
$n = readline('');
for($i=0;$i<$n;$i++){
	$word = readline('');
	if(strlen($word)>10){
		$first = $word[0];
		$last = $word[strlen($word)];
		$len = strlen($word)-2;
		echo $first.$len.$last;
	}
}

<?php

// https://codeforces.com/problemset/problem/71/A

function getStdIn(bool $asInt = false): array
{
    $stdIn = explode(' ', trim(fgets(STDIN)));

    if ($asInt) {
        foreach ($stdIn as $key => $value) {
            $stdIn[$key] = (int)$value;
        }
    }

    return $stdIn;
}

// word too long > 10 chars

$words = getStdIn();

foreach ($words as $key => $word) {
    if (($len = strlen($word)) > 10) {
        echo $word[0] . ($len - 2) . substr($word, -1) . PHP_EOL;
    } else {
        echo $word . PHP_EOL;
    }
}

<?php

  $dir = fopen("php://stdin", 'r');
  $input = stream_get_contents($dir);

// $input = '4
// word
// localization
// internationalization
// pneumonoultramicroscopicsilicovolcanoconiosis
// ';

$arr = explode(PHP_EOL, $input);

for($i=1;$i<=$arr[0];$i++){
  if(strlen($arr[$i]) < 10)
    echo $arr[$i] . "\n";
  else{
    $str = $arr[$i][0];
    $str .= strlen($arr[$i])-2;
    $str .= $arr[$i][strlen($arr[$i])-1];
    echo $str . "\n";
  }
}

<?php
fscanf(STDIN, '%d', $a);
for ($i=0 ; $i<$a ; $i++ ){
    fscanf(STDIN, '%s', $word);
    $b =strlen($word);
    if ($b >= 10) {
        echo $word[0].($b-2).$word[strlen($word)-1] , "\n";
    }
    else{echo $word ,"\n";}
}

<?php fscanf ( STDIN, '%d', $num1 ); while ( fscanf ( STDIN, '%s', $var1) ) { $num = strlen ( $var1 ); if ($num > 10) { 	$var1 = $var1[0] . ($num-2) . $var1[$num-1]; } echo $var1;} ?>

<?php

$data = array();
$data = file('php://stdin');

if($data[0] >= 1 && $data[0] <= 100){
    $amount = array_shift($data);
}

$dataClear = array();
foreach($data as $k){
    if(strlen(trim($k)) < 10){
        $dataClear[] = trim($k);
    }
    if(strlen(trim($k)) > 10){
        $lenght = (strlen(trim($k)) -2);
        $lChar = strtolower(substr(trim($k), 0, 1));
        $rChar = strtolower(substr(trim($k), -1));
        $dataClear[] = $lChar.$lenght.$rChar;
    }

}
$counter;
if($amount < count($dataClear)){
    $counter = $amount;
}else{
    $counter = count($dataClear);
}
for($i = 0; $i < $counter ; $i++){
  echo($dataClear[$i])."\n";
}

?>

<?php

// php://input or input.txt or STDIN
$input = STDIN;

// php://output or output.txt or STDOUT
$output = STDOUT;

define('MAX_LENGTH', 10);

function foo($s)
{
    $sl = strlen($s);

    if ($sl > MAX_LENGTH) {
        return $s[0] . ($sl - 2) . $s[$sl - 1];
    }

    return $s;
}

$n = trim(fgets($input, 3));

for ($i = 0; $i < $n; $i++) {
    $s = trim(fgets($input, 101));

    $r = foo($s);

    if ($i + 1 < $n) {
        $r .= PHP_EOL;
    }

    echo ltrim($r);
}

<?
$n=fgets(STDIN);
for($i=0;$i<$n;$i++)
    {
        $nam = fgets(STDIN);
        $ln = strlen($nam);
        if($ln>10){
            echo substr($nam,0,1);
            echo ($ln)-2;
            echo substr($nam,-1);
          }
         else echo $nam;
    }
?>