Problem:
Score: 200 points

Problem Statement

We have a string S consisting of lowercase English letters.

If the length of S is at most K, print S without change.

If the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.

Constraints

K is an integer between 1 and 100 (inclusive).

S is a string consisting of lowercase English letters.

The length of S is between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

K
S

Output

Print a string as stated in Problem Statement.

Sample Input 1

7
nikoandsolstice

Sample Output 1

nikoand...

nikoandsolstice has a length of 15, which exceeds K=7.

We should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....

Sample Input 2

40
ferelibenterhominesidquodvoluntcredunt

Sample Output 2

ferelibenterhominesidquodvoluntcredunt

The famous quote from Gaius Julius Caesar.

Solution in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<queue>
#include<map>

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef double db;
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define mp make_pair
#define case_for(n) for(int i = 1 ; i <= n ; i ++) { cout<<"Case "<<i<<": "<<endl; solve();}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll power(ll a, ll b, ll p) { ll ans = 1; while (b) { if (b & 1) ans = ans * a % p; a = a * a % p, b /= 2; }return ans; }

db pi = 3.1415926535;

void solve()
{
	int n; cin >> n;
	//db j = 180 - ((n - 2) * 180 / n);
	//j /= 2;
	n *= 2;
	db res = 0;
	db j = (n - 2) * 180 / n - 90;
	for (int i = 0; i < n / 8; i++)
	{
		if (i % 2 == 0) res += cos(j / 180.0 * pi);
		else res += sin(j / 180.0 * pi);
	}
	res *= 2;
	printf("%.9f", res + 1);
	cout << endl;
}

int main()
{
	/*std::ios::sync_with_stdio(false);
	cin.tie(nullptr), cout.tie(0);*/
	//cout << tan(45 * pi / 180) << endl;
	//int t; cin >> t;
	/*while (t--)
	{
		solve();
	}
	//solve();*/
	int n; cin >> n;
	string a; cin >> a;
	if (a.size() <= n) cout << a;
	else
	{
		for (int i = 0; i < n; i++) cout << a[i];
		cout << "...";
	}
	return 0;
}
/*

*/