You are given a string *q*. A sequence of *k* strings *s*<sub class="lower-index">1</sub>, *s*<sub class="lower-index">2</sub>, ..., *s*<sub class="lower-index">*k*</sub> is called beautiful, if the concatenation of these strings is string *q* (formally, *s*<sub class="lower-index">1</sub> + *s*<sub class="lower-index">2</sub> + ... + *s*<sub class="lower-index">*k*</sub> = *q*) and the first characters of these strings are distinct.

Find any beautiful sequence of strings or determine that the beautiful sequence doesn't exist.
The first line contains a positive integer *k* (1 ≤ *k* ≤ 26) — the number of strings that should be in a beautiful sequence. 

The second line contains string *q*, consisting of lowercase Latin letters. The length of the string is within range from 1 to 100, inclusive.
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	if (n == 1) {
		cout << "YES" << endl << s;
		exit(0);
	}
	if (s.size() == 1) {
		cout << "NO";
		exit(0);
	}
	if (s.size() < n) {
		cout << "NO";
		exit(0);
	}
	vector <string> a;
	string s1 = s[0]+"";
	vector <char> set1{s1[0]};
	for (int i = 0; i < s.size(); i++) {
		bool kol12 = false;
		for (int j = 0; j < set1.size(); j++) {
			if (s[i] == set1[j]) {
				kol12 = true;
				break;
			}
		}
		if (kol12) {
			s1 += s[i];
		}
		else {
			a.push_back(s1);
			set1.push_back(s[i]);
			s1 = s[i];
		}
	}
	a.push_back(s1);
	int kol = 0;
	if (a.size() < n) {
		cout << "NO";
		exit(0);
	}
	cout << "YES";
	for (int i = 0; i < a.size(); i++) {
		kol += 1;
		if (kol <= n) {
			cout << a[i] << endl;
		}
		else {
			cout << a[i];
		}
	}

}