fun main() {
    var k: Int
    var s: String
    do {
        k = readLine()?.toInt() ?: 1
    } while (k !in 1..100)
    do {
        s = readLine() ?: ""
    } while (s?.length !in 1..100)
    when (s.length <= k) {
        true -> print(s)
        false -> print(s.substring(0, k) + "...")
    }
}