<?php
fscanf(STDIN,"%d",$cut_num);
$result_str = substr(fgets(STDIN),0,$cut_num);
$target_length = strlen($result_str);

if($target_length >= $cut_num){
    echo $result_str . "...";
}else{
    echo $result_str;
}
?>