open Base
open Stdio

let () =
  match In_channel.input_line In_channel.stdin with
  | None -> failwith "cannot read input"
  | Some k -> let k = Int.of_string k in
    match In_channel.input_line In_channel.stdin with
    | None -> failwith "cannot read input"
    | Some x -> let length = String.length x in
      if length <= k
      then print_endline x
      else print_endline ((String.sub x ~pos:0 ~len:k) ^ "...")

