-module('Main').
-export([main/1]).

main(_) ->
    {ok, [K]} = io:fread("", "~d"),
    {ok, [S]} = io:fread("", "~s"),
    LenOfS = length(S),
    case LenOfS > K  of
        true ->
            Sliced = string:slice(S, 0, K),
            NewS = unicode:characters_to_list([Sliced, "..."]),
            io:format("~s~n", [NewS]);
        false ->
            io:format("~s~n", [S])
    end,
    halt().



