#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#define forl(i,n) for(int i=0;i<(int)n;i++)
#define pb(x) push_back(int x)
#define lld long long int
#define pii pair<int,int>
#define mem(x,y) memset(x,y,sizeof(x))
using namespace std;
vector<char>t;
int a2[130];
int main()
{
    int k,j,k1,k2,k3;
    char s[110];
    char s1[30][110];
    int f2=0;
    for(int i=0; i<30; i++)
    {
        for(int j=0; j<110; j++)
        {
            s1[i][j]='\0';
        }
    }
    scanf("%d %s",&k,s);
    int len=strlen(s);

    int l=0;
    t.clear();
    int f=0,f3=0;
    forl(i,len)
    {
        //printf("%d %c\n",l,s1[l-1][0]);
        if(l==k-1)
        {
            for(j=i,k2=0; j<len; j++,k2++)
            {
                if(a2[s[j]]==1 && f3==0)
                {
                    s1[l-1][k1]=s[j];
                    k1++;
                    k2--;
                }
                else
                {
                    s1[l][k2]=s[j];
                    f3=1;
                    f=1;
                }

            }

        }
        else if(a2[s[i]]==1)
        {
            s1[l-1][k1]=s[i];
            k1++;
        }
        else if(s[i]==s[i+1])
        {
            t.push_back(s[i]);
        }
        else
        {
            if(a2[s[i]]==0)
            {
                t.push_back(s[i]);
                f2=1;
            }
            else if(a2[s[i]]==1)
            {
                s1[l-1][k1]=s[i];
                k1++;
            }
            if(f2==1)
            {
                for( k1=0; k1<t.size(); k1++)
                {
                    s1[l][k1]=t[k1];
                    a2[s1[l][0]]=1;
                }
                //s1[l][k1]='\0';
                t.clear();
                l++;
                f2=0;
            }

        }
        if(f==1)break;
    }
    //cout<<s1[l]<<endl;
    if(f==0)printf("NO\n");
    else
    {
        printf("YES\n");
        for(int i=0; s1[i][0]!='\0'; i++)
        {
            for(int j=0; s1[i][j]!='\0'; j++)
            {
                printf("%c",s1[i][j]);
            }
            printf("\n");

        }

    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int32_t main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n;
	cin >> n;
	string s;
	cin >> s;

	if (n == 1) {
		cout << "YES" << endl;
		cout << s << endl;
	}

	else if (n > s.size()) {
		cout << "NO" << endl;
	}

	else {

		vector<string> v;
		map<char, bool> m;
		string curr = "";
		curr += s[0];
		m[s[0]] = true;

		for (int i = 1; i < s.size(); i++) {
			if (m[s[i]] == true) {
				curr += s[i];
			}
			else {
				v.push_back(curr);
				curr = "";
				curr += s[i];
				m[s[i]] = true;
			}
		}

		if (curr.size() != 0) {
			v.push_back(curr);
		}

		if (v.size() < n) {
			cout << "NO" << endl;
			return 0;
		}

		int cnt = 0;
		cout << "YES" << endl;
		for (int i = 0; i < n - 1; i++) {
			cout << v[i] << endl;
			cnt += v[i].length();
		}

		cout << s.substr(cnt) << endl;
		return 0;

	}
}

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;

int gcd ( int a, int b )
{
  if ( a==0 ) return b;
  return gcd ( b%a, a );
}
bool b[255];
int main()
{
 	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	string s;
	cin>>n>>s;
	if (n>s.length())
	{cout<<"NO";
	return 0;
	}
	int k=0;
	for (int i=0;i<s.length();i++)
	b[s[i]]=true;
	for (int i=0;i<255;i++)
		if (b[i])
			k++;
	int temp=0;
	if (k<n)
	cout<<"NO";
	else
	{
	cout<<"YES";
	for (int i=0;i<s.length();i++)
	{
		if (b[s[i]] && temp<n)
		{cout<<endl;
		temp++;
		b[s[i]]=false;
		}
		cout<<s[i];
	}
	}
	cout<<endl;
    return 0;
}

#include<iostream>
using namespace std;
char v[102];
int used[1000];
string a;
int main()
{
    //ifstream f("a.in");
    //ofstream g("a.out");
    int k,i,c=1;
    char x;
    cin>>k;
    cin>>a;
    x=a[0];
    used[a[0]-'a']=1;
    for(i=0;i<a.size();++i)
    {
        if(c==k)
            v[i]=a[i];
        if(a[i]==x && c<k)
            v[i]=a[i];
        if(a[i]!=x && c<k && used[a[i]-'a']==0)
        {
            v[i]=a[i]-32;
            x=a[i];
            c++;
            used[a[i]-'a']=1;
        }
        if(a[i]!=x && used[a[i]-'a']==1)
            v[i]=a[i];
    }
    if(c<k)
        cout<<"NO";
    else
    {
        cout<<"YES"<<endl;
    for(i=0;i<a.size();++i)
        if(v[i]<97)
        {
            x=v[i]+32;
            cout<<endl<<x;
        }
        else
            cout<<v[i];
    }
}

#include <bits/stdc++.h>

using namespace std;

void solve()
{

	int n; cin >> n;
	string s; cin >> s;

	n--;       //
	// aabbcc
	int cnt = 0;

	vector<string>arr;
	string temp = "";
	temp += s[0];
	int i;
	vector<int>count(26, 0);
	count[s[0] - 'a'] = 1;

	for ( i = 1; i < s.size(); i++)
	{
		if (cnt == n)
			break;

		if (s[i] != s[i - 1])   //aab
		{
			if (count[s[i] - 'a'] == 1)
			{
				temp += s[i];
				continue;
			}
  //aabaa
			cnt++;
			arr.push_back(temp);
			temp.clear();

			temp += s[i];
			count[s[i] - 'a'] = 1;

		}
		else
			temp += s[i];

	}

	if (cnt < n)
	{
		cout << "NO" << endl;
		return ;

	}

	for (int j = i; j < s.size(); j++)
		temp += s[j];

	cout << "YES" << endl;

	for (int i = 0; i < arr.size(); i++)
		cout << arr[i] << endl;

	cout << temp;

}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	solve();

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll i,j,k,l,m,n;
    string st,st1,st2;
    vector<string>vc;
    set<char>s;
    map<char,int>mp;
    cin>>n>>st;
    mp[st[0]]=1;st1+=st[0];
    for(i=1; i<st.size(); i++)
    {
        if(mp.count(st[i])==mp.empty())
        {
            m=st1.size();
            if(m!=0)
            {
                vc.push_back(st1);
                st1.clear();
            }
            st1+=st[i];
            mp[st[i]]=1;
        }
        else
            st1+=st[i];
    }if(st1.size()!=0)vc.push_back(st1);
    if(vc.size()<n)
    {
        cout<<"NO";return 0;
    }cout<<"YES"<<endl;
    for(i=0;i<n-1;i++)cout<<vc[i]<<endl;st1.clear();
    for(j=n-1;j<vc.size();j++)st1+=vc[j];
    cout<<st1;
}

#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define endl "\n"
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef pair<int,int> ii;

const int N = 102;
int k;
char t[N];
bool used[26];
vector<int> res;

int main(void){
	scanf("%d", &k);
	scanf("%s", t);
	int size = strlen(t);

	For(i,0,size){
		if(!used[t[i]-'a']){
			used[t[i]-'a'] = 1;
			res.pb(i);
		}
		if(res.size() == k) break;
	}
	res.pb(size);

	if(res.size() == k+1){
		printf("YES\n");
		For(i,0,k){
			for(int j = res[i]; j < res[i+1]; j++){
				printf("%c", t[j]);
			}
			printf("\n");
		}
	}
	else{
		printf("NO\n");
	}

	return 0;
}

#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <set>
//#include <unordered_set>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long LL;
#define rep(i,a,n) for(int i = a; i < n; i++)
#define repe(i,a,n) for(int i = a; i <= n; i++)
#define per(i,n,a) for(int i = n; i >= a; i--)
#define clc(a,b) memset(a,b,sizeof(a))
const int INF = 0x3f3f3f3f, MAXN = 100+10;
string ans[MAXN];
bool vis[300];
char q[MAXN], s[MAXN];
int k,len;

void sub_str(int x, int y)
{
	repe(i,x,y) s[i-x] = q[i];
	s[y-x+1] = 0;
}
int main()
{
#ifdef SHY
	freopen("d:\\1.txt", "r", stdin);
#endif
	while(~scanf("%d%*c", &k))
	{
		scanf("%s", q);
		clc(vis,0);
		len = strlen(q);
		int cnt = 0;
		rep(i,0,len)
		{
			if(vis[q[i]]) continue;
			cnt++;
			vis[q[i]] = true;
		}
		clc(vis,0);
		if(cnt < k) puts("NO");
		else
		{
			puts("YES");
			int sum = 0, i, st = 0;
			vis[q[st]] = true;
			for(i = 1; i < len && sum < k-1; i++)
			{
				if(vis[q[i]]) continue;
				sub_str(st,i-1);
				puts(s);
				st = i;
				vis[q[i]] = true;
				sum++;
			}
			//for(;i < len; i++) if(!vis[q[i]]) break;
			sub_str(st,len-1);
			puts(s);
		}
	}
	return 0;
}

//----->|try=0; while(!success) try++;|<------
#include<bits/stdc++.h>
using namespace std;
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define PI acos(-1.0)
#define LL long long
#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define MX 1000005
#define MOD 1000000007
bool check[101],color[101];
int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    string s;
    int k;
    while(cin>>k>>s)
    {
        for(int i=0; i<s.size(); i++)
        {
            if(check[s[i]]==0&& k>0)
            {
                color[i]=1;
                //cout<<"color[i] = "<<color[i]<<" i = "<<i<<endl;
                check[s[i]]=1;
                k--;

            }
        }
        if(k)
        {
            cout<<"NO"<<endl;
            return 0;
        }
        cout<<"YES"<<endl;
        cout<<s[0];
        for(int i=1;i<s.size();i++)
        {
            if(color[i]) cout<<endl;
            cout<<s[i];
        }
        cout<<endl;
    }
}

#include <bits/stdc++.h>; j+;

#define ll long long int
#define f first
#define s second
#define a7laInputDaWlaEh ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define pf push_front
//#define pi 3.141592654

using namespace std;

///const long double eps = 1e-9;
int dX[8]={1,0, 0,-1,-1,-1, 1,1};
int dY[8]={0,1,-1, 0,-1, 1,-1,1};
int dx[4]={1,0, 0,-1};
int dy[4]={0,1,-1, 0};
long double EPS = 1e-9;
ll MOD = 1e9 + 7;

const int N = 1e3 + 10, M = 1e4, OO = 0x3f3f3f3f;
int n, m, u, v, c, q;

vector< pair<int,int> > edj[110];

int e3mlElSa7(int s, int d)
{
    set<int> ans;
    set< pair<int, int> > vis;
    queue< pair<int,int> > now;
    for(auto p : edj[s])
        now.push(p);
    while(!now.empty())
    {
        auto p = now.front();
        now.pop();
        if(vis.count(p)) continue;
        vis.insert(p);
        if(p.f == d) ans.insert(p.s);
        for(auto i : edj[p.f])
        {
            if(i.s != p.s) continue;
            if(vis.count(i)) continue;
            now.push(i);
        }
    }
    return ans.size();
}

int main()
{
    ///freopen("input.txt","r",stdin);
    ///freopen("output.txt","w",stdout);
    ///readString scanf("%s", charArrName);
    a7laInputDaWlaEh;
    int n, c = 0;
    string x, t = "";
    cin >> n >> x;
    vector<string> ans;
    set<char> st;
    for(int i = 0; i < x.length(); i++)
    {
        if(t == "")
        {
            ++c;
            t += x[i];
            st.insert(x[i]);
        }
        else if(c == n)
            t += x[i];
        else if(st.count(x[i]))
            t += x[i];
        else
        {
            ans.pb(t);
            t = "";
            ++c;
            t = x[i];
            st.insert(x[i]);
        }
        if(i == x.length() - 1 && t != "")
            ans.pb(t);
    }
    if(c != n) return cout << "NO" << endl, 0;
    cout << "YES" << endl;
    for(auto i : ans)
        cout << i << endl;
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;

bool used[1005];
bool p[1005];
int main(){
	int n;
	string s;
	cin>>n>>s;
	int l = s.length();
	int tot = 0;
	for(int i=0; i<l; i++){
		if(used[s[i]]==0){
			tot++;
		}
		used[s[i]] = 1;
	}

	if(tot>=n){
		printf("YES\n");

		for(int i = 0;i<l;i++){
			int u = s[i];
			if(p[u] == 0){
				if(n==1){
					cout<<s[i];
					i++;
					while(i<l){
						cout<<s[i];
						i++;
					}
					cout<<endl;
					break;
				}

				cout<<s[i];
				p[u] = 1;
				i++;
				while(p[s[i]]==1){
					cout<<s[i];
					i++;
				}
				i--;
				cout<<endl;

				n--;

			}
			if(n==0) break;
		}

	}else {
		printf("NO\n");
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define all(XQXQ) (XQXQ).begin(), (XQXQ).end()
#define rall(PNPN) (PNPN).rbegin(), (PNPN).rend()
#define ll long long
#define MO 1000000007
#define PB push_back
#define MP make_pair
#define MX 100005
#define times(ZZtimes) for(int XYZtimes=0;XYZtimes<ZZtimes;++XYZtimes)
#define MS(ZZtarget,ZZvalue) memset(ZZtarget,ZZvalue,sizeof(ZZtarget))
#define S(SCQW) scanf("%d",&SCQW)
#define SS(SCQW,ZSCQW) scanf("%d%d",&SCQW,&ZSCQW);
#define SSS(SCQW,ZSCQW,ZZSCQW) scanf("%d%d%d",&SCQW,&ZSCQW,&ZZSCQW)
#define SSSS(SCQW,ZSCQW,ZZSCQW,ZZZSCQW) scanf("%d%d%d%d",&SCQW,&ZSCQW,&ZZSCQW,&ZZZSCQW)
#define P(PRQW) printf("%d\n",PRQW)
#define eps 1e-8
#define PP(PRQW) printf("%d ",PRQW)
#define HAS(QPEU) !QPEU.empty()
#define rep(iW,JEJU,nW) for(int (iW)=JEJU;(iW)<(int)(nW);(iW)++)
#define FD(qeVECTORXMO,qeVALXMO) find(qeVECTORXMO.begin(),qeVECTORXMO.end(),qeVALXMO)!=qeVECTORXMO.end()
#define ST(qeVECTORXMO) sort(qeVECTORXMO.begin(),qeVECTORXMO.end())
#define ff first
#define ss second
#define x1 x1992WAZY
#define y1 y1992WALSR
#define x2 y1992WAHM
#define y2 y1992WADX
ll bigpow(ll a,ll b) {ll res=1;a%=MO;for(;b;b>>=1){if(b&1)res=res*a%MO;a=a*a%MO;}return res;}
void main2();int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
main2();return 0;}

void main2() {
  int N; string s;
  cin >> N >> s;
  if (N > s.size()) {
    cout << "NO\n";
    return;
  } else {
    int i = 0;
    string res;
    map<char, bool> vis;
    int cnt = 0;
    times(N) {
      char tmp = s[i];
      vis[tmp] = true;
      res.PB(s[i++]);
      cnt++;
      for (; i < s.size() and vis[s[i]]; i++) res.PB(s[i]);
      if (cnt == N) res += (s.substr(i));
      if (i >= s.size()) break;
      res.PB('\n');
    }
    if (cnt < N) cout << "NO\n";
    else {
      cout << "YES\n" << res;
    }
  }
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define ff first
#define ss second
#define maxn 100009
#define ll long long
#define pb push_back
#define inf 1000000009
#define ppb() pop_back()
#define pii pair <int , int>
#define mid(x, y) (x + y) / 2
#define all(x) x.begin(),x.end()
#define llinf 1000000000000000009
#define tr(i, c) for(__typeof(c).begin() i = (c).begin() ; i != (c).end() ; i++)
using namespace std;
using namespace __gnu_pbds;
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> very_usable;
int n, cnt;
bool vis[30];
string s, s1;
vector <string> v;
int main () {
	//freopen ("file.in", "r", stdin);
	//freopen ("file.out", "w", stdout);

 	//srand ((unsigned) time ( NULL ));
	//int randomNumber = rand() % 10 + 1;
	cin >> n >> s;

	for (int i = 0; i < s.size(); i++)
		vis[s[i] - 'a'] = 1;

	for (int i = 0; i < 26; i++)
		cnt += vis[i];

	memset (vis, 0, sizeof(vis));

	if (cnt < n)
		return puts ("NO"), 0;
	puts ("YES");
	int pos = 0;
	while(n) {
		if (n == 1) {
			for (int j = pos; j < s.size(); j++)
				s1 += s[j];
		}
		else {
			vis[s[pos] - 'a'] = 1;
			for (int j = pos; j < s.size(); j++) {
				if (vis[s[j] - 'a'] == 0 and s1.size() > 0) {
					pos = j;
					break;
				}

				s1 += s[j];
			}
		}
		n --;
		cout << s1 << '\n';
		s1.clear();
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int visited[227];
    char str[10000];

    int k,count=0;
    cin>>k;

    scanf("%s",str);
    int l=strlen(str);

    str[l]='4';
    str[l+1]='\0';

    for(int i=0;i<=27;i++)
    visited[i]=0;

    for(int i=0;i<l;i++)
    {

        visited[str[i]]=1;

    }

    count=0;
    for(int i=0;i<133;i++)
     {
        if(visited[i]==1)
         count++;
     }

//  cout<<count<<" "<<k;
        for(int i=0;i<=133;i++)
    visited[i]=0;

    if(k>count)
    {
        cout<<"NO"<<endl;

    }
    else
    {
        cout<<"YES"<<endl;
        int i;
        i=str[0];
        i=i-97;
        visited[i]=1;
     for( i=0;i<l;i++)
     {
        if(k==0)
        {
            break;
        }
        int a=str[i+1];
        a=a-97;
        cout<<str[i];
        if(str[i]!=str[i+1] && visited[a]!=1 && k>1)
        {

            visited[a]=1;
            cout<<endl;
            k--;
        }
     }

    }
return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>

using namespace std;

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    #endif

    int k;
    cin >>k;
    string a;
    cin >>a;

    int letters[50] = {0};
    bool marked[50] = {false};

    for(int i=0;i<a.size();i++){
        letters[a[i]-97]++;
    }

    int cnt = 0;
    for(int i=0;i<50;i++){
        if(letters[i] != 0){
            cnt++;
        }
    }
    if(cnt < k || k > a.size()){
        cout<<"NO"<<endl;
        return 0;
    }

    cout<<"YES";

    for(int i=0;i<a.size();i++){
        if(!marked[a[i]-97] && k > 0){
            marked[a[i]-97] = true;
            k--;
            cout<<endl;

        }
        cout<<a[i];
    }
    cout<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long k,nod=0,a[26]={0};
    char s[1000];
    cin>>k;
    scanf("%s",s);
    for(int i=0;i<strlen(s);i++)
    {
        if(!a[s[i]-'a'])
        {
            nod++;
            a[s[i]-'a']=1;
        }
    }
    if(nod>=k)
    {
        cout<<"YES\n";
        long long i=0;
        while(k--)
        {
            a[s[i]-'a']=0;
            while(1&&i<strlen(s))
            {
                if(a[s[i]-'a']==1)
                    break;
                cout<<s[i++];
            }
            if(k!=0)
            cout<<"\n";
        }
        for(;i<strlen(s);i++)
            cout<<s[i];
        cout<<"\n";
    }
    else
        cout<<"NO\n";
    return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main()
{
    int mas[26];
    int nmas[26];
    for(int i=0;i<26;i++)
    mas[i] = nmas[i] = 0;
    int u =0;
    string s;
    int q;
    cin >> q >> s;
    int size = s.size();
    for(int i=0;i<size;i++)
        if (mas[s[i]-'a'] == 0)
        {
            mas[s[i]-'a'] = 1;
            nmas[u] = i;
            u++;
        }
    int y =0;
    if (u >= q)
    {
        cout << "YES" << endl;
        for(int i=0;i<s.size();i++)
        {
            if (q > 0 && nmas[y] == i)
            {
                q--;
                y++;
                cout << endl;

            }
            cout << s[i];

        }

    }
    else cout <<"NO";

    return 0;

}

#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int c[26];
int ind[26];
string s[26];
int main()
{
	int start=0, finish=0;
	int k;
	string q;
	cin >> k;
	cin >> q;
	int count = 0;
	if (k == 1){
		cout << "YES"<<endl;
		cout << q;
	}
	else{
		if (k > q.size()){
			cout << "NO";
		}

		else{

			for (int i = 0; i < q.size(); i++)
			{
				c[(int)q[i] - 97]++;
				if (c[(int)q[i] - 97] == 1){
					ind[count] = i;
					count++;

				}
			}
			if (count >= k){
				cout << "YES"<<endl;

				for (int i = 0; i < k - 1; i++)
				{
					s[i] = q.substr(ind[i], ind[i + 1] - ind[i]);
					cout << s[i] << endl;
				}
				s[k - 1] = q.substr(ind[k - 1], q.length() - ind[k - 1]);
				cout << s[k - 1] << endl;
			}

			else
				cout << "NO";

		}
	}

	return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
bool d[1000];
bool y[20000]={0};
int main()
{
    int n;
    string x;
    cin>>n>>x;
    if(x.size()<n){
        cout<<"NO"<<endl;
        return 0;
    }
    if(n==1){
        cout<<"YES"<<endl;
        cout<<x<<endl;
        return 0;
    }
    int c=0,j=0;
    string h[n];
    for(int i=0;i<200;i++)
        y[i]=0;
    for(int i=0;i<1000;i++)
        d[i]=0;
    for(int i=0;i<x.size();i++){
       if(d[x[i]-'a']==0){
        d[x[i]-'a']=1;
        c++;
        if(i>0)
        y[i]=1;
       }
    else
        y[i]=0;
    }

    if(c<n)cout<<"NO"<<endl;
    else {
            cout<<"YES"<<endl;
            c=0;
            int i=0;
        for(i=0;c<n-1&&i<x.size();i++){
            if(y[i]) {cout<<endl;c++;}
            cout<<x[i];
        }

        x.erase(0,i);
        cout<<x;
    }
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define pb push_back
#define in(a) int a;cin>>a;
#define in2(a,b)in(a)in(b)
#define out(x) cout<<x<<endl
#define out2(x,y) cout<<x<<" "<<y<<" ";

void display(vector<string>&v){
	for(int i=0;i<v.size();i++){
		cout<<v[i]<<endl;
	}
	cout<<endl;
}

int32_t main()
{
	in(n);
	string s;cin>>s;

	vector<string>v;
	map<char,int>m;
	int pos;
	if(s.size()<n){
		out("NO");
	}else{
		for(int i=0;i<s.size();i++){
			string temp1="";
			temp1+=s[i];

			if(m[s[i]]==0){
				for(int j=(i+1);j<s.size();j++){
					if(s[i]==s[j]){
						temp1+=s[j];
					}else{
						pos=j;
						i=pos-1;
						break;
					}

					if(j==s.size()-1){
						i=s.size()-1;break;
					}
				}

				m[s[i]]++;
				v.pb(temp1);
			}else{
				string temp2=v[v.size()-1];
				temp2+=s[i];
				v[v.size()-1]=temp2;
			}
		}
		//display(v);
		if(v.size()<n){
			out("NO");
		}else{
			out("YES");
			vector<string>ans;
			for(int i=0;i<v.size();i++){
				ans.pb(v[i]);
				n--;
				if(n==0){
					pos=i;break;
				}
		    }
		    string temp="";
			for(int i=(pos+1);i<v.size();i++){
				temp+=v[i];
			}
			ans[ans.size()-1]+=temp;
			display(ans);
		}
	}
	return 0;
}

#include <iostream>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;

set<char> initials;

vector<int> positions;

bool solve(int k, string s){
	for(int i = 0; i < s.length() && k > 0; i++){
		if(initials.find(s[i]) == initials.end()){
			initials.insert(s[i]);
			positions.push_back(i);
			k--;
		}
	}

	if(k > 0) return false;
	return true;
}

int main(void){
	int k; string s; cin >> k >> s;

	bool done = solve(k, s);
	sort(positions.begin(), positions.end());

	if(!done){
		cout << "NO" << endl;
		return 0;
	}

	cout << "YES" << endl;
	for(int i = 0; i < positions.size() - 1; i++){
		int shift = i == 0 ? 0 : 1;
		cout << s.substr(positions[i], positions[i + 1] - positions[i]) << endl;
	}

	cout << s.substr(positions[positions.size() - 1]) << endl;
	return 0;
}

#include <bits/stdc++.h>
#define sfl(n) scanf("%I64d",&n);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gt(n) getline(cin,n)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
double PI=3.14159265358979323843;
void Time(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
void print(int n){
    if(n==0){
        return ;
    }
    print(n-1);
    cout<<"Hello world"<<endl;
}
bool prime (ll x){
	for(int i=2;i<=sqrt(x);i++){
	    if (x%i==0) {
			return false;
		}
	}
	return true;
}
int main(){

    Time();
    int k,i,ans=0,dg[28],l=1;
    map<char,int>m;
    string s;
    cin>>k>>s;
    for(int i=0; i<s.size(); i++){
        if(m[s[i]]==0){
            m[s[i]]++;
            dg[l]=i;
            ans++;
            l++;
        }
        if(ans==k){break;}
    }
    l=1;
    if(ans==k){
        cout<<"YES";
        for(int i=0; i<s.size(); i++){
            if(i==dg[l]){
               cout<<endl;
               cout<<s[i];
               l++;
            }
            else{cout<<s[i];    }
        }
    }
    else{cout<<"NO"<<endl;}
    return 0;
}

//2015.06.01
//박상준
//codeforce_302_div2_A.cpp

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n = 0;
    char q[101];
    cin >> n;
    cin.ignore();
    cin.getline(q, 101);

    bool check[26] = { false }; //알파벳이 나왔었는지 체크
    int position[27];
    int count = 0;  //지금까지 나온 알파벳의 종류를 기억

    //cout << strlen(q) << endl;
    //cout << q << endl;
    //나눠야 하는 수가 입력받은 전체 글자수보다 많을 때
    if ((unsigned int) n > strlen(q))
    {
        cout << "NO" << endl;
        return 0;
    }
    //n==1 일 때, 무조건 가능
    else if (n == 1)
    {
        cout << "YES" << endl;
        cout << q << endl;
        return 0;
    }

    //체크 시작
    for (int i = 0; i < 100; ++i)
    {
        //나오지 않은 알파벳이면 check 배열에 그 알파벳이 나온 위치를 저장.
        if (check[q[i] - 97] == false)
        {
            check[q[i] - 97] = true;
            position[count] = i;
            ++count;
        }

        //n만큼 서로 다른 알파벳을 찾았으면 루프를 빠져나온다.
        if (count == n) break;
    }
    position[count] = strlen(q);

    //cout << "count : " << count << endl;
    //충분한 종류의 알파벳이 없는 경우
    if (count != n)
    {
        cout << "NO" << endl;
    }
    //충분한 종류의 알파벳을 찾은 경우
    else
    {
        cout << "YES" << endl;
        char temp[101];
        for (int i = 0; i < n; ++i)
        {
            strncpy_s(temp, &q[position[i]], position[i + 1] - position[i]);
            cout << temp << endl;
        }
    }
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<utility>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<pii> vpi;
typedef set<int> si;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define all(v)              ((v).begin()), ((v).end())
#define sz(v)               ((int)((v).size()))
#define clr(v, d)           memset(v, d, sizeof(v))
#define rep(i, v)       for(int i=0;i<sz(v);++i)
#define pp(x)               push_back(x)
#define isodd(x) (x&1)
#define iseven(x) (!(x&1))
#define lop(i,n) for(ll i=0;i<n;i++)
#define lop1(i,n) for(ll i=1;i<=n;i++)
#define loop(i,a,b) for(int i=a;i<=b;i++)
#define INF                   1000000000
#define PI             3.141592653589793
#define rep(i, v)       for(int i=0;i<sz(v);++i)
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b) { return ((a*b) / gcd(a, b)); }
ll pw(ll b, ll p){ if (!p) return 1; ll sq = pw(b, p / 2); sq *= sq; if (p % 2) sq *= b; return sq; }
int sd(ll x){ return x<10 ? x : x % 10 + sd(x / 10); }
int  n, m; string str1, str2; char C;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int main(){
    cin >> n;
    cin >> str1;
    m = str1.size();
    if (m<n){
        cout << "NO";
        return 0;
    }

    char gemy[10000];
    string g[10000];
    int arr[10000];
    int cnt3 = 0;
    int cnt2 = 0;
    int cnt = 0;
    bool fuck = true;
    bool y = false;
    for (int i = 0; i < str1.size(); i++){
        fuck = true;
        for (int j = 0; j < cnt; j++){
            if (str1[i] == gemy[j])
                fuck = false;
        }
        if (fuck)
        {
            gemy[cnt++] = str1[i];
            arr[cnt3++] = i;
        }
        if (cnt3 == n){
            y = true; break;
        }
    }
    arr[cnt3++] = m;
    if (y)
    {
        cout << "YES" << endl;

        for (int i = 1; i < cnt3; i++)
        {
            cout <<str1.substr(arr[i-1],arr[i]-arr[i-1]) << endl;

        }
    }
    else {
        cout << "NO";
        return 0;

    }
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k,dem=0,h=0;
    cin>>k;
    string q;
    cin>>q;
    int b[26];

    int a[26];
    fill(a,a+26,0);
    for(int i=0;i<q.length();i++)
        {
            if(a[q[i]-97]==0)
            {
                a[q[i]-97]=1;
                dem++;

                b[h]=i;
                h++;
            }
        }
    b[h]=q.length();

    if(dem<k)
        cout<<"NO";
    else
    {
        cout<<"YES"<<endl;
        for(int i=0;i<=k-1;i++)
        {
            int j;
            for(j=b[i];j<b[i+1];j++)
                cout<<q[j];
            if(i==k-1 && j<q.length())
                for(int g=j;g<=q.length()-1;g++)
                    cout<<q[g];
            cout<<endl;
        }
    }
    return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
#define pi 3.141592653
#define N 100005

using namespace std;

int dx[9]={1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9]={0, 0, 1, -1, 1, -1, 1, -1, 0};

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        string q;
        int i, k;
        cin>>k>>q;
        map<char, int> m;
        for(i=0; i<q.length(); i++)
        {
                if(m.find(q[i])==m.end()) m.insert({q[i], i});
        }
        if(m.size()<k) cout<<"NO";
        else{
                cout<<"YES\n";
                vector<string> ans;
                set<char> g;
                for(i=0; i<q.length(); i++)
                {
                        string t;
                        if(g.find(q[i])==g.end())
                        {
                                g.insert(q[i]);
                                t.pb(q[i]);
                                int j=i;
                                while(j+1<q.length() && (q[j+1]==q[j] || g.find(q[j+1])!=g.end())){
                                        t.pb(q[j+1]);
                                        j++;
                                }
                                ans.pb(t);
                                i=j;
                        }
                        if(ans.size()==k) break;
                }
                for(int j=i+1; j<q.length(); j++) ans.back().pb(q[j]);
                for(i=0; i<ans.size(); i++) cout<<ans[i]<<"\n";
        }
        return 0;
}

#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <memory.h>

#define NN 110

using namespace std;

char str[NN];
int vst[26];

int main (){

	int k;
	scanf("%d",&k);
	scanf("%s",str);
	int N=strlen(str),i,tot=0;
	for(i=0; i<N; i++){
		if(!vst[str[i]-'a']) tot++;
		vst[str[i]-'a']=1;
	}

	if(tot<k) {
		puts("NO");
		return 0;
	}

	memset(vst,0,sizeof(vst));
	puts("YES");
	printf("%c",str[0]);
	vst[str[0]-'a']=1;

	for(i=1; i<N; i++){
		if(k>1 && !vst[str[i]-'a']){
			k--, puts("");
			printf("%c",str[i]);
			vst[str[i]-'a']=1;
		}
		else printf("%c",str[i]);
	}

	puts("");
	return 0;
}
 //2016-06-18 20:28:38.487000

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;

int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	vector<char> v;
	for (int i = 0; i < s.length(); i++) {
		if (count(v.begin(), v.end(), s[i]))continue;
		else v.push_back(s[i]);
	}
	vector<char>v1;
	int counter = 0;
	if (v.size() >= n) {
		cout << "YES" << endl;
		v1.push_back(s[0]);
		for (int i = 0; i < s.length(); i++) {
			if (count(v1.begin(), v1.end(), s[i])) cout << s[i];
			else {
				v1.push_back(s[i]);
				counter++;
				if (counter < n) {
					cout << endl;
					cout << s[i];
				}
				else cout << s[i];

			}
		}
	}
	else cout << "NO";
}

#include<bits/stdc++.h>
using namespace std;
bool vis[26],pd[1001];
int main()
{
	string s;
	int len,k,num=0;
	cin>>k>>s;
	len=s.length();
	for(int i=0;i<len;i++)
	{
		if(!(vis[s[i]-'a']))
		{
			vis[s[i]-'a']=1;
			pd[i]=1;
			num++;
		}
	}
	if(num<k)
	{
		cout<<"NO\n";
		return 0;
	}
	cout<<"YES\n";
	int cnt=0;
	for(int i=0;i<len;i++)
	{
		cout<<s[i];
		if(cnt==k-1)
		{
			continue;
		}
		if(pd[i+1])
		{
			cout<<endl;
			cnt++;
		}
	}
	return 0;
}

#include<iostream>
#include<set>
using namespace std;
int p,k,i,used[1000];
set<char>st;
main(){
	string s;
	cin>>k>>s;
	for(i=0;i<s.size();i++){
		st.insert(s[i]);}	p=st.size();
	if(p<k){cout<<"NO";return 0;}
	cout<<"YES"<<endl;i=0;
	while(2>1){if(i==s.size()){return 0;}
		cout<<s[i];
		used[s[i]]=1;	i++;
		if(used[s[i]]==0&&k>1){k--;cout<<endl;}}}

#include<bits/stdc++.h>
#include <cstring>
using namespace std;
int a,b,c,man,mix,x,y,z,k,ans,ans1,l,r,d[10000000];
string s,s1,s2;
vector<string> v,v1;
// deque<int> dq;
map<long long , long long> mp,mp1;
bool o,bo;
// long double ld;
pair<long long, long long> p[1000000];
int main(){
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin>>a>>s;
    for(int i = 0; i < s.size(); i++){
        mp[s[i]-'a']++;
    }
    for(int i = 0; i < 26; i++){
        if(mp[i]!=0)
            ans++;
    }
    if(ans<a){
        cout<<"NO";return 0;
    }
    ans1=1;
    mp.clear();
    // cout<<s[0];
    cout<<"YES";
    for(int i = 0; i < s.size(); i++){
        if(mp[s[i]-'a']==0 && ans1<=a){
            cout<<endl;
            cout<<s[i];
            ans1++;
        } else cout<<s[i];
        mp[s[i]-'a']++;
    }
}

#include <iostream>
#include <string.h>

using namespace std;

int k, num, mark[256], ok, j, l;
char str[110], buf[1001];

int main()
{
	cin >> k;
	cin >> str;

	int len = strlen(str);

	num = 1;
	mark[str[0]] = 1;
	buf[++l] = str[0];

	int i;

	for (i = 1; i < len; i++) {

		if (num == k) {
			ok = 1;
			break;
		}

		if (!mark[str[i]]) {
			num++;
			mark[str[i]] = 1;

			buf[++l] = '\n';
			buf[++l] = str[i];
		}
		else {
			buf[++l] = str[i];
		}

	}

	if (ok == 0 && num != k) {
		cout << "NO";
		return 0;
	}

	cout << "YES\n";

	for (int j = 1; j <= l; j++)
		cout << buf[j];

	for (int j = i; j < len; j++)
		cout << str[j];

	return 0;
}

#include <iostream>
#include <vector>
using namespace std;
bool x[26] ;
vector<int> y ;
int main()
{
    int n ;
    string s;
    cin>>n>>s;
    for(int i = 0 ; i<26 ; i++)x[i]=0 ;
    int c=0 ;
    for(int i= 0 ; i<s.size() ; i++)
    {
        if(!x[s[i]-'a'])
        {
            y.push_back(i);
            c++ ;

            x[s[i]-'a']=1 ;
        }
    }
    if(c<n)cout<<"NO" ;

    else
    {
        cout<<"YES" ;
        c=0 ;
        for(int i = 0 ; i<s.size(); i++)
        {
            if(y[c]==i&&n>0)
            {
                cout<<endl ;
                cout<<s[i];
                c++ ;
                n-- ;
            }
            else
                cout<<s[i] ;
        }
    }

    return 0;
}

#include <iostream>
#include <vector>
#include <cmath>
#include <fstream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <queue>
using namespace std;

#define ll long long

int main() {
	int n;
	cin >> n;

	string s;
	cin >> s;

	vector <int> ivec(27);
	for (int a = 0; a < s.size(); a++) {
		ivec[s[a] - 'a' + 1] = 1;
	}

	int q = 0;
	for (int a = 0; a < ivec.size(); a++)
		if (ivec[a])q++;

	vector <int> ch(27);
	if (q < n)cout << "NO";
	else {
		cout << "YES" << '\n';
		int i = 0;
		for (int a = 0; a < n; a++) {
				ch[s[i] - 'a' + 1] = 1;
				cout << s[i];
				i++;
				if (i == s.size())break;
				while (ch[s[i] - 'a' + 1]) {
					cout << s[i];
					i++;
					if (i == s.size())break;
				}
				if (a == n - 1) {
					for (int b = i; b < s.size(); b++)
						cout << s[b];
				}
				cout << ' ';
		}
	}

	return 0;
}

#include <iostream>
#include<vector>
#include<queue>
#include<stack>

using namespace std;

int main()
{
    int k;
    cin>>k;
    string q;
    cin>>q;
    vector<int> tab(k,0);
    vector<int>is(30,0);

    int i=1;
    int j=0;

    if (k>q.length())cout<<"NO"<<endl;
    else
    {

        while((i<=k)&&(j<q.length())){
            is[q[j]-97]=1;
            tab[i-1]++;
            j++;
            while((j<q.length())&&(is[q[j]-97]==1)){
                tab[i-1]++;
                j++;
            }
            i++;

        }

        if(i<=k)
        {
            cout<<"NO"<<endl;
        }else
        {
            cout<<"YES"<<endl;
            while(j<q.length())
            {
                tab[k-1]++;
                j++;
                //cout<<tab[k-1].length()<<endl;
            }
            int h=0;
            for(int l=0;l<k;l++)
            {
                for(int c=0;c<tab[l];c++)
                {
                    cout<<q[h];
                    h++;
                }
                cout<<endl;
            }
        }
    }
    return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main()
{
	int k;
	string s;
	bool letters[26];
	for(int i = 0 ; i < 26; i++)
	{
		letters[i] = true;
	}
	cin >> k >> s;
	s = "0" + s;
	string s1[100];
	int index = 0;
	for(int i = 1; i < s.length(); i++)
	{
		if(letters[s[i] - 97])
		{
			s1[index] += s[i];
			letters[s[i] - 97] = false;
			index ++;
		}
		else
		{
			s1[index - 1] += s[i];
		}
	}
	if(index > k - 1)
	{
		cout << "YES" << endl;
		for(int i = 0; i < k - 1; i++)
			cout << s1[i] << endl;
		int x = k - 1;
		while(s1[x] != "" && x < index)
		{
			cout << s1[x];
			x++;
		}
	}
	else
		cout << "NO" << endl;
	return 0;
}

 #include<bits/stdc++.h>
using namespace std;
typedef vector <int> vi;
typedef map<int,int> mii;
typedef pair<int,int> pii;
#define ll long long int
#define pb push_back
#define PI 3.1415926535897932384626
#define boost ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MOD 4294967296
#define MAX 100001
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define F first
#define S second
#define mset(x,v) memset(x, v, sizeof(x))
#define left(x) 2*x
#define right(x) (2*x) + 1
#define ALL(t) (t).begin(),(t).end()
#define pi 3.14159265358979323846264338327950
#define ret return 0
#define rev(s) reverse(s.begin(),s.end())
int main()
{
      boost;
      ll k;
      cin>>k;
      string s;
      cin>>s;
      set<char> s1;
      if(k>s.length())
      cout<<"NO"<<endl;
      else
      {
            forn(i,s.length())
            s1.insert(s[i]);
            if(s1.size()>=k)
            {
                  int cnt=1;
                  cout<<"YES"<<endl;
                  if(k==1)
                  {
                        cout<<s<<endl;
                        ret;
                  }
                  char x=s[0];
                  cout<<x;
                  set<int> s2;
                  s2.insert(x);
                  for(int i=1;i<s.length();i++)
                  {
                        if(cnt>=k)
                        break;
                        if(s2.find(s[i])==s2.end())
                        {
                              cnt++;
                              cout<<endl;
                              if(cnt<k)
                              {
                                    cout<<s[i];
                                    s2.insert(s[i]);
                              }
                              else if(cnt>=k)
                              {
                                    cout<<s.substr(i,s.length());
                                    ret;
                              }
                        }
                        else
                        cout<<s[i];
                  }
            }
            else
            cout<<"NO"<<endl;
      }
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <string.h>
using namespace std;
int main()
{
    int n;
    string word;
    cin >> n;
    cin >> word;
    int first_letter_index = 0;
    int counter =0;
    string word_seq;
    int word_bool[26] = {};
    vector<string> sequence;
    word_bool[word[0]-'a']=1;
    first_letter_index=0;
    for(int i=1; i<word.size(); i++)
    {
        if(word_bool[word[i]-'a']==1){
            continue;
        }
        else if(counter+1 != n)
        {

            counter++;
            word_seq = word.substr(first_letter_index, i- first_letter_index);
            word_seq[word_seq.size()]='\0';
            sequence.push_back(word_seq);
            first_letter_index=i;
            word_bool[word[i]-'a']=1;
        }
    }
    word_seq = word.substr(first_letter_index, word.size()-first_letter_index);
    word_seq[word_seq.size()]='\0';
    sequence.push_back(word_seq);

    if(sequence.size()==n){
            cout << "YES" <<endl;
        for(int i=0; i<sequence.size(); i++)
        {
            cout << sequence[i] << endl;
        }
    }
    else
    {
        cout << "NO" << endl;
    }
    return 0;
}

#include<bits/stdc++.h>
#define LL long long
using namespace std;
LL n,m,k,l;
map<char,pair<LL,LL> >mp;
string s;
int main()
{
     cin>>k;
     cin>>s;
     set<char>st;
     for ( int i = 0; i < s.length(); i++ )
     {
          st.insert(s[i]);
          mp[s[i]].first = -1;
          mp[s[i]].second++;
     }
        for ( int i = 0; i < s.length(); i++ )
        {
             if ( mp[s[i]].first == -1 ) mp[s[i]].first = i;
        }
           if ( st.size() < k ) { cout<<"NO"; return 0;}
           cout<<"YES";
           for ( int i = 0; i < s.length(); i++ )
           {
                if ( k != 0 && mp[s[i]].second != -2 ) { cout<<endl; cout<<s[i]; k--; mp[s[i]].second = -2; }
                else if ( k == 0 || mp[s[i]].second == -2 ) cout<<s[i];
           }

}

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

typedef struct ss
{
    int a;
    char b;
}ss;

int main()
{
    int k;
    char a[200];
    int n,f,m,l;
    scanf("%d",&k);
    scanf("%s",a);
    n = strlen(a);
    ss z[200];
    z[0].a = 0;
    z[0].b = a[0];
    m = 1;
    for(int i = 1;i < n;i++){
            f = 1;
        for(int j = 0;j < m;j++){
            if(a[i] == z[j].b){
                f = 0;
            }
        }
        if(f == 1){
            z[m].a = i;
            z[m].b = a[i];
            m++;
        }
    }

    if(k > m){
        printf("NO\n");
        return 0;
    }
    else{
        printf("YES\n");
        l = 1;
        for(int i = 0;i < n;i++){
            if(a[i] == z[l].b && l < k){
                printf("\n");
                l++;
            }
            printf("%c",a[i]);
        }
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;

bool batao(string used, char s1)
{
	for(int i=0;i<used.length();i++)
	{
		if(used[i]==s1)
		{
			return true;
		}
	}

	return false;
}

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    if(n==1)
    cout<<"YES"<<endl<<s;
    else if(s.length()<n)
    cout<<"NO";
    else
    {
       vector<string> v;
	   string used="";
	   int count=0,j=0;
	   while(count!=n-1 && j<=s.length()-1)
	   {
	   	string temp = "";
	   	used.push_back(s[j]);
	   	while(batao(used,s[j]) && j<=s.length()-1)
	   	{
	   		temp.push_back(s[j]);
	   		j++;
		}
		v.push_back(temp);
		count++;
	   }
		if(v.size()!=n-1 || j==s.length())
		{
			cout<<"NO";
			return 0;
		}
		else
		{
			cout<<"YES"<<endl;
			for(int i=0;i<v.size();i++)
			{
				cout<<v[i]<<endl;
			}
			for(int i=j;i<s.length();i++)
			cout<<s[i];
		}
    }

    return 0;
}

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<math.h>
#include<conio.h>

using namespace std;

using namespace std;
int a[27];

void main ()

{
   int k, dif = 0;
   cin >> k;
   string q;
   cin >> q;

   int len = q.length();
   for(int i=0; i<len; i++)
   {
        a[q[i]-97] = 1;
   }
   for(int j=0; j<27; j++) {if (a[j]==1)  dif++;}

   if (dif<k) {cout <<"NO"; return;}
   else cout <<"YES"<<endl;
   if (k==1) {cout << q; return;}

   for(int m=0;m<27;m++) a[m]=0;

   int start = 0, next = 0;
   int printed = 0;
   while(printed!=k)
   {
       a[q[start]- 97]=1;
       while (next < len && a[q[next] - 97]==1) next++;

        if (printed!=k-1) cout << q.substr(start,next-start)<<endl;
        else cout << q.substr(start);

        start = next;
        printed++;
   }

}

#include <iostream>
#include <string.h>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

using namespace std;

char s[105];
int danhdau[258];
int k;

void rs()
{
	int i;

	for(i=0; i<257; i++)
	{
		danhdau[i] = 0;
	}
}

void solve()
{
	char kq[29][105];
	int i,j, d, dem;
	int len;

	rs();

	len = strlen(s);
	dem = 0;
	d = 0;
	for(i=0; i<len; i++)
	{

		if(danhdau[s[i]]==0)
		{
			d=0;
			kq[dem][d]=s[i];
			kq[dem][d+1] = '\0';
			dem++;
			d++;
			danhdau[s[i]]=1;
		}
		else
		{
			kq[dem-1][d] = s[i];
			d++;
			kq[dem-1][d] = '\0';
		}
		if(dem==k)
		{
			for(j=i+1; j<len; j++)
			{
				kq[dem-1][d] = s[j];
				d++;
				kq[dem-1][d] = '\0';
			}
			i=len;
		}
	}
	if(dem<k)
	{
		printf("NO\n");
	}
	else
	{
		printf("YES\n");

		for(i=0; i<k; i++)
		{
			printf("%s\n", kq[i]);
		}
	}

}

int main()
{
//	freopen("a.inp", "r", stdin);
//	freopen("a.out", "w", stdout);

	while(scanf("%d %s", &k, &s) >0)
	{
		solve();
	}

	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int vst[200];

char st[200];

int main() {

	int k, tot = 0;

	cin >> k >> st;

	int len = strlen( st );

	for( int i = 0; i < len; i ++ ) {

		if( vst[st[i]-'a'] == 0 ) vst[st[i]-'a'] = 1, tot++;

	}

	if ( tot < k ) { puts("NO"); return 0; }

	puts("YES");

	memset( vst, 0, sizeof( vst));

	tot = 0;

	for( int i = 0; i < len; i ++ ) {

		if ( vst[st[i]] == 0 && tot < k ) {

			if( tot ) puts("");

			 vst[st[i]] = 1, tot++;

		}

		cout<<st[i];

	}

	return 0;

}

#include <iostream>
#include <string>
using namespace std;

int a[1000]={false},b[1000]={false};
string s;
int n;

int main(){
    cin>>n>>s;
    if(s.size()<n){
                   cout<<"NO\n";
                   return 0;
    }
    for(int i=0; i<s.size(); i++){
            if( a[s[i]]==false ){
                n--;
                a[s[i]]=true;
                b[i]=1;
                if(n==0) break;
            }
    }

    if(n!=0){
             cout<<"NO\n";
    }
    else{
         cout<<"YES\n";
         for(int i=0; i<s.size(); i++){
             cout<<s[i];
             if(i+1<s.size() && b[i+1]==true)
                             cout<<endl;
     }
    }

   // system("pause");
    return 0;
}

#include <iostream>
#include <string>
#include <set>
#include <math.h>
#include <stack>
#include <limits.h>
#include <queue>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <map>
#include <deque>
#include <unordered_map>
#include <complex>
#include <unordered_set>
#include <time.h>
#include <assert.h>
#define REP(i,N)for(long long i=0;i<(N);i++)
#define FOR(i,a,b)for(long long i=(a);i<=(b);i++)
#define FORD(i,a,b)for(long long i=a;i>=(b);i--)
#define ll long long
#define vi vector<ll>
#define vii vector<pair<ll,ll> >
#define vvi vector<vector<ll> >
#define pii pair<ll,ll>
#define ALL(x) (x).begin(), (x).end()
#define SZ(a)((ll)(a).size())
#define CHECK_BIT(n,x)((n)&(((ll)1)<<(x)))
#define pow2(x) ((x)*(x))
using namespace std;

int main(){
	cin.sync_with_stdio(0);
	ll q;
	cin >> q;
	string s;
	cin >> s;
	if (SZ(s) < q){
		cout << "NO" << endl;
		return 0;
	}
	vector<bool> used(26);
	ll k = 0;
	vector<string> retz;;
	while (k < SZ(s)){
		used[s[k] - 'a'] = true;
		string sko = "";
		while (k<SZ(s)&&(used[s[k] - 'a']||SZ(retz)==q-1)){
			sko+=s[k];
			k++;
		}
		retz.push_back(sko);
	}
	if (SZ(retz) < q){
		cout << "NO\n";
		return 0;
	}
	else{
		cout << "YES\n";
		REP(i, SZ(retz)){
			cout << retz[i] << "\n";
		}
	}
	return 0;
}

#include<iostream>
#include<string.h>
using namespace std;
int main(){
    char a[1000],x;
    string b[101];
    int k,l,n=0;int i=0;
    cin>>k;
    cin>>a;
    l=strlen(a);
    while(i<l){
        x=a[i];
        b[n]+=a[i];
        i++;
        while(x==a[i])
        {
        b[n]+=a[i];
        i++;
        }
        for(int j=0;j<=n;j++)
        {
            if(b[j][0]==a[i])
            {n--;
            break;
            }
        }
        n++;
    }
    if(n>k-1){
        cout<<"YES"<<endl;
        for(int i=0;i<n;i++){
        cout<<b[i];
        if(i<k-1)
        cout<<endl;
    }
    }else

    {
        cout<<"NO";
        return 0;
    }

}

#include <bits/stdc++.h>
using namespace std;

int main() {
    int k;
    cin>>k;

    string s;
    cin>>s;
    int n=s.size();
    int j=1,f=0;

    if(k==j){
        cout<<"YES\n";
        cout<<s;
        f=1;
    }else{
        if(k<=26){
            unordered_set<char> st;
            queue<int> q;
            for(int i=0;i<s.size();i++){
                if(st.find(s[i])==st.end()){
                    //mp[s[i]]++;
                    st.insert(s[i]);
                    q.push(i);
                    // cout<<i<<" ";
                }
                if(q.size()==k){
                    f=1;
                    cout<<"YES\n";
                    int start=q.front();
                    q.pop();
                    while(!q.empty()){
                        // cout<<start<<" ";
                        // end=q.fornt();
                    cout<<(s.substr(start, q.front()-start))<<endl;
                    start=q.front();
                    q.pop();
                    }
                    cout<<(s.substr(start, n-q.front()));
                    break;
                }
            }

        }
    }
    if(f==0){
        cout<<"NO";
    }
}

#include <bits/stdc++.h>
#define ll long long
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define EN '\n'
#define vc vector
#define eps 0.0000000001
#define inf 1e9
using namespace std;
map <char , bool> tk;
map <char , bool> to;
int main(){
    fastio;
    ll k;
    string s;
    cin >> k >> s;
    ll n = s.length();
    ll cnt = 0;
    for (ll i = 0 ; i < n ; i++){
        cnt += !tk[s[i]];
        tk[s[i]] = 1;
    }
    if (cnt < k)
        return cout << "NO", 0;
    cout << "YES";
    ll cc = 0;
    for (ll i = 0 ; i < n ; i++){
        if (!to[s[i]]&& cc < k){
            to[s[i]] = 1;
            cout << EN;
            cc++;
        }
        cout << s[i];
    }
    return 0;
}

#include <iostream>
using namespace std;
int main() {
	int k = 0,len=0,diff=1,p=1;
	char a[101];
	cin >> k >> a;
	len = strlen(a);
	for (int i = 1; i < len; i++){
		for (int j = 0; j < i; j++){
			if (a[i] == a[j]){
				break;
			}
			if (a[i] != a[j] && j == i - 1){
				diff++;
			}
		}
	}
	if (diff < k){
		cout << "NO" << endl;
	}
	else{
		cout << "YES"<<endl<<a[0];
		for (int i = 1; i < len; i++){
			int j = 0;
			if (p == k){
				for (i; i < len ; i++){
					cout << a[i];
				}
				break;
			}
			for ( j ; j < i; j++){
				if (a[i] == a[j]){
					cout << a[i];
					break;
				}
				if (a[i] != a[j] && j == i - 1){
					cout << endl << a[i];
					p++;
				}
			}

		}
	}
	return 0;
}

#include <fstream>
#include <time.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#define pb push_back
#define mp make_pair
#define sortvi(a) sort(a.begin(), a.end())
#define FOR(i, start, final) for (int i=start; i<=final; ++i)
#define ROF(i, start, final) for (int i=start; i>=final; --i)

#define f cin
#define g cout

//void f(int &x){char k;for(k=getchar();k<= 32;k=getchar());for(x=0;'0'<=k;k=getchar())x=x*10+k-'0';}

/*void f(int &x)//parsare cu semn
{
    char k; bool semn=0;
    for (k = getchar(); (k>'9' || k<'0');)
    {
        if (k=='-') semn=1;
        k=getchar();
    }
    for (x = 0; '0' <= k; k = getchar())    x = x * 10 + k - '0';
    if (semn==1) x=-x;
}*/

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair < int, int> pi;
typedef vector< int > vi;
typedef vector< pair< int, int > > vpi;

char s[105];
int N, K, cnt[30], x, ap[105], last, i;

int main()
{
    f.sync_with_stdio(false);
    f>>K>>(s+1); N=strlen(s+1);
    if (K>N) { g<<"NO\n"; return 0;}
    FOR(i,1,N)
    {
        ++cnt[s[i]-'a'+1];
        if (cnt[s[i]-'a'+1]==1)
            ap[i]=1;
    }

    FOR(i,1,N) x+=ap[i];
    if (x<K) { g<<"NO\n"; return 0;}

    g<<"YES\n"; last=1;
    for (i=1; i<=N; ++i)
        if (ap[i]==1)
        {
            if (K>1)
            {
                ap[i]=0; --K;
                for (; i<=N && ap[i]==0; ++i)g<<s[i], last=i+1;
                --i;
                g<<'\n';
            }
            else break;
        }
    for (i=last; i<=N; ++i)
        g<<s[i]; g<<'\n';
    return 0;
}

/*
*          Name : chaitanya
*
*     Institute : ANITS,Visakhapatnam
*
*/
#include<cstdio>
#include<iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include<cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#define infy  1000000000
#define all(x) begin(x),end(x)
#define ll long long int
#define ff first
#define ss second
#define pb push_back
const ll m = 1000000007;
#pragma GCC optimization ("O3")
const int N = 1000010;
using namespace std;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while(!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx,
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss; ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifndef ONLINE_JUDGE
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

ll f[2000010];

ll lcm(ll a,ll b)
{
  return (a*b)/__gcd(a,b);
}
ll binpow(ll a, ll b) {
     ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

ll find_ncr(ll n, ll r)
{
    ll m1=max(r,n-r);
    ll i,j,s,d=1,k;
    s=1;

    for(i=m1+1;i<=n;i++)
    {
        s=((s%m)*(i%m))%m;
    }

    m1=min(r,n-r);

    for(i=1;i<=m1;i++)
    {
        k=binpow(i,m-2);
        d=((d%m)*(k%m))%m;
    }

    k=(s%m*(d%m))%m;

    return k;
}

int main()
{
  // int x = -1, y = 10000;
  // double z = 0.2;
  // string s2 = "beginner1010";
  // long long b = 1LL << 60;

  // // debug(x, y, z, s, b);

  // double aux = 1010.0;
  // string code = "code";

  // debug(code + "forces",-aux / 10 * 2.3);
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  int n;
  cin >> n;
  vector<int> v;
  string s;
  cin >> s;
  map<char,int>m;
  for (int i = 0; i < s.size(); ++i)
  {
    m[s[i]] = 0;
  }
  m[s[0]] = 1;
  v.pb(0);
  for (int i = 1; i < s.size(); ++i)
  {
    if(m[s[i]] == 0)
    {
      m[s[i]] = 1;
      v.pb(i);
    }
  }
  if(v.size() < n)
  {
    cout << "NO\n";
  }
  else
  {
    cout << "YES\n";
    int i=0;
    while(n-1 > 0)
    {

      for (int j = v[i]; j < v[i+1] ; ++j)
      {
        cout << s[j];
      }
      cout << endl;
      n--;
      i++;
    }
    for (int j = v[i]; j < s.size() ; ++j)
    {
      cout << s[j];
    }
  }
  return 0;
}

#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<string>
using namespace std;
string w[30];
map<char, int>mp;
int main()
{
	int n;
	string q;
	cin >> n >> q;
	for (int a = 1;a <= n;a++)w[a] = ".";
	int j = 0;
	int a;
	for (a = 0;a < q.size();a++)
	{
		if (!mp[q[a]])w[++j][0] = q[a],mp[q[a]]=1;
		else w[j] += q[a];
		if (j >= n)break;
	}
	for (a++;a < q.size();a++)w[j] += q[a];
	if (j < n)cout << "NO";
	else
	{
		cout << "YES" << endl;
		for (int a = 1;a <= n;a++)cout << w[a]<<endl;
	}
	return 0;
}

 #include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<string>
using namespace std;
string w[30];
map<char, int>mp;
int main()
{
	int n;
	string q;
	cin >> n >> q;
	for (int a = 1;a <= n;a++)w[a] = ".";
	int j = 0;
	int a;
	for (a = 0;a < q.size();a++)
	{//
		if (!mp[q[a]])w[++j][0] = q[a],mp[q[a]]=1;
		else w[j] += q[a];
		if (j >= n)break;
	}
	for (a++;a < q.size();a++)w[j] += q[a];
	if (j < n)cout << "NO";
	else
	{
		cout << "YES" << endl;
		for (int a = 1;a <= n;a++)cout << w[a]<<endl;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define __ ios_base::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define foreach(it, x) for (__typeof (x).begin() it = (x).begin(); it != (x).end(); ++it)
#define all(x) x.begin(),x.end()
#define D(x) cout << #x " = " << (x) << endl;

template <class T> string toStr(const T &x)
{ stringstream s; s << x; return s.str(); }

template <class T> int toInt(const T &x)
{ stringstream s; s << x; int r; s >> r; return r; }

int dx[8] = {-1,-1,-1,0,1,1, 1, 0};
int dy[8] = {-1, 0, 1,1,1,0,-1,-1};

int main() {
  int k;
  cin >> k;
  string s;
  cin >> s;

  if (k == 1) {
    cout << "YES" << endl << s;
    return 0;
  }

  vector<int> match(26,0);
  match[s[0] - 'a'] = true;

  vector<int> pos;
  pos.push_back(0);
  int k2 = k;
  int tot = 1;
  for (int i = 1; i < s.size() && tot < k; ++i) {
    if (!match[s[i] - 'a']) {
      match[s[i] - 'a'] = true;
      pos.push_back(i);
      tot ++;
    }
  }

  pos.push_back(s.size());
  if (pos.size() == k + 1) {
    cout << "YES" << endl;
    int ant = pos[0];
    for (int i = 1; i < pos.size(); ++i) {
      for (int j = ant; j < pos[i]; ++j) {
        cout << s[j];
      }
      cout << endl;
      ant = pos[i];
    }
    return 0;
  }

  cout << "NO";
  return 0;
}

#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define abs(x) (((x)<0)?-(x):(x))
#define sz(a) int((a).size())
#define fr first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define tr(c,i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define TRvii(c, it) for (vii::iterator it = (c).begin(); it != (c).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
//int dx[]={1,0,-1,0};int dy[]={0,1,0,-1};
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};
using namespace std;

int main()
{
    //freopen("entrada.in", "r", stdin);
    //freopen("saida.txt", "w", stdout);
	int k;
	string s,ans[100];
	int dif = 0, l[256];
	memset(l,0,sizeof l);
	scanf("%d",&k);
	cin>>s;
	if(sz(s) < k){
		puts("NO");
		return 0;
	}
	if(k==1){
		puts("YES");
		cout<<s<<endl;
		return 0;
	}
	for(int i = 0; i < sz(s); i++)
	   if(!l[s[i]]){
		 l[s[i]] = 1;
		 dif++;
	   }
	bool ok = false;
	if(dif >= k){
		int tl = 0;
	   puts("YES");
	   l[s[0]] = 0;
	   int pos = 0;
	   ans[tl]+=s[0];
	   for(int i = 1; i < sz(s); i++)
		  if(l[s[i]]){
			  ans[++tl] = s[i];
			  l[s[i]] = 0;
			  k--;
			  if(k==1){
			  	ans[tl] += s.substr(i+1);
			  	break;
			  }

		  }
		  else
			 ans[tl]+=s[i];
		for(int i = 0; i <= tl; i++)
		   cout << ans[i] << endl;
	}
	else{
		puts("NO");
	}
    return 0;
}

#include<stdio.h>
#include<string.h>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    char a[500000];
    int vis[30]={0};
    scanf("%s",a);
    int len=strlen(a);
    if(len<n)
    {
        printf("NO\n");
        return 0;
    }
    int ans=0;
    int flag=-1;
    for(int j=0;j<len;j++)
    {
        if(vis[a[j]-'a']==0) {ans++; vis[a[j]-'a']=1; }
    }
    if(n==1)
    {
        puts("YES");
        puts(a);
        return 0;
    }
    if(ans<n) {printf("NO\n");  return 0;}
    puts("YES");
    int t=0;
    printf("%c",a[0]);
    vis[a[0]-'a']=0;
    for(int i=1;i<len;i++)
    {
        if(vis[a[i]-'a']==0||t>=n-1) printf("%c",a[i]);
        else {printf("\n%c",a[i]); t++;  vis[a[i]-'a']=0;   }
    }
    printf("\n");
    return 0;
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <stack>
#define ll long long
#define dou double
#define un unsigned
#define str string
#define INF 0x3f3f3f3f
using namespace std;
const int N = 1e5;
const double pi = 3.1415926535898;
const double e = 2.718281828459;
const ll mod = 1000000007;

dou erci1(dou a,dou b,dou c)
{
    dou d = b * b - 4 * a * c;
    d = sqrt(d);
    dou ans = (b * (-1) + d) / (2 * a);
    return ans;
}
dou erci2(dou a,dou b,dou c)
{
    dou d = b * b - 4 * a * c;
    d = sqrt(d);
    dou ans = (b * (-1) - d) / (2 * a);
    return ans;
}

int main()
{
    int k;
    str s;
    cin >> k;
    cin >> s;
    int n = s.length();
    int vis[n] = {0};
    int cnt = 0;
    int ch[126] = {0};
    for(int i = 0;i < n;i++)
    {
        if(ch[s[i]] == 0)
        {
            ch[s[i]] = 1;
            cnt++;
            vis[i] = 1;
        }
        if(cnt == k) break;
    }
    if(cnt < k)
    {
        cout << "NO";
        return 0;
    }
    cout << "YES" << endl;
    cout << s[0];
    for(int i = 1;i < n;i++)
    {
        if(vis[i] == 1) cout << endl;
        cout << s[i];
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <sstream>
#include <vector>
#include <queue>
#include <string>
#include <stdio.h>
#include <string.h>
#include <functional>    //for hash
#include <bitset>        //for binary

using namespace std;
string arr[300];bool arrs[30];
int main(int argc, char *argv[])
{
  //  freopen("input.iN","r" , stdin);
//	freopen("ans.txt","w" , stdout);
	int k,c=0;
	cin>>k;
	string s;
	cin>>s;
	if(s.length()<k){
		cout<<"NO"<<endl;
		return 0;
	}
	c=-1;
	for(int i=0;i<s.length();i++)
	{//cout<<arr[c]<<"   "<<c<<endl;
		if(!arrs[s[i]-'a'])
		{arrs[s[i]-'a']=1;
		    c++;
			arr[c]+=s[i];
		}
		else
		{
			arr[c]+=s[i];//cout<<arr[c]<<endl;
		}
		//cout<<arr[c]<<endl;
	}
	if(c<k-1){
		cout<<"NO"<<endl;
		return 0;
	}
	else{string v="";
		cout<<"YES"<<endl;
		for(int y=0;y<k-1;y++)cout<<arr[y]<<endl;
		for(int y=k-1;y<=c;y++){v+=arr[y];}
		cout<<v<<endl;
	}
	return 0;
}

#include "stdio.h"
#include "string.h"
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

string s;
int K;
bool visit[30];
int num[30];

void solve()
{
	if( s.length() == 1 && K != 1 ){
		cout<<"NO"<<endl;
		return;
	}
	if( K == 1 ){
		cout<<"YES"<<endl;
		cout<<s<<endl;
		return ;
	}

	memset(visit,false,sizeof(visit));
	memset(num,-1,sizeof(num));

	visit[s[0]-'a'] = true;
	for(int i = 1, j = 0; i < s.length(); i ++){
		if( !visit[s[i]-'a'] ){
			visit[s[i] - 'a'] = true;
			num[j++] = i;
			if( j + 1 == K ) break;
		}
		if( i + 1 == s.length() ){
			cout<<"NO"<<endl;
			return;
		}
	}
	cout<<"YES"<<endl;
	for(int i = 0, j = 0; i < s.length(); i ++ ){
		if( i == num[j] ){
			j ++;
			cout<<endl;
		}
		cout<<s[i];
	}
	cout<<endl;

}

int main()
{

	while(cin>>K){
		cin>>s;
		solve();
	}

	return 0;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<map>
#include<set>
using namespace std;

int main(){

    int n;
    string q;
    cin>>n>>q;
    if(n>q.size())cout<<"NO"<<endl;
    else {
        int x[150]={};
        int X[150]={};
        int y=0;
        for(int i=0;i<q.size();i++){
            int h=q[i]-'a';
            if(!x[h]&&y!=n){x[h]=i+1;
            y++;
            //if(y==n)break;
            }X[i]=y;
        }
        if(y==n){
            cout<<"YES"<<endl;
            for(int i=0;i<q.size();i++){
                //cout<<X[i];
                if(i>0&&X[i]!=X[i-1])cout<<endl;
                cout<<q[i];
            }
            cout<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;

    /*
        cout<<"YES"<<endl;
        int r=0;
        int w=q.size()-n;
        for(r=0;r<=w;r++){
            cout<<q[r];
        }
        cout<<endl;
        if(r<q.size()){
            for(r=w+1;r<q.size();r++)
                cout<<q[r]<<endl;

        }

    }
    return 0;
    */
}

#include <bits/stdc++.h>
#define FOR(i, j, k) for (int i = j; i <= k; i ++)
#define FORD(i, j, k) for (int i = j; i >= k; i --)
#define mn 400001
#define maxC 20000000
#define pb push_back
#define mp make_pair

using namespace std;
int k, id = 0, mark[300];
string a, ans[30];

void setup ()
{
    cin >> k >> a;
    FOR (i, 0, a.length() - 1)
    {
        if (k == 1 && mark[a[i]] == 0)
        {
            cout << "YES\n";
            FOR (i, 1, id)
            cout << ans[i] << "\n";
            cout << a.substr(i, a.length());
            return;
        }
        if (mark[a[i]] == 0)
        {
            mark[a[i]] = 1;
            id ++;
            k --;
        }
        ans[id] += a[i];
    }
    cout << "NO";
}

void xuly ()
{

}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    setup ();
    xuly ();
    return 0;
}

#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
const int INF = 1e8;
const int maxn = 110;

int main()
{
	bool Map[30];
	string s;
	bool ans[maxn];
	int q;
	cin >> q >> s;

	int counts = 1;
	memset(Map, true, sizeof(Map));
	memset(ans, false, sizeof(ans));
	for (int i = 0; i < s.size(); i++){
		if (Map[s[i] - 'a']){
			ans[i] = true;
			Map[s[i] - 'a'] = false;
			counts++;
			if (counts > q) break;
		}
	}
	ans[0] = false;
	if (counts > q){
		cout << "YES" << endl;
		for (int i = 0; i < s.size(); i++){
			if (ans[i]) cout << endl;
			putchar(s[i]);
		}
		cout << endl;
	}
	else cout << "NO" << endl;
	return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

#define debug(s) cerr << #s << " = " << s << '\n'
#define all(v) (v).begin(), (v).end()
#define mem(a,val) memset(a, val, sizeof a)

#define ff first
#define ss second
#define endl '\n'
typedef long long ll;

//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const int N = 110;

int k;
char s[N];

int main() {
  scanf("%d", &k);
  scanf("%s", s);
  int n = strlen(s);
  map<char, bool> mp;
  for (int i = 0; i < n; ++i) {
    mp[s[i]] = 1;
  }
  if (mp.size() < k) {
    puts("NO");
    return 0;
  }
  printf("YES\n");
  mp.clear();
  printf("%c", s[0]);
  mp[s[0]] = 1;
  k--;
  for (int i = 1; i < n; ++i) {
    if (k && !mp[s[i]]) {
      printf("\n");
      k--;
    }
    printf("%c", s[i]);
    mp[s[i]] = 1;
  }
  printf("\n");
}

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<iomanip>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#define debug(x) cerr<<#x<<"="<<x<<endl
#define INF 0x7f7f7f7f
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
inline int init()
{
    int now=0,ju=1;char c;bool flag=false;
    while(1)
    {
        c=getchar();
        if(c=='-')ju=-1;
        else if(c>='0'&&c<='9')
        {
            now=now*10+c-'0';
            flag=true;
        }
        else if(flag)return now*ju;
    }
}
inline long long llinit()
{
    long long now=0,ju=1;char c;bool flag=false;
    while(1)
    {
        c=getchar();
        if(c=='-')ju=-1;
        else if(c>='0'&&c<='9')
        {
            now=now*10+c-'0';
            flag=true;
        }
        else if(flag)return now*ju;
    }
}
bool vis[27];
char str[105];
int pos[105];
int n,ans;
int main()
{
	n=init();
	scanf("%s",str+1);
	int l=strlen(str+1);
	for(int i=1;i<=l;i++)
	{
		if(!vis[str[i]-'a']&&ans<n)
		{
			vis[str[i]-'a']=1;
			ans++;
			pos[i]=1;
		}
	}
	if(ans<n)
	{
		printf("NO\n");
		return 0;
	}
	printf("YES\n");
	for(int i=1;i<=l;i++)
	{
		if(pos[i]&&i!=1)
		{
			putchar('\n');
		}
		putchar(str[i]);
	}
	return 0;
}
/*
srO xudyh davidlee1999WTK linkct1999 zlser Orz
*/

//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

//typedefs

///números
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

///puntos
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pd;

///vectores
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<pll> vpll;
typedef vector<cd> vcd;

//fin typedefs

//bucles

#define forr(i, a, b) for(int i=a; i<(b); i++)
#define forn(i, n) forr(i, 0, n)
#define dforr(i, a, b) for(int i = (b)-1; i >= a; i--)
#define dforn(i, n) dforr(i, 0, n)
#define forall(it, v) for(auto it = v.begin(); it != v.end(); it++)
#define forv(i, v) for(auto i : v)

//fin bucles

//operadores

#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define vsort(v) sort(all(v))
#define rev(v) reverse(all(v))
#define revsort(v) vsort(v);rev(v)
#define zero(v) memset((v), 0, sizeof(v))

//fin operadores

#define FIN ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy

//Matchear BIEN las cotas
//Optimizar es DP salvo que sea muy trivial

int main(){FIN;
	int k;
	string q;
	set<char> s;
	cin >> k >> q;
	for(auto c : q) s.ins(c);
	if(sz(s) < k) cout << "NO\n";
	else{
		vector<char> vec;
		vi v;
		for(auto c : q) if(s.find(c) != s.end()){
			vec.pb(c);
			s.erase(c);
		}
		for(auto c : vec) forn(i, sz(q)) if(q[i] == c){v.pb(i); break;}
		vsort(v);
		while(sz(v) > k) v.pop_back();
		v.pb(sz(q));
		cout << "YES\n";
		forn(i, sz(v)-1){
			forr(j, v[i], v[i+1]) cout << q[j];
			cout << "\n";
		}
	}
	return 0;
}

// read the question correctly (ll vs int)

#pragma warning (disable : 4996)
#include <stdio.h>
#include <string.h>

int aa();

int k;
char str[101] = { 0, };
char start[26] = { 0, };

void main(){
	int i;
	int flag = 0;
	scanf("%d", &k);
	scanf("%s", str);
	for (i = 0; str[i] != NULL; i++){
		start[str[i] - 97] = 1;
	}
	if (aa() >= k){
		printf("YES");
		flag = 1;
	}
	else printf("NO");
	if (flag == 1){
		int lineNum = 0;
		for (i = 0; i < 100 && str[i] != NULL; i++){
			if (start[str[i] - 97] == 1 && lineNum < k){
				printf("\n");
				start[str[i] - 97] = 0;
				lineNum++;
			}
			printf("%c", str[i]);
		}
	}
	printf("\n");
}

int aa(){
	int i;
	int num = 0;
	for (i = 0; i < 26; i++){
		if (start[i] == 1) num++;
	}
	return num;
}

#include<stdio.h>
#include<string.h>

int k,len,sum;
int ha[27],ans[27];
char se[107];

int main()
{
        int i,j,t;
        while(scanf("%d",&k)!=EOF)
        {
                scanf("%s",se);
                memset(ha,0,sizeof(ha));
                sum=0;j=0;
                len=strlen(se);
                for(i=0;i<len;i++)
                {
                        if(ha[se[i]-'a']==0)
                        {
                                sum++;
                                ha[se[i]-'a']=1;
                                ans[j]=i;
                                j++;
                        }
                }
                if(sum>=k)
                {
                        printf("YES\n");
                        ans[k]=len;
                        for(i=0;i<k;i++)
                        {
                                for(t=ans[i];t<ans[i+1];t++)    printf("%c",se[t]);
                                printf("\n");
                        }
                }
                else printf("NO\n");
        }
}

#include <bits/stdc++.h>

using namespace std;
const int N=1e6, INF=1e9;
int pos[N];
int main(){
	fill_n(pos,N, INF);
	int n,cnt=0;
	scanf("%d", &n);
	string s;
	cin>>s;
	for(int i=0; s[i]; i++){
		cnt+=pos[s[i]-'a']==INF;
		pos[s[i]-'a']=min(pos[s[i]-'a'], i);
	}
	sort(pos, pos+N);
	pos[n]=s.size();
	puts(cnt>=n?"YES":"NO");
	for(int i=0; cnt>=n&&i<n; i++){
		int l=pos[i], r=pos[i+1]-pos[i];
		puts(s.substr(l, r).c_str());
	}
	return 0;
}

#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
using namespace std;
int main()
{
    int n,a,l=0,y=0;
    string s,q,w[100],e;
    cin>>n;
    getline(cin,q);
    getline(cin,s);
    int k=s.length();
    for(int i=0;i<k;i++)
    {
        int p=0;
        if((n==1)&&(e.find(s[i])==-1))
        {
            while(i<k)
            {
                w[l]+=s[i];
                y=1;
                i++;
            }
            break;
        }
        if((i==0)||((s[i]!=s[i-1])&&(n>1)&&(e.find(s[i])==-1)))
        {
            w[l]+=s[i];
            e+=s[i];
            n--;
            l++;
            p=1;
        }
        if((n>=1)&&(p==0))
        {
            w[l-1]+=s[i];
        }

    }
    if(y==1)
    cout<<"YES\n";
    else
    {
        cout<<"NO\n";
        return 0;
    }
    for(int i=0;i<=l;i++)
    {
        cout<<w[i]<<endl;
    }

    return 0;
}

#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#include <utility>
#include <fstream>
#include <climits>
#include <cstring>
#include <cstdio>
using namespace std;
string q, s[30];

int main(){
	long long int n, k, i, a, ans, c1, c2, c3, tmp, j, l;
	bool flag, alp[26];
	memset(alp, false, sizeof alp);
	char ts;
	cin >> k;
	cin >> q;
	if(k==1){
		cout << "YES" << endl;
		cout << q ;
		cout << endl;
		return 0;
	}
	n = q.length();
	if(k>n){
		cout << "NO" << endl;
		return 0;
	}
	flag = false;
	j = 0;
	a = 0;
	alp[q[0]-'a']=true;
	ans = 1;
	a = 0;
	for(i=0; i<n; i++){
		if(alp[q[i]-'a']==false){
			alp[q[i]-'a']=true;
			ans++;
			s[j].append(q, a, i-a);
			a = i;
			j++;
		}
		if(ans==k){
			flag = true;
			s[j].append(q, a, n-a);
			break;
		}
	}
	if(!flag)	cout << "NO" << endl;
	else{
		cout << "YES" << endl;
		for(i=0; i<k; i++){
			cout << s[i] ;
			cout << endl;
		}
	}
	return 0;
}

#include <bits/stdc++.h>
char s[100000],flag[30];
int a[30],n,h1,h2,len;
int main(){
    while(scanf("%d",&n)!=EOF){
        scanf("%s",s);
        h1=0;
        memset(flag,0,sizeof(flag));
        len=strlen(s);
        for(int i=0;i<len;i++){
            h2=s[i]-'a';
            if(flag[h2])    continue;
            flag[h2]=1;
            a[h1++]=i;
        }
        a[h1]=len;
        if(n==1){
            printf("YES\n");
            printf("%s\n",s);
            continue;
        }
        if(n>h1){
            printf("NO\n");
            continue;
        }
        printf("YES\n");
        for(int i=0;i<n-1;i++){
            for(int j=a[i];j<a[i+1];j++)    putchar(s[j]);
            putchar('\n');
        }
        for(int i=a[n-1];i<len;i++) putchar(s[i]);
        putchar('\n');
    }
    return 0;
}

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    char c[110];
    int a,i;
    while(scanf("%d", &a) == 1)
    {
        string s[30];
        map<char,int>mnmy;
        scanf("%s",c);
        int len = strlen(c),p=0,flag = 0;

        for(i = 0; i < len && p < a-1; i++)
        {
            char x = c[i];
            mnmy[x] = 1;
            if(mnmy[c[i]] == 1)
                while(mnmy[c[i]] == 1)
                {
                    s[p]+=c[i];
                    i++;
                }
            i--;
            p++;
        }
        if(flag == 0)
        {
            if(mnmy[c[i]] != 1)
            for(int j = i; j < len; j++)
            s[p]+=c[j];
        }

        if(s[p] == "")
            printf("NO\n");
        else
        {
            printf("YES\n");
            for(i = 0; i <= p; i++)
                cout<<s[i]<<endl;
        }
    }
    return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int k;
    string q, s = "";
    cin>>k>>q;

    for(int i=0; i<q.length();i++)
    {
        if(s.find(q[i])>=s.length())
            s+=q[i];
    }

    if(s.length()>=k)
    {
        cout<<"YES"<<endl;
        for(int i=0; i<k; i++)
        {
            if(i==k-1)
            {
                cout<<q.substr(q.find(s[i]), q.length())<<endl;
            }
            else
            {
                cout<<q.substr(q.find(s[i]), q.find(s[i+1])-q.find(s[i]))<<endl;
            }

        }
    }
    else
    {
        cout<<"NO"<<endl;
    }

}

#include <bits/stdc++.h>
#define NN 1001
using namespace std;
char str[NN];
int id[30], idd[30];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
//	freopen("out.out", "w", stdout);
#endif
	int k;
	scanf("%d", &k);
	cin>>str;
	int L = strlen(str);
	int cnt = 0;
	for(int i = 0; i < L; i++){
		if(id[str[i] - 'a'] == 0) {
			id[str[i] - 'a']++;
			cnt++;
		}
	}
	if(cnt < k) {
		puts("NO");
		return 0;
	}
	puts("YES");
	if(k == 1) {
		cout<<str<<endl;
		return 0;
	}
	int m = 1, i;
	cout<<str[0];
	idd[str[0] - 'a'] = 1;
	for(i = 1; i < L; i++){
		if(idd[str[i] - 'a']) {
			cout<<str[i];
			continue;
		}
		cout<<endl;
		if(m == k - 1) break;
		cout<<str[i];
		idd[str[i] - 'a']++;
		m++;
	}
	for (; i < L; i++){
		cout<<str[i];
	}
	cout<<endl;
	return 0;
}

#include<stdio.h>
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
const int maxn=110;
int n,tot;
char s[maxn],ans[maxn][maxn],len[maxn];bool f[maxn];
int main()
{
	scanf("%d",&n);
	scanf("%s",&s);
	int i=0;
	for(;i<strlen(s);)
	{
		if(!f[s[i]-'a'])
		{
		//	printf("aaaaa %c\n",s[i]);
			f[s[i]-'a']=1;
			tot++;ans[tot][len[tot]++]=s[i];
			while(f[s[++i]-'a'])
			{
				ans[tot][len[tot]++]=s[i];
				//printf("bbb %c\n",ans[tot][len[tot]]);
			}

		}
		if(tot==n)break;
	}
	if(tot==n)
	{
		printf("YES\n");
		for(int j=1;j<n;++j)
		{
			printf("%s\n",ans[j]);
		}
		printf("%s",ans[n]);
		for(;i<strlen(s);++i)
		{
			printf("%c",s[i]);
		}
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}

#include <iostream>
#include <vector>
#include <set>
#include <string>
using namespace std;

int main (){
	int k; cin >> k;
	string s; cin >> s;
	set <char> st;
	st.insert(s[0]);
	std::vector<int> index;
	index.push_back(0);
	int c = 1;
	for(int i = 1; i < s.size();  i++){
		if(c == k)
			break;
		int flag = 0;
		set<char>::iterator it = st.begin();
		while(it != st.end()){
			if(s[i] == *it){
				flag = 1;
				break;
			}
			it++;
		}
		if(flag == 0){
			index.push_back(i);
			st.insert(s[i]);
			c ++;
		}
		if(c == k)
			break;
	}
	if(c < k){
		cout << "NO" << endl;
	}
	else{
		cout << "YES" << endl;
		for(int i = 0; i < index.size(); i++){
			if(i == index.size()-1){
				for(int j = index[i]; j < s.size(); j++)
					cout << s[j];
				cout << endl;
				break;
			}
			for(int j = index[i]; j < index[i+1] ; j++)
				cout << s[j];
			cout << endl;
		}
	}
	return 0;
}

#include <bits/stdc++.h>
#define pi acos(-1)
#define sz(x) (int) x.size()
#define pii pair<int, int>
#define mii map<int, int>
#define vi vector<int>
#define mp make_pair
#define pb push_back
#define popb pop_back
#define mset(v, x) memset(v, x, sizeof(v))
#define mset2d(v, x, n) memset(v, x, sizeof(v[0][0]) * n * n)
#define mset2dd(v, x, n, m) memset(v, x, sizeof(v[0][0]) * n * m)
#define debug(x) cout<<#x<<" : "<<x<<endl
#define debug2(x,y) cout<<#x<<" : "<<x<<" & "<<#y<<" : "<<y<<endl
#define test() cout<<"hola papa"<<endl
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;

int k;
string s;

int main() {
	ios::sync_with_stdio(false);
	while (cin >> k >> s) {
		if (k > sz(s)) {
			cout << "NO" << "\n";
		} else if (k == 1){
			cout << "YES" << "\n";
			cout << s << "\n";
		} else {
			vector<bool> v(30, 0);
			vector<string> ans;
			int cont = 0;
			string aux = "";
			aux += s[0], v[s[0] - 'a'] = 1;
			for (int i = 1; i < sz(s); ++i) {
				if (cont < k - 1) {
					if (v[s[i] - 'a']) {
						aux += s[i];
					} else {
						ans.pb(aux);
						aux = "", aux += s[i], ++cont;
						v[s[i] - 'a'] = 1;
						if (i + 1 == sz(s)) ++cont, ans.pb(aux);
					}
				} else {
					aux += s[i];
					if (i + 1 == sz(s)) ++cont, ans.pb(aux);
				}
			}
			if (cont == k) {
				cout << "YES" << "\n";
				for (int i = 0; i < sz(ans); ++i) {
					cout << ans[i] << "\n";
				}
			} else {
				cout << "NO" << "\n";
			}
		}
	}
}

//in the name of god
//Ln (x) dx
#include<iostream>
#include<limits.h>
#include<algorithm>
#include<utility>
#include<set>
#include<queue>
#include<deque>
#include<map>
#include<iterator>
#include<vector>
#include<string>
#include<string.h>      //for memset()
#include<cmath>
#include<bitset>
//#include<bits/stdc++.h>

#define sysp system("pause");
#define SYSP system("pause");
#define size_t long long

//#define ll int
#define ll long long

//#define INF INT_MAX
#define INF 99999

#define V ((int)1e5)

using namespace std;

int main()
{
    //while (1)
    {
        int k;
        vector <int>v;
        string s;

        cin >> k >> s;

        string ss = s;

        for (size_t i = 0; i < ss.size()-1; i++)
        {
            for (size_t j = i+1; j < ss.size(); j++)
            {
                if (ss[i]==ss[j])
                {
                    ss[j] = '?';
                }
            }
        }

        int cnt = 0;

        for (size_t j = 0; j < ss.size() && cnt < k; j++)
        {
            if (ss[j] - '?')
            {
                int find = s.find(ss[j]);
                if (find + 1)
                {
                    v.push_back(find);
                    cnt++;
                }
            }
        }

        v.push_back(s.size());

        if (cnt != k)
        {
            cout << "NO\n";
        }

        else
        {
            cout << "YES\n";

            sort(v.begin(), v.end());

            if (v[0])
            {

            }

            for (size_t j = 0; j < v.size() - 1; j++)
            {
                cout << s.substr(v[j], v[j + 1] - v[j]) << endl;
            }

        }
    }

    //sysp
}

#include<iostream>
using namespace std;
int n , ar[26] , c;
string s;
int main()
{
	cin >> n >> s;
    for(int i = 0 ; i < s.size() ; i++)
       ar[s[i]-'a']++;
    for(int i = 0 ; i < 26 ; i++)
        if(ar[i] != 0)
           c++;
    if(c < n)
    	cout <<"NO";
    else
    {
    	cout <<"YES";
    	for(int i = 0 ; i < s.size() ; i++)
    	{
    		if(ar[s[i]-'a'] && n!=0)
    		{
    			cout << endl << s[i];
    			ar[s[i]-'a'] = 0;
    			n--;
    		}
    		else
    		   cout << s[i];
    	}
    }
}

//#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<math.h>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<utility>
#include<iterator>
#include<iomanip>
#include<stdlib.h>
#include<numeric>
#include<sstream>
#include<fstream>

using namespace std;

#define R_(s)        freopen(s, "r", stdin)
#define W_(s)        freopen(s, "w", stdout)
#define R_W          R_("input.txt"),W_("output.txt")

#define all(v)             v.begin(),v.end()
#define sz(v)            ((int)((v).size()))
#define psh(x)                  push_back(x)
#define sc(x)                 scanf("%d",&x)
#define sc2(x,y)         scanf("%d%d",&x,&y)
#define rep(i, v)       for(int i=0;i<sz(v);++i)
#define lop(i,n)        for(int i=0;i<n;++i)
#define lop1(i,n)       for(int i=1;i<=n;i++)
#define loop(i,l,r)     for(int i=l;i<r;++i)

#define isodd(x) (x&1)
#define iseven(x) (!(x&1))

#define PI           acos(-1)
#define INF             1<<30
const int mod = 1000000007;

typedef string            ss;
typedef long long int    ll;
typedef pair <int, int>  ii;
typedef pair<ss, int>     si;
typedef pair<int, ss>     is;
typedef pair<char, int>  chi;
typedef pair<ss, ss>     pss;
typedef vector<ii>       vii;
typedef vector<int>       vi;
typedef vector<vi>       vvi;
typedef vector<ss>        vs;
typedef vector<ll>       vll;
typedef vector<vll>     vvll;

ll pw(ll b, ll p){ if (!p) return 1; ll sq = pw(b, p / 2); sq *= sq; if (p % 2) sq *= b; return sq; }
ll gcd(ll a, ll b)  { return (b == 0 ? a : gcd(b, a % b)); }
ll sd(ll x)  { return x<10 ? x : x % 10 + sd(x / 10); }
ll sq(ll x){ lop(i, x)if ((ll)i*i > x) return (i - 1); return ll(1); }
ll lcm(ll a, ll b){ return ((a*b) / gcd(a, b)); }
ll MODS(ll x, ll y){ while (x < 0) x += y; return x%y; }

char C='.'; bool flag = false;
int  n, m = 0, k = 0, ans = 0;
int x = 0, y = 0, z = 0, MAX = 0, MIN = INF; string str, str1, str2;
int a[1000000], b[1000000];

map<char, string> mapy;
set<string> s;
vs v;
set<string>::iterator st;
map<char, pair<string,int>>::iterator it;
int main()
{
    cin >> k; cin >> str; n = sz(str); if (k == 1)return cout << "YES\n" << str << endl, 0; mapy['.'] = "";
    lop(i, n)
    {
        if (mapy.count(str[i]) == 0 && x < k)
        {
            v.push_back(mapy[C]);
            mapy[str[i]] = str[i];
            x++;
            C = str[i];
        }
        else
        {
            mapy[C] = mapy[C] + str[i];
        }
    }
    v.push_back(mapy[C]);
    if (mapy.size() < k+1)return puts("NO");
    puts("YES");
    lop1(i,k)
    {
        if (i!=0)
        cout << v[i] << endl;
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
void main(){
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
	int k,count=0,i,j,flag,b[101],l;
	char s[101];
	scanf("%i",&k);
	scanf("%s",&s);
	for (i=0;i<strlen(s);i++){
		flag=0;
		for (j=0;j<count;j++)
			if (s[i]==s[b[j]]){
				flag=1;
				break;
			}
		if (flag==0){
			count++;
			b[count-1]=i;
			if (count==k){
				b[k]=strlen(s);
				printf("YES");
				for (j=0;j<k;j++){
					printf("\n");
					for (l=b[j];l<b[j+1];l++)
						printf("%c",s[l]);
				}
			return;
			}
		}
	}
	printf("NO");
}

#include<bits/stdc++.h>
using namespace std;
bool a[30];
int main(){
    string q;
    int k;
    cin>>k>>q;
    int ans=0;
    for(int i=0;i<q.size();i++)if(!a[q[i]-'a']){ans++;a[q[i]-'a']=1;}
    if(ans<k){cout<<"NO";return 0;}cout<<"YES\n";memset(a,0,sizeof(a));
    a[q[0]-'a']=1;cout<<q[0];ans=0;for(int i=1;i<q.size();i++){
    if(!a[q[i]-'a']&&ans<k-1){ans++;cout<<endl;a[q[i]-'a']=1;}cout<<q[i];
    }
}

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cstdio>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <set>

using namespace std;

int main()
{
    int k;
    cin >> k;
    string s;
    cin >> s;

    vector<string> ans;
    int j = 0, i = 0;
    set<char> v;

    while (i < s.size())
    {
        string tmp = "";
        tmp += s[i];
        v.insert(s[i]);
        j = i + 1;

        while (j < s.size() && v.find(s[j]) != v.end())
        {
            tmp += s[j];
            j++;
        }

        ans.push_back(tmp);
        i = j;
    }

    if (ans.size() >= k)
    {
        cout << "YES" << endl;
        int t = ans.size() - k + 1;
        int p = 0;
        string r = "";

        for (; p < t; ++p)
        {
            r += ans[p];
        }

        cout << r << endl;

        for (; p < ans.size(); ++p)
            cout << ans[p] << endl;
    }
    else
    {
        cout << "NO" << endl;
    }

}

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cstdio>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <set>

using namespace std;

int main()
{
    int k;
    cin >> k;
    string s;
    cin >> s;

    vector<string> ans;
    int j = 0, i = 0;
    set<char> v;

    while (i < s.size())
    {
        string tmp = "";
        tmp += s[i];
        v.insert(s[i]);
        j = i + 1;

        while (j < s.size() && v.find(s[j]) != v.end())
            tmp += s[j++];

        ans.push_back(tmp);
        i = j;
    }

    if (ans.size() >= k)
    {
        cout << "YES" << endl;
        int t = ans.size() - k + 1;
        int p = 0;
        string r = "";

        for (; p < t; ++p)
            r += ans[p];

        cout << r << endl;
        for (; p < ans.size(); ++p)
            cout << ans[p] << endl;
    }
    else
    {
        cout << "NO" << endl;
    }

}

#include <bits/stdc++.h>
using namespace std;
string sub[105];
bool vis[128];
int main()
{
    int k;
    string s;
    cin >> k >> s;
    if(k == 1)
        cout << "YES\n" << s << endl;
    else
    {
        int h = 0, pre_pos = 0, len = s.length();
        int i;
        char pre = s[0];
        vis[pre] = true;
        for(i = 1; i < len; i++)
        {
            if(!vis[s[i]])
            {
                vis[s[i]] = 1;
                sub[++h] = s.substr(pre_pos, i-pre_pos);
                pre_pos = i;
                if(h == k - 1) break;
            }
        }
        sub[++h] = s.substr(i,len-i);
        if(h < k)
            cout << "NO" << endl;
        else
        {
            cout << "YES" << endl;
            for(i = 1; i <= h; i++)
                cout << sub[i] << endl;
        }
    }
    return 0;
}
/*2018-02-13 19:19:53.175*/

            #include <bits/stdc++.h>
            #define ll long long int
            #define pb push_back
            #define mp make_pair
            #define SIZE 26

    using namespace std;

     int main(){

        int p,k,i,used[1000];

        set<char>st;

        char c;

    	string s;

    	cin>>k>>s;

    	for(i=0;i<s.size();i++){
    		st.insert(s[i]);
    		}

    	p=st.size();

    	if(p<k){
                cout<<"NO";return 0;
        }
    	cout<<"YES"<<endl;
    	i=0;
    	while(2>1){
                if(i==s.size()){
                    return 0;
        }
    		cout<<s[i];
    		c=s[i];
    		used[s[i]]=1;

    			i++;

    			if(used[s[i]]==0&&k>1){
                        k--;
                cout<<endl;}

    	}

    }

#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <math.h>
#include <vector>
using namespace std;
int main()
{
	int n;
	cin >> n;
	string q;
	cin >> q;
	int m[101] = {0};
	if(q.length() < n)
	{
		cout << "NO";
		return 0;}
	if(n == 1)
	{
		cout << "YES" << endl;
		cout << q;
		return 0;
	}
	int kiek = n-1;
	int skaicius = 0;
	int masyv[27] = {0};
	int pradzia = 0;
	masyv[q[0]-'a']++;
	for(int i = 0; i < q.length(); i++)
	{
		if(masyv[q[i]-'a'] == 0)
		{
			m[skaicius] = i-1;
			kiek--;
			skaicius++;
			masyv[q[i]-'a']++;
		}
		if(kiek <= 0)
		{
			break;
		}
	}
	if(kiek > 0)
	{
		cout << "NO";
		return 0;
	}
	int spausd=0;
	cout << "YES" << endl;
	for(int i = 0; i < skaicius; i++)
	{
		for(int j = spausd; j <= m[i]; j++)
		{
			cout << q[spausd];
			spausd++;
		}
		cout << endl;
	}
	for(int j = spausd; j < q.length();j++)
		cout << q[j];
  return 0;
}

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <stack>
#include <math.h>
using namespace std;
int fu[200]={0};
int xu[110];
int main()
{
    char q[110];
    int lenq,n,k,i,j;
    scanf("%d",&n);
    getchar();
    scanf("%s",q);
    lenq=strlen(q);
    k=0;
    if(lenq>=n)
    {
        j=1;k=1;
        fu[q[0]]++;
        xu[0]=0;
        for(i=1;i<lenq&&j<n;i++)
            if(fu[q[i]]==0)
            {
                fu[q[i]]++;
                xu[j]=i;
                j++;
            }
        if(j!=n)
            k=0;
        else
        {
            xu[n]=lenq;
            printf("YES\n");
            for(j=0;j<n;j++)
            {
                for(i=xu[j];i<xu[j+1];i++)
                    printf("%c",q[i]);
                printf("\n");
            }
        }
    }
    if(k==0)
        printf("NO\n");
    return 0;
}

# include<bits/stdc++.h>
using namespace std;
# define ll long long
# define endl '\n'
#define F(i,a,b) for(ll i=(a);i<(b);i++)
#define vll vector<ll>

void solve(){
	ll n;
	cin >> n;
	vll a(26,0),b;
	string s;
	cin >> s;
	F(i,0,s.size()){
		if(a[s[i]-'a']==0) b.push_back(i),a[s[i]-'a']=1;
	}
	if(b.size()>=n){
		while(b.size()>n) b.pop_back();
		b.push_back(s.size());
		cout << "YES" << endl;
		F(i,0,b.size()-1){
			F(j,b[i],b[i+1]) cout << s[j];
			cout << endl;
		}
	}
	else cout << "NO";
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t=1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<string>
#include<math.h>
#include<climits>
#include<cfloat>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include<iomanip>
#include<list>
#include<stack>
#include<cmath>
#include<cstdio>

using namespace std ;
typedef long long ll;
#define REP(i,start,end) for(ll i = start ; i <end;i++)
#define all_it(v,iter) for(iter = v.begin() ; iter!= v.end() ;iter++)
#define all(v) ((v).begin()),((v).end())

int main(){

    int n ; cin>>n ;

    string s ;
     cin>>s ;
     if (s.size() <n )
         cout<<"NO"<<endl;
     else
     {
         int num = s.size() / n ;
         for(int i = 0 ; i<s.size() ; i+= num){
             cout<<s.substr(i,num)<<endl;
         }
     }
}

#include<bits/stdc++.h>

using namespace std;
int a[100], b[100], n, m;
string s;
main()
    {
	cin >> n;
	cin >> s;
	for(int i = 0; i < s.size() && m < n; i++)
		if(a[s[i]] == 0)
            {
			a[s[i]] = 1;
            b[m++] = i;
            }
	if(m == n)
		cout << "YES\n";
	else
        {
		cout << "NO";
		return 0;
        }
	m = 0;
	for(int i = 0; i < s.size(); i++)
        {
		if(b[m]==i)
            {
			m++;
			cout << "\n";
            }
		cout << s[i];
        }
    }

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

typedef struct ss
{
    int a;
    char b;
}ss;

int main()
{
    int k;
    char a[50];
    int n,f,m,l;
    scanf("%d",&k);
    scanf("%s",a);
    n = strlen(a);
    ss z[200];
    z[0].a = 0;
    z[0].b = a[0];
    m = 1;
    for(int i = 1;i < n;i++){
            f = 1;
        for(int j = 0;j < m;j++){
            if(a[i] == z[j].b){
                f = 0;
            }
        }
        if(f == 1){
            z[m].a = i;
            z[m].b = a[i];
            m++;
        }
    }
    if(k > m){
        printf("NO\n");
        return 0;
    }
    else{
        l = 1;
        for(int i = 0; i < n;i++){
            if(a[i] == z[l].b && l < k)
               printf("\n");
            printf("%c",a[i]);
        }
    }
    return 0;
}

#include <stdio.h>
#include <string.h>
char a[110];
int mark[30];
int main()
{
	// freopen("test.in","r",stdin);
	// freopen("test.out","w",stdout);
	int count=1,i,len,n;
	scanf("%d %s",&n,a);
	len = strlen(a);

	for(i=1;i<len;i++)
	{
		if(a[i]!=a[i-1]&&mark[a[i]='a']==0)
		{
			count++;
			mark[a[i]-'a']=1;
		}
	}
	if(count>=n)
	{
		printf("YES\n");
		for(i=0,count=0;i<len;i++)
		{
			if(i>0&&count<n-1&&a[i]!=a[i-1]&&mark[a[i]-'a']!=2)
			{
				printf("\n");
				count++;
				mark[a[i]-'a']=2;
			}
			printf("%c",a[i]);
		}
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}

/*.."Be not afraid of GROWING slowly, be afraid only of STANDING Still"..*/
#include<bits/stdc++.h>
#define Abhi_921 ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define fi(i,j,n) for(int i=j;i<n;i++)
#define fd(i,j,n) for(int i=j;i>n;i--)
#define print(a,n) for(int i=0;i<n;i++){cout<<a<<' ';}cout<<endl;
#define inp(a) for(int i=0;i<n;i++) {cin>>a;}
#define printe(v) for(auto &i:v){cout<<i<<' ';}cout<<endl;
#define deb(n1) cout<<n1<<endl;
#define pb push_back
#define eb emplace_back
#define vi vector<ll>
#define vll vector<pair<ll,ll>>
#define umap unordered_map<ll,ll>
using namespace std;
const long long mod=1e9+7;
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll mod_exp(ll x, ll y,ll p){ll res = 1;x = x % p;while(y>0){if(y&1)res = (res*x) % p;y = y>>1;x=(x*x)%p;}return res;}
int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
Abhi_921;
int t;
cin>>t;
while(t--){
int k;
cin>>k;
string s;
cin>>s;
set<char> sk;
fi(i,0,s.size()) sk.insert(s[i]);
if(sk.size()<k) {cout<<"NO"<<endl;return 0;}
sk.clear();
int d=0;
cout<<"YES";
fi(i,0,s.size()){
    sk.insert(s[i]);
    if(sk.size()>d && d<k){
        d++;
        cout<<endl;
    }
    cout<<s[i];
}
}
return 0;
}

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<math.h>
#include<conio.h>

using namespace std;
int a[27];

void main ()

{
   int k, dif = 0;
   cin >> k;
   string q;
   cin >> q;
   if (k==1) {cout <<"YES"<<endl; cout << q; return;}

   int len = q.length();
   for(int i=0;i<len;i++)
   {
        a[q[i]-97] = 1;
   }
   for(int j=0;j<27;j++) {if (a[j]==1)  dif++;}

   if (dif<k) {cout <<"NO"; return;}
   else cout <<"YES"<<endl;

   for(int j=0;j<27;j++) a[j]=0;

   int start = 0, next = 0;
   int printed = 0;
   while(printed!=k)
   {
       a[q[start]]=1;
       while (next < len && a[q[next]]==1) next++;

        if (printed!=k-1) cout << q.substr(start,next-start)<<endl;
        else cout << q.substr(start);

        start = next;
        printed++;
   }

}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int total=0, len, i, K, nPerIndex[256] = {0};
	string str;

	cin >> K;
	cin >> str;
	len = str.length();

	for (i=0; i<len; i++){
		nPerIndex[ str[i] ]++;
	}
	for (i=0; i<256; i++){
		total += nPerIndex[i];
        if (nPerIndex[i] != 0){
			nPerIndex[i] = 0;
        }
	}
	if (total < K){
		cout << "NO\n";
	}

	cout << "Yes";
	for (i=0; i<len; i++){

		if (nPerIndex[ str[i] ]==0 && K!=0){
			K--;
			nPerIndex[ str[i] ]++;
			cout << "\n";
		}
		cout << str[i];
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){

    int k,z=0,flag=0;cin>>k;string q;cin>>q;
    int p=k;
    vector<char> s;vector<int> a;
    s.push_back(q[0]);
    a.push_back(0);
    if(k>q.size()) cout<<"NO"<<endl;
    else{
        for(int i=1;i<q.size();i++){
            if(k<2) break;
            else if(i==q.size()-1){  flag=1;break;   }
            else{
               if(find(s.begin(),s.end(),q[i])==s.end()){
                    s.push_back(q[i]);
                    k-=1;
                    a.push_back(i);
               }
            }
        }
        if(flag==1) cout<<"NO"<<endl;
        else{
        for(int i=0;i<q.size();){
            z=0;
            if(k<=p-1){
                for(int j=i;j<a[k];j++){    cout<<q[j];z+=1;    }
                k+=1;
                i+=z;
                cout<<endl;
            }
            else if(k==p){
                for(int j=i;j<q.size();j++){   cout<<q[j];}
                cout<<endl;
                break;
            }
        }
        }
    }
    return 0;
}

#include<iostream>
using namespace std;
int k,n,i,j;
main(){
	string s;
	cin>>k;
	cin>>s;
	n=s.size();
	if(n/k==0){cout<<"NO"; return 0;}
	cout<<"YES"<<endl;
	for(i=0;i<n;i++){
		cout<<s[i];
		while(j<k-1){cout<<s[i]<<endl; j++;}}}

//============================================================================
// Name        : ramadan2515
// Author      : Mohamed Ahmed Ramadan
// Version     :
// Copyright   : Your copyright notice
// Description :  C++,
//============================================================================

#include <bits/stdc++.h>
#define fore(i,n) for(long long i = 0; i< n ; i++ )
#define lop(i,n) for(long long i = 1 ; i<=n ; i++ )
#define ops(i,n) for(long long  i = n-1 ; i>=0 ; i-- )
#define MAX 100001
#define MAXI 10000000
#define r(input) freopen("input.in","r",stdin)
#define w(output) freopen("output.out","w",stdout)

using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
typedef pair<long long,long long>pll;
typedef vector<int> vi;
typedef vector<ll> vll;

int main(){
    //freopen("output.txt","w",stdout);
    ll n;
    string s;
    cin >> n;
    n--;
    cin >> s;
    if(n>=s.size()){
        cout << "NO";
        return 0;
    }
    string k[1000];
    int i;
    int counter=0;
    for( i=0;i<n;i++){
        char c =s[i];
        k[counter]+=s[i];
        int j=i;
        while(c==s[i+1]){
            k[counter]+=s[i+1];
            i++;
        }
        counter++;
    }
    if(n+1>counter+1){
        cout << "NO";
        return 0;
    }
    cout << "YES"<<endl ;
    fore(g,counter){
        cout << k[g] <<endl;
    }
    for(;i<s.size();i++){
        cout << s[i];
    }
}

#include <iostream>
#include <string>
using namespace std;
int arr[27];
int t[27];
int main()
{
    int k;
    cin >> k;
    string str;
    cin >> str;

    int n = str.length();
    //cout << "n: " << n << endl;
    for(int i = 0 ; i < n ; i++)
        t[i] = -1;

    int flag = 0;
    int count = 1;
    t[0] = 0;

    if(k == 1)
    {
        cout << "YES" <<endl;
        cout << str << endl;
        return 0;
    }

            int temp = (int)str[0] - 97;
    //cout << temp <<endl;
    arr[temp]++;
    int for_t = 1;

    for(int i = 1 ; i < n  ; i++)
    {
        temp = (int)str[i]-97;
        if(arr[temp] == 0)
        {
            count++;
            t[for_t++] = i;
            arr[temp]++;
            if( count == k)
            {
                flag = 1;
                break;
            }
        }
    }
    //cout << count <<" "<<k<<endl;
    if(flag == 1 || count == k)
    {
        cout << "YES" <<endl;
        int i = 0 ;
        while(t[i+1] != -1)
        {
            for(int j = t[i] ; j < t[i+1] ; j++ )
                cout << str[j];
            cout <<endl;
            i++;
        }
        if(t[i] != -1)
        {
            for(int j = t[i] ; j < n ; j++ )
                cout << str[j];
            cout << endl;
        }
    //  cout << count << endl;
    }
    else
        cout << "NO" << endl;

}

#include<iostream>
#include<string.h>
using namespace std;
int main(){
	char a[100],x;
	int k,l,n=0;int i=0;
	cin>>k;
	cin>>a;
	l=strlen(a);
	while(i<l){
		x=a[i];i++;
		while(x==a[i])i++;
		n++;
	}
	if(n>=k){
		cout<<"YES"<<endl;
		n=0;i=0;
	}else
	{
		cout<<"NO";
		return 0;
	}
	while(i<l){
		x=a[i];n++;
		cout<<a[i];
		i++;
		while(x==a[i])
		{cout<<a[i];
		i++;
		}
		if(n==k)break;
		cout<<endl;
	}
	for(int j=i;j<l;j++)
	cout<<a[j];

}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1ll<<60;
int main()
{
    ll n;
    string s;
    cin>>n;
    cin>>s;
    ll len=s.length();
    if(len%n==0)
    {
        ll t=len/n;
        cout<<"YES"<<endl;
        ll j=0;
        ll m=t;
        for(ll i=0;i<n;i++)
        {
            for(;j<m;j++)
            {
                cout<<s[j];
            }
            cout<<endl;
            m+=t;
        }
    }
    else cout<<"NO"<<endl;
    return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main()
{
	int i,k,sh=0,counter=0;
	char obvious[600];
	string q,s[27];
	cin>>k>>q;
	bool ta=false;
	for (int j=0; j<q.size(); j++)
	{
		for (i=0; i<k; i++)
		{
			if (q[j]==obvious[i])
			{
				ta=true;
				break;
			}
		}
		if (ta==false)
		{
			obvious[counter]=q[j];
			counter++;
		}
		ta=false;

	}
	if (counter<k)
	{
		cout<<"NO";
		return 0;
	}
	cout<<"YES"<<endl;
	counter=1;
	for (int i=0; i<q.size(); i++)
	{
		cout<<q[i];
		if (q[i+1]==obvious[counter] && counter!=k)
		{
			cout<<" ";
			cout<<endl;
			counter++;
		}
	}
	cin>>sh;
	return 0;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<map>
#include<set>
using namespace std;

int main(){

    int n;
    string q;
    cin>>n>>q;
    if(n>q.size())cout<<"NO"<<endl;
    else {
        cout<<"YES"<<endl;
        int r=0;
        int w=q.size()-n;
        for(r=0;r<=w;r++){
            cout<<q[r];
        }
        cout<<endl;
        if(r<q.size()){
            for(r=w+1;r<q.size();r++)
                cout<<q[r]<<endl;

        }

    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
int x;
cin>>x>>s;
    int y=0,z=0,cnt=1,dnt=0,a=s.size(),d=0;
    string g[x];
    char c[x];
    c[0]=s[0];

        for(int i=0;i<a;i++){
            if(s[z]==s[i]){
                g[y]+=s[i];
            }
            else if(s[z]!=s[i]){
                    y++;
                    cnt++;
                for(int v=0;v<y;v++){
                    if(s[i]==c[v]){
                        y--;
                        cnt--;
                        break;
                    }
                    else{
                        dnt++;
                    }
                }
                if(y>=x){
                    y=x-1;
                    cnt=x;
                    z=a;
                }
                 g[y]+=s[i];
                 if(dnt==y){
                    c[y]=s[i];
                    z=i;
                 }
                 dnt=0;
            }
        }
    for(int i=z;i<a-1;i++){
        g[y]+=s[i];
    }
    if(cnt>=x){
    cout<<"YES"<<endl;

    for(int i=0;i<x;i++){
        cout<<g[i]<<endl;
    }
    }
    else{
        cout<<"NO"<<endl;
            for(int i=0;i<x;i++){
        cout<<g[i]<<endl;
    }
    }
}

//2015.06.01
//박상준
//codeforce_302_div2_A.cpp

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n = 0;
    char q[101];
    cin >> n;
    cin.ignore();
    cin.getline(q, 100);

    bool check[26] = { false }; //알파벳이 나왔었는지 체크
    int position[26];
    int count = 0;  //지금까지 나온 알파벳의 종류를 기억

    //cout << strlen(q) << endl;
    //나눠야 하는 수가 입력받은 전체 글자수보다 많을 때
    if ((unsigned int) n > strlen(q))
    {
        cout << "NO" << endl;
        return 0;
    }
    //n==1 일 때, 무조건 가능
    else if (n == 1)
    {
        cout << "YES" << endl;
        cout << q << endl;
        return 0;
    }

    //체크 시작
    for (int i = 0; i < 100; ++i)
    {
        //나오지 않은 알파벳이면 check 배열에 그 알파벳이 나온 위치를 저장.
        if (check[q[i] - 97] != true)
        {
            check[q[i] - 97] = true;
            position[count] = i;
            ++count;
        }

        //n만큼 서로 다른 알파벳을 찾았으면 루프를 빠져나온다.
        if (count == n) break;
    }
    position[count] = strlen(q) + 1;

    //충분한 종류의 알파벳이 없는 경우
    if (count < n+1)
    {
        cout << "NO" << endl;
    }
    //충분한 종류의 알파벳을 찾은 경우
    else
    {
        cout << "YES" << endl;
        char temp[100];
        for (int i = 0; i < count-1; ++i)
        {
            strncpy_s(temp, &q[position[i]], position[i + 1] - position[i]);
            cout << temp << endl;
        }
    }
    return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
	int k;
	scanf("%d", &k);
	char s[30];
	int a[30] = { 0 };
	scanf("%s", s);
	for (int i = 0; s[i]!='\0'; i++)
	{
		a[s[i] - 'a'] ++;
	}
	int sum = 0;
	int count = 0;
	for (int i = 0; i < 26; i++)
	{
		if (a[i] > 0) sum++;
	}
	if (sum < k)
		printf("NO");
	else
	{
		printf("YES");
		for (int i = 0; i < strlen(s); i++)
		{
			if (a[s[i] - 'a'] > 0 && count < k)
			{
				printf("\n");
				a[s[i] - 'a'] = 0;
				count++;
			}
			printf("%c", s[i]);
		}
	}
	return 0;
}

#include <iostream>
#include<vector>
#include <cmath>

using namespace std;

vector < string > s;
bool occurance[128] = { 0 };

void fun(string q, unsigned int k)
{
	int div = ceil(q.size() / (float)k), add = 0, i = 0;

	if (k - s.size() == 1)
		s.push_back(q.substr(i));
	else
	{
		for (add = 0; add < q.size(); add++)
		{
			occurance[q[i]]=true;
			if ( occurance[q.substr(i, div+add+1)[q.substr(i, div+add+1).size()-1]] != true )
			{
				s.push_back(q.substr(i, div + add));
				occurance[q.substr(i, div + add)[0]] = true;
				fun(q.substr(i + div + add), k);
				break;
			}
		}
	}

}

int main()
{
	string q;
	unsigned int k;
	cin >> k >> q;

	if (k > q.size())
		cout << "NO";
	else if (k == 1)
	{
		cout << "YES" << endl << q;
	}
	else
	{
		fun(q, k);
		if (s.size() < k)
			cout << "NO";
		else
		{
			cout << "YES" << endl;
			for (int i = 0; i < s.size(); i++)
				cout << s[i] << endl;
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
 int a[256],k,i=1;
 char c;
 string s[100];
int main()
{
  cin>>k>>c;
  s[i]=c;
  a[int(c)]=1;
  while(cin>>c)
  {
    if(a[int(c)]==0&&i<k)
	{
	   	a[int(c)]=1;
	   	i++;
	   	s[i]="";
	}
	s[i]=s[i]+c;
	cout<<i<<" "<<s[i]<<endl;
  }
  if(i>=k)
  {
    cout<<"YES"<<endl;
	for(int j=1;j<=k;j++)
	cout<<s[j]<<endl;
  }
  else
    cout<<"NO";
 return 0;
}

#include<iostream>
#include<string>
#include<algorithm>
#include <vector>
#include <cmath>
using namespace std;

#define mp make_pair

int main()
{
    int k;
    cin >> k;
    string q;
    cin >> q;
    int r(0);
    vector<bool> used(10000000);
    vector<string> ans;
    if (k == 1)
    {
        cout << q << endl;
        return 0;
    }
    if (k > q.size())
    {
        cout << "NO" << endl;
        return 0;
    }
    int y(0);
    for (int i(0); i < k; i++)
    {
        char c = q[y];
        string anss;
        if (!used[q[y]] && i != k - 1)
        {
            while (y != q.size() && q[y] == c)
                anss += q[y++];
            ans.push_back(anss);
        }
        else if (!used[q[y]] && i == k - 1)
        {
            while (y != q.size())
                anss += q[y++];
            ans.push_back(anss);
        }
        else y++;
    }
    if (ans.size() == k && ans[ans.size() - 1] != "")
        cout << "YES" << endl;
    else
    {
        cout << "NO" << endl;
        return 0;
    }
    for (int i(0); i < ans.size(); i++)
        cout << ans[i] << endl;

return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define FF              freopen("input.txt" , "r" , stdin);
#define sf              scanf
#define pf              printf
#define fs              first
#define se              second
#define pb              push_back
#define ins             insert
#define Lb              lower_bound
#define Up              upper_bound
#define INF             (1<<30)
#define mem(a,b)        memset(a, b, sizeof(a))
#define MAX             1000100
#define MAXR            78504
#define MAXC            100010

typedef long long ll;

const double PI = 2.0 * acos(0.0);
const double eps = 1e-9;

template < class T > T Abs(T x) { return x > 0 ? x : -x; }
template < class T > string toString(T n) { ostringstream ost; ost << n; ost.flush() ; return ost.str(); }
template < class T > inline T gcd(T a,T b) { if(a < 0) return gcd(-a,b); if(b < 0)return gcd(a,-b); return (b == 0) ? a : gcd(b ,a % b); }
template < class T > inline T lcm(T a,T b) { if(a < 0) return lcm(-a,b); if(b < 0)return lcm(a,-b); return a * (b / gcd(a , b)); }
template < class T > inline T sqr(T n) { return n * n; }
template < class T > T power(T n, int p)
{
    if(!p) return 1;
    else
    {
        T sum = sqr( power( n ,  p >> 1) );
        if(p & 1) sum =  n;
        return sum;
    }
}

///-------------------------------------------------END---------------------------------------------///
vector < string > ve;
bool is_ok(char ch)
{
    if(ve.size() == 0) return true;
    for(int i = 0 ; i < ve.size() ; ++i)
    {
        if(ve[i][0] == ch) return false;
    }
    return true;
}

int main()
{

    string str , temp = "";
    int n;
    cin >> n  >> str;
    int len = str.length();
    for(int i = 0 ; i < len ; ++i)
    {
        if(ve.size() == n - 1 )
        {
            temp = "";
            for(int j = i ; j < len ; ++j) temp = temp + str[j];
            if(temp.size()) ve.push_back(temp);
            break ;
        }
        if(str[i] != str[i + 1] && is_ok(str[i + 1]))
        {
            temp += str[i];
            if(temp.size()) ve.push_back(temp);
            temp = "";
        }
        else {  temp = temp + str[i]; }
    }
    if(ve.size() == n)
    {
        cout << "YES" << endl;
        for(auto x : ve) cout << x << endl;
    }
    else cout << "NO" <<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
bool book[26];
char a[105];
int main()
{
    int k;
    cin>>k;
    cin>>a;
    for(int i = 0;a[i];i++) book[a[i]-'a'] = 1;
    int cnt = 0;
    for(int i = 0;i < 26;i++)   cnt += book[i];
    if(cnt < k)
    {
        cout<<"NO";
        return 0;
    }
    cout<<"YES"<<endl;
    int index = 0;
    int i = 0;
    for(;a[i];i++)
    {
        if(a[i] == a[index])    cout<<a[i];
        else
        {
            index = i;
            k--;
            if(!k)    break;
            cout<<endl;
            cout<<a[i];
        }
    }
    while(a[i]) cout<<a[i++];
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(int argc, char** argv){
    int k, c = 0;
    bool seen[27];

    string q;
    vector<int> pos;

    cin>>k;
    cin>>q;

    if( k > q.length() ){
        cout<<"NO \n";
        return 0;
    }
    pos.push_back(0);
    seen[ q[0] - 'a' ] = true;
    c++;

    for(int i = 0; i < q.length(); i++ ){
           if( !seen[ q[i] - 'a' ] ){
                seen[ q[i] - 'a' ] = true;
                c++;
                pos.push_back(i);
           }
    }

    pos.push_back(q.length()- 1);

    if(c < k){
        cout<<"NO\n";
        return 0;
    }

    cout<<"YES\n";

        for(int i=0 ; i<pos.size() && i<k ; i++){
            int start = pos[i];
            int final = pos[i+1];
            if(i==k-1) final=q.size();
            for(int j=start ; j<final ; j++){
                cout<<q[j];
            }cout<<endl;
        }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define INF 2000000000
#define For(i, n)\
    for(int i = 0; i <(int)n; i++)

int main()
{
    int t,i,j,k;
    string s;

    cin>>k;
    cin>>s;
    if(k>s.size())
    {
        cout<<"NO"<<endl;
        return 0;
    }
    int a[170];
    memset(a,0,sizeof(a));
    for(i=0;i<s.size();i++)
    {
        if(a[s[i]]==0)
            a[s[i]]=1;
    }

    j=0;
    for(i=0;i<170;i++)
    {
        if(a[i]==1)
            j++;

    }
    if(j<k)
    {       printf("NO\n");
        return 0;
    }
    else
    {
        memset(a,0,sizeof(a));
        if(k==1)
        {
            printf("YES\n");
            cout<<s;
            return 0;
        }
        printf("YES\n");
        printf("%c",s[0]);
        if(s[i+1]!=s[i])
        {
            a[s[i]]=1;

            cout<<endl;
        }
        t=0;

        for(i=1;i<s.size();)
        {
            if(t==k-1)
                break;
            if(a[s[i]]==0)
            {
                a[s[i]]=1;
                printf("%c",s[i++]);
                while(a[s[i]]==1)
                {
                    printf("%c",s[i++]);

                }
                cout<<endl;

                t++;
            }
            else
                i++;
        }
        for(j=i;j<s.size();j++)
            printf("%c",s[j]);
        printf("\n");
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

string input;
bool arr[30];
map<char,int>map1;
int i=0,j,k,c=0;

int main()
{
    //map1.clear();
    //memset( arr,0,sizeof( arr ) );

    scanf("%d\n",&k);
    getline(cin,input);

    while( input[i]!='\0' )
    {
        if( map1[input[i]]==0 )
        {
            ++c;
            //cout<<c<<endl;
            arr[i]=1;
            map1[input[i]]=1;
            if( c>=k )
            break;

        }
        i++;
    }

    if( c<k )
    puts("NO");
    else
    {
        puts("YES");
        for( i=0;input[i]!='\0';i++ )
        {
            if( i!=0 && arr[i]==1 )
            cout<<endl;

            cout<<input[i];
        }
        cout<<endl;
    }

    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

void copy_seg(const string& src, string& dest, int l, int r)
{
    while (l <= r) {
        dest += src[l++];
    }
}

int main()
{
    int k;
    string q;
    cin >> k >> q;

    vector<string> v;

    int len = q.size() / k;

    if ((int)q.size() < k) {
        cout << "NO" << endl;
        return 0;
    }

    vector<int> fchars;

    for (int i = 0; i < k; i++) {
        string buf;

        if (find(fchars.begin(), fchars.end(), (int)q[i * len]) != fchars.end()) {
            cout << "NO" << endl;
            return 0;
        }

        fchars.push_back((int)q[i * len]);

        copy_seg(q, buf, i * len, (i + 1) * len - 1);

        v.push_back(buf);
    }

    cout << "YES" << endl;

    for (int i = 0; i < (int)v.size(); i++) {
        cout << v[i] << endl;
    }

    return 0;
}

#include<bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#define PI  3.1415926535898
#define ll  long long
using namespace std;
int main () {
    int i,j,k,m,n,t;
    int len, res, ans, key, sum;char temp;
    char String[30],String1[30];
    int flag[30];
    while(~scanf("%d",&n)){
        getchar();
        gets (String);
        len = strlen(String);
        if(n > len)
            cout << "NO" << endl;
        else {
            strcpy(String1,String);
            sort(String1,String1 + len );
            temp = String1[0];
            k = 1;
            for(i = 0 ; i < len; i++)
                if(temp != String1 [i] ) {
                    k++;
                    temp = String1[i];
                }
            if(k < n )  cout << "NO" << endl;
            else {
                cout << "YES" << endl;
                memset(flag,0,sizeof(flag));
                putchar(String[0]);

                n--;
                for(i = 1; i < len; i++){
                    if(flag[String[i] - 'a' + 1] == 0 && n != 0) {
                        cout  << endl << String[i] ;
                        n--;
                        flag[String[i] - 'a' + 1] = 1;
                    }
                    else
                         cout << String[i];
                }
                cout << endl;
            }
        }
    }
return 0;
}

//#include <fstream>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>

#define P_ M_PI
#define ff first
#define ss second
#define maxn 100009
#define ll long long
#define pb push_back
#define INF 1000000009
#define ppb() pop_back()
#define pii pair <int , int>
#define mp(x,y) make_pair(x,y)
#define all(x) x.begin(),x.end()
#define LLINF 1000000000000000009
using namespace std;
//ifstream cin("file.in");
//ofstream cout("file.out");
int a;
string s;
vector <int> v;
map <char, bool> mp;
int main()
{
 	//srand( (unsigned)time( NULL ) );
	//int randomNumber = rand() % 10 + 1;
	cin >> a;
	cin >> s;
	a --;
	mp[s[0]] = 1;
	int x = a;
	if(s.size() == 1)
		v.pb(0);
	for(int i = 1; i < s.size(); i++)
	{
		if(mp[s[i]] == 0 and x > 0)
			v.pb(i - 1), x --, mp[s[i]] = 1;
		else if(i == s.size() - 1 and x == 0 and mp[s[i]] == 0)
			v.pb(i), mp[s[i]] = 1;
	}
	int y = 0;
	if(v.size() == a + 1)
	{
		cout << "YES" << endl;
		for(int i = 0; i < v.size(); i++)
		{
			for(int j = y; j <= v[i]; j++)
				cout << s[j];
			y = v[i] + 1;
			cout << endl;
		}
		return 0;
	}
	cout << "NO" << endl;
return 0;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
#include<iomanip>
#include<string>
using namespace std;

int main()
{int i,n,k=0,j=0;
string b[101];
string q,a;
cin>>n>>q;
if(n>q.length()){
	cout<<"NO";
	return 0;}
if(n==1)
{
	cout<<"YES"<<endl<<q;
	return 0;}
b[0]=q[0];
for(i=0;i<q.length()-1;i++)
{
if(q[i]==q[i+1])
	b[j]=b[j]+q[i+1];
else
{j++;
	b[j]=q[i+1];
}}

if(j+1>=n)
{
	cout<<"YES"<<endl;
	for(i=0;i<n-1;i++)
		cout<<b[i]<<endl;

for(i=n;i<=j;i++)
	b[n-1]=b[n-1]+b[i];
cout<<b[n-1];}
else
	cout<<"NO";

	return 0;
}

#include <iostream>
#include <string>
using namespace std;
string s; int k;
int cnt[30], pos[100];
int main()
{
    cin >> k >> s;
    int ca = 0;
    for (int i = 0; i < s.size(); i++)
        if (cnt[s[i]] == 0)
        {
            pos[i] = 1;
            ca++;
            cnt[s[i]] = 1;
        }
    if (ca < k)
    {
        cout << "NO" << endl;
    }
    else
    {
        cout << "YES";
        for (int i = 0; i < s.size(); i++)
        {
            if (pos[i] && k) { printf("\n"); k--; }
            printf("%c", s[i]);
        }
    }
    return 0;
}

#include <iostream>
#include <string>
#include <string.h>
using namespace std ;

int setQ(string q, int len){
    int count =0 ;
    bool set[1000]={0} ;
    for(int i=0 ; i<len ; i++){
        if(set[q[i]]==0){
            set[q[i]]=1 ;
            count++ ;
        }
    }
    return count ;
}

void resetQ(string q,bool reset[], int len){
    for(int i=0 ; i<len ; i++){
        if(reset[q[i]]==1)
            reset[q[i]]=0 ;
    }
}

int main(){
    string q ;
    getline(cin,q);
    int k ;
    cin>>k ;
    int len=0 ;
    while(q[len]!='\0'){
        len++ ;
     }
     int count=setQ(q,len) ;
     bool reset[1000]={1} ;
     if(k>count)
        cout<<"NO"<<endl ;
    else{
        cout<<"YES" ;
        resetQ(q,reset,len) ;
        for(int i=0 ; i<len ; i++){

            if(reset[q[i]]==0 && k!=0){
                reset[q[i]]=1 ;
                cout<<endl ;
                k-- ;
            }
            cout<<q[i] ;
        }
    }
    return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define TEST int t;cin>>t;for(int T=1;T<=t;T++)
#define F first
#define S second
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    map <char, int> mp;
    set <char> st;
    for(int i=0; i<s.size(); i++)
        st.insert(s[i]);
    if(st.size()<n)
        cout << "No" << endl;
    else {
        if(n==1) {
            cout << "Yes" << endl;
            cout << s << endl;
        } else {
            for(int i=0; i<s.size(); i++) {
                if(mp[s[i]]!=1) {
                    if(i!=0)
                        cout << endl;
                    cout << s[i];
                    mp[s[i]]=1;
                } else {
                    cout << s[i];
                }
            }
            cout << endl;
        }
    }
   // main();
}

#include <iostream>

using namespace std;

int main()
{
    int j,i,k=0,w=0,z=0,h=0,a=0;
    cin>>k;
    string s;
    cin>>s;
    if(s.length()>=k)
    {

        for(i=0; i<s.length(); i++)
            for(j=i; j<s.length(); j++)
                if(s[i]!=s[j])
                    w++;
        if(w>=k)
        {

                for(j=0; j<s.length(); j++)
                    if(s[j]!=s[j+1])
                    {

                        for(z=h; z<=j; z++)
                            cout<<s[z];
                             a++;
                            if(a!=k)
                            cout<<endl;
                        h=j+1;

                       if(a==k)
                        {
                            for(z=h; z<s.length(); z++)
                                cout<<s[z];
                                cout<<endl;
                           i=s.length()+1;
                           j=s.length()+1;
                        }

                    }

        }
        else
            cout<<"NO"<<endl;
    }
    else
        cout<<"NO"<<endl;

    return 0;
}

#include <iostream>
#include <string>
#include <string.h>

#define ll long long

using namespace std;
char a[105];
int main()
{
  int k = 0 ;
  cin>>k;
  cin>>a;
  int  x = strlen(a);
  if(k > x){
     cout<<"NO";
     return 0;
  }
  if(k == 1){
     cout<<a;
     return 0;
  }
  char c;
  for(int j = 0 ; j < k-1 ; j++){
          c = a[j];
          cout<<c<<"\n";
 }
 for(int i = k-1 ; i < x ; i++)
    cout<<a[i];

    return 0;
}

/*.......................☺.Abhi_921.☺...............................*/
#include<bits/stdc++.h>
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define fi(i,j,n) for(int i=j;i<n;i++)
#define fd(i,j,n) for(int i=j;i>n;i--)
#define debug(n1) cout<<n1<<endl;
#define pb push_back
#define eb emplace_back
#define vi vector<int>
const long long mod=1e9+7;
using namespace std;
int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
SPEED;
int t;
t=1;
while(t--){
    int n;
    cin>>n;
string s;
cin>>s;
if(n>s.length()) cout<<"NO"<<endl;
else{
int l=n;
int j=0,k=1;
int m=s.length();
while(n-- && m!=0){
    fi(i,j+1,s.length()){
  if(s[j]!=s[i]) {cout<<s.substr(j,i);j=i;cout<<endl;break;}
    }
  m--;
}
}
}
return 0;
}

#include <bits/stdc++.h>
using namespace std;
int arr[26];
int main()
{
    int k,c=0;
    cin>>k;
    string s,s2="";
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        if(arr[s[i]-'a']==0)
        {
            c++;
        }
        arr[s[i]-'a']++;
    }
    if(k>c)cout<<"NO";
    else
    {
        memset(arr,0,sizeof(arr));
        arr[s[0]-'a']=1;
        s2=s[0];
        cout<<"YES"<<endl;
        for(int i=1;i<s.size();i++)
        {
            if(k==1)
            {
                for(int j=i;j<s.size();j++)s2+=s[j];
                cout<<s2;
                break;
            }
            else if(arr[s[i]-'a']==0)
            {
                cout<<s2<<endl;
                s2=s[i];
                arr[s[i]-'a']=1;
                k--;
            }
            else s2+=s[i];
        }
        if(k==1)cout<<s[s.size()-1];

    }
    return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main() {
    int x , c = 0 , j = 0;
    cin >> x ;
    string y , a ; string b[100] ;
    cin >> y ;
    if (y.size()<x){
        cout <<"NO";
        return 0 ;
    }

    for (int i = y.size()-1 ;i>=0 ; i-- ){
        c++;
    if (c==x) break;
    else {b[j]=y[i]; j++; }
    }
    cout << "YES" <<endl;
    for (int i = 0 ; i < y.size()-j ; i++){
        cout << y[i] ;
    }
    cout <<endl;
    for (int i = j-1 ; i >=0 ; i--){
    cout << b[i] <<endl ;
    }

}

#include<cstdio>
#include<cstring>
char a[101];
int n,i,j,k=1,b[28],c[28];
int main(){
    scanf("%d",&n);
    scanf("%s",a);
    b[1]=0;
    c[n]=strlen(a)-1;
    for(i=0;i<strlen(a);i++){
        if(a[b[k]]!=a[i]){
        c[k++]=i-1; b[k]=i;}
        if(k==n) break;
    }
    if(k==n){
        printf("YES\n");
        for(i=1;i<=k;i++){
            for(j=b[i];j<=c[i];j++) printf("%c",a[j]);
            printf("\n");
        }
    }
    else printf("NO");
}

#include<bits/stdc++.h>

using namespace std;

typedef long long           ll;
typedef vector<int>         vi;

#define endl                '\n'
#define fi                  first
#define pf                  printf
#define se                  second
#define MX                  100
#define pb                  push_back
#define DB                  pf("Hi\n")
#define pf1(a)              pf("%d\n",a)
#define sc1(a)              scanf("%d",&a)
#define sz(a)               int((a).size())
#define all(c)              (c).begin(),(c).end()
#define mem(a,b)            memset(a, b, sizeof(a))
#define TC                  int _T;sc1(_T);while(_T--)
#define WR                  freopen("0uput.txt","w",stdout)
#define rep(i,a,b)          for(int i=int(a)-(a>b);i!=(b)-(a>b);i+=1-2*(a>b))

int main()
{
    int n;
    string s;

    cin>>n;
    cin>>s;

    int st = sz(s);

    if(s.size()<n)puts("NO");
    else
    {
        puts("YES");
        for(int i=0; i<st; i++)
        {
            if(n>1)
            {
                cout<<s[i]<<endl;
                s.erase(s.begin());
                n--;
            }
            else
            {
                cout<<s;
                break;
            }
        }
    }
}

#include <iostream>
#include<string>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	int k;
	cin>>k;
	string q;
	cin>>q;
	int len=q.length();
	if(len<k){
	    cout<<"NO\n";
	    return 0;
	}
	else{
	    string s[k+1];
	    int c=0;
	    int i=1,j=0;
	    for(;i<q.size();i++){
	        if(q[i-1]==q[i]){
	           s[j]+=q[i-1];
	        }
	        else {
	            s[j]+=q[i-1];
	            c++;
	            if(c<k){j++;}

	        }
	    }
	    s[j]+=q[i-1];
            int ar[26]={0};
            for(int i=0;i<k;i++){
                if(ar[i]==0){
                    ar[s[i][0]-'a']++;
                }
                else {
                    cout<<"NO\n";
                    return 0;
                }
            }
            cout<<"YES\n";
	    for(int i=0;i<k;i++){
	        for(int j=0;j<s[i].size();j++)
	          cout<<s[i][j];
	        cout<<'\n';
	    }

	}

	return 0;
}

#include <iostream>
#include<vector>
#include<queue>
#include<stack>

using namespace std;

int main()
{
    int k;
    cin>>k;
    string q;
    cin>>q;
    vector<int> tab(k,0);
    vector<int>is(k,0);

    int i=1;
    int j=0;

    if (k>q.length())cout<<"NO"<<endl;
    else
    {

        while((i<=k)&&(j<q.length())){
            is[q[j]-'0']=1;
            tab[i-1]++;
            j++;
            //cout<<j<<endl;
            while((j<q.length())&&(is[q[j]-'0'])){
                tab[i-1]++;
                j++;
            //    cout<<j<<endl;
            }
             //cout<<tab[i-1]<<endl;
            i++;

        }

        if(i<k)
        {
            cout<<"NO"<<endl;
        }else
        {
            cout<<"YES"<<endl;
            while(j<q.length())
            {
                tab[k-1]++;
                j++;
                //cout<<tab[k-1].length()<<endl;
            }
            int h=0;
            for(int l=0;l<k;l++)
            {
                for(int c=0;c<tab[l];c++)
                {
                    cout<<q[h];
                    h++;
                }
                cout<<endl;
            }
        }
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,id,i,in;
string x, k[26];
int main(){
cin>>n>>x;
if(n>x.size()){cout<<"NO"<<endl;return 0;}
   in=x.size()-1;
    for( i=0;i<n-1;i++)
      {k[i]=x[in];in--;}
        id=i;
         while(i!=x.size())
          {k[id]+=x[i];i++;}
           cout<<"YES\n";for( i=0;i<n;i++)cout<<k[i]<<endl;
}

#include<bits/stdc++.h>
using namespace std;
main() {
#ifndef ONLINE_JUDGE
    freopen("1.txt", "r", stdin);
#endif // ONLINE_JUDGE

    int n;
    scanf("%d\n", &n);
    vector<int> p;
    string s;
    getline(cin, s);

    for (int i = 0; i < s.length(); i++)
        if (p.empty() || s[p.back()] != s[i]) {
            p.push_back(i);
        }

    if (p.size() <= n) {
        printf("NO");
        return 0;
    }

    printf("YES");
    vector<char> flag(s.size(), false);

    for (int i = 0; i < n; i++) {
        flag[p[i]] = true;
    }

    for (int i = 0; i < s.length(); i++) {
        if (flag[i]) {
            printf("\n");
        }

        printf("%c", s[i]);
    }

}

#include "stdio.h"
#include "string.h"
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

#define max(a,b) a > b ? a : b
#define min(a,b) a < b ? a : b
#define abs(a)  a < 0 ? a : (-a)
#define Mem(a,b) memset(a,b,sizeof(a))

string s;
int K;
bool visit[26];
int num[28];

void solve()
{
	if( K == 1 ){
		cout<<"YES"<<endl;
		cout<<s<<endl;
		return ;
	}

	int j = 0;

	Mem(visit,false);
	Mem(num,-1);
	visit[s[0]-'a'] = true;
	for(int i = 1; i < s.length(); i ++){
		if( !visit[s[i]-'a'] ){
			visit[s[i] - 'a'] = true;
			num[j++] = i;
			if( j + 1 == K ) break;
		}
		if( i + 1 == s.length() ){
			cout<<"NO"<<endl;
			return;
		}
	}
	cout<<"YES"<<endl;
	for(int i = 0, j = 0; i < s.length(); i ++ ){
		if( i == num[j] ){
			j ++;
			cout<<endl;
		}
		cout<<s[i];
	}
	cout<<endl;

}

int main()
{
	cin>>K;
	cin>>s;
	solve();

}

#include <stdio.h>

int main() {
	int k; scanf("%d", &k);
	char arr[101] = {0}; scanf("%s", arr);
	int used[26] = {0};
	int order[26] = { 0 };

	int i = 0, cnt = 0;
	while (i < 100 && arr[i] != '\n' && arr[i]!=EOF) {
		if (used[arr[i] - 97] == 0 && cnt<k) {
			used[arr[i] - 97] = 1;
			order[cnt] = i;
			cnt++;
		}
		i++;
	}
	order[cnt] = i;

	if (k > cnt) {
		printf("NO");
		return 0;
	}

	printf("YES\n");

	for (int i = 0; i < cnt && i< k; i++) {
		for (int j = order[i]; j < order[i + 1]; j++) {
			printf("%c", arr[j]);
		}
		printf("\n");
	}

	return 0;
}

#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

using ll = long long;

//#define int ll

const int N = 2e5+33, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 1e5 + 11 , T = 2000;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const int LOG = 20;
const double EPS = 1e-4;
const double PI = acos(-1.0);

template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef pair <int, int> pii;        // #include <ext/pb_ds/assoc_container.hpp>
typedef pair <ll, ll> pll;         // #include <ext/pb_ds/tree_policy.hpp>
typedef vector <int> vi;          // #include <ext/rope>
                // #include <ext/rope>
                                 // #include <ext/rope>
bool prime(int n) {             // template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
    for(int i=2;i<=sqrt(n);i++){
        if(n%i==0){return 0;}
    }return 1;}
bool query = 0;
///////////////////////////////////////////////////////////

string p[27];
int u[26];

void solve() {
    int n;
    string s;
    cin >> n >> s;
    int cur = -1;
    for(int i = 0; i < s.size(); i ++) {
        if(u[s[i]-'a'] == 0) {
            cur ++;
            u[s[i]-'a'] = 1;
        }
        p[cur].pb(s[i]);
    }
    if(cur < n) {
        cout << "NO";
        return;
    }
    cout << "YES\n";
    for(int i = 0; i < n-1; i ++) {
        cout << p[i] << '\n';
    }
    for(int i = n-1; i <= 26; i++) {
        cout << p[i];
    }
}
/*
y = kx + l
0 1 2 3 4
2
5

1 2 3 5 1e9

7 7
5 7 3
3 5 3
4 3 3
1 4 2
6 3 2
2 6 1
1 2 1

1 2 3 4
1 2 4 3
1 3 2 4
1 3 4 2
1

1 2 3  4 5 6   7 8
127,321336469
126.687663595

2,414213562
1,931851653

1

1 5 9 10

n
1 2 3 4 5 6 7 8 9

3 6
2 2 2
1x

2 3 1 2 2
1 2 2 2 3

4
6
0*/

main() {
    ios;
    int tt = 1;

    if(query)
        cin >> tt;
    while(tt --) {
        solve();
        cout << '\n';
//        brute();
    }
    return 0;
}
/*
++>
+++>
<[<+>-]<
++++++++++++++++++++++++++++++++++++++++++++++++.

500000000000000000000000000000000000000000000000

1 1 2 3 6

*/

#include <bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define mk make_pair
#define pb push_back
#define pp pop_back
using namespace std;
string s , s1[12345] ;
int n , c , j ;
map<char,bool> mp ;
set<char> ss ;
int main ()
{
    cin >> n >> s ;
    if ( s.size() < n )
    {
        cout << "NO" ; return 0 ;
    }
    for ( int i = 0 ; i < s.size() ; ++i )
    {
        ss.insert(s[i]) ;
    }
    if ( n > ss.size() )
    {
        cout << "NO" ; return 0 ;
    }
    cout << "YES" <<endl ;
    cout << s[0] ;
    for ( int i = 1 ; i < s.size() ; ++i )
    {
        if ( s[i] == s[i-1] )
        {
            cout << s[i] ;
        }
        else if ( c < n )
        {
            if ( c == n - 1 )
            {
                cout << s[i] ;
            }
            else
            {
                cout << endl ;
                c++ ;
                cout << s[i] ;
            }
        }
    }
}

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <ctime>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <cstdlib>

inline int Rand(){ return (rand() << 16) | rand();}
#define fi first
#define se second
#define mp make_pair
#define sz(x) ((int)(x).size())
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define abs(x) ((x) < 0 ? -(x) : (x))
#define INF 2000000000
#define sqr(x) ((x) * (x))
#define all(x) x.begin(), x.end()
#define fname ""
#define MOD 1000000007
#define y1 google
#define eps 1e-9
#define ex exit(0)

typedef long long ll;

using namespace std;

int pos;
set <char> st;
int n;
string s;
bool cont,used[101];

int main(){

    srand(time(NULL));
                        /*
    #ifndef ONLINE_JUDGE
    freopen(fname".in","r",stdin);
    freopen(fname".out","w",stdout);
    #endif                */

    scanf("%d", &n);

    cin >> s;

    for(int i = 0; i < s.size(); i++){
        st.insert(s[i]);
    }

    if(st.size() < n)
        printf("NO"),ex;
    else
        printf("YES");

    bool first = true;

    for(int i = 0; i < s.size(); i++){
        if(first && !used[s[i]]){
            cont = true;
            cout<<endl;
            used[s[i]] = true;
            cout<<s[i];
            first = false;
            n--;
            if(!used[s[i+1]])
                first = true,cont = false;
            continue;
        }
        if(cont){
            cout<<s[i];
            if(s[i+1] != s[i] && n)
                first = true,cont=false;
        }
    }

    return 0;

}

#include <bits/stdc++.h>
using namespace std;
int b[27];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    int n;
    string s;
    cin>>n>>s;
    if(n>s.size())
    {
        cout<<"NO"<<endl;
        return 0;
    }int k=1;
    for(int i=0;i<s.size()-1;i++)
        if(s[i]!=s[i+1])
            k++;

        if(k<n)
            {
        cout<<"NO"<<endl;
        return 0;
    }
    string t;

    int ind=0;
    for(int i=0;i<n-1;i++)
        {
            if(b[s[ind]-'a'])
            {
             cout<<"NO"<<endl;
        return 0;
            }
            else
                b[s[ind]-'a']++;
            for(;ind<s.size()-1;ind++)
                if(s[ind]==s[ind+1])
                t+=s[ind];
            else
            {
                t+=s[ind++],t+='\n';
                break;
            }
        }
         if(b[s[ind]-'a'])
            {
             cout<<"NO"<<endl;
        return 0;
            }
            else
                b[s[ind]-'a']++;
        for(;ind<s.size();ind++)
            t+=s[ind];
             cout<<"YES"<<endl;
            cout<<t;
}

#include<bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
using ulli = unsigned long long int;
#define filein freopen ("in.txt", "r", stdin)
#define fileout freopen ("out.txt", "w", stdout)
#define dbg(args...) do {cerr << #args << " : "; debug(args); } while(0)
#define all(v) ((v).begin()),((v).end())
#define size(x) (int) x.size()
#define pb emplace_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
void debug () {cerr << endl;}
template< class T > T gcd(T a, T b) { return (b != 0 ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(T a, T b) { return (a / gcd<T>(a, b) * b); }
template < typename T, typename ... hello>void debug( T arg, const hello &... rest) {cerr << arg << ' ';debug(rest...);}
int main(){
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int k;
    string s;
    cin >> k >> s;
    map<char,int> count;
    vector<int> res;
    for(int i = 0; i < size(s) ; i++){
		if(count[s[i]] == 0){
			res.pb(i);
		}
		count[s[i]] = 1;
	}
	vector<string> ans;
	for(int i = 0;i < size(res) ; i++){
		if(i == 0){
			if(size(res) == 1){
				ans.pb(s);
			}else{
				ans.pb(s.substr(res[i],(res[i + 1] - res[i])));
			}
		}else if(i + 1 == size(res)){
			ans.pb(s.substr(res[i],size(s) - res[i]));
		}else{
			ans.pb(s.substr(res[i],(res[i + 1] - res[i])));
		}
	}
	if(size(ans) < k){
		cout << "NO";
	}else{
		cout << "YES\n";
		int j = 0;
		int x = (lli)ceil((size(ans) / double(k)));
		for(int y = 0; y < x; y++){
			int cnt = 0;
			while(j < size(ans)){
				cout << ans[j++];
				cnt += 1;
				if(cnt == x){
					break;
				}
			}
			cout << "\n";
		}
	}
}

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cstdio>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <set>

using namespace std;

int main()
{
    int k;
    cin >> k;
    string s;
    cin >> s;

    map<char, string> v;
    vector<string> ans;
    int j, i = 0;

    while (i < s.size())
    {
        char c = s[i];

        if (v.find(c) == v.end())
        {
            string tmp = "";
            tmp += c;
            j = i + 1;

            while (j < s.size() && s[j] != c)
            {
                tmp += s[j];
                j++;
            }

            ans.push_back(tmp);
            v[c] = tmp;
            i = j;
        }
        else
        {
            ans[ans.size() - 1] += c;
            i++;
        }

    }

    if (ans.size() >= k)
    {
        cout << "YES" << endl;
        int t = ans.size() - k + 1;
        int p = 0;

        string r = "";
        for (; p < t; ++p)
        {
            r += ans[p];
        }

        cout << r << endl;
        for (; p < ans.size(); ++p)
            cout << ans[p] << endl;
    }
    else
    {
        cout << "NO" << endl;
    }

}

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <string.h>
using namespace std;
int main()
{
    int n;
    string word;
    cin >> n;
    cin >> word;
    int first_letter_index = 0;
    int counter =0;
    string word_seq;
    vector<string> sequence;
    for(int i=1; i<word.size(); i++)
    {
        if(word[i]==word[first_letter_index])
            continue;
        else if(counter < n && n!= 1)
        {
            counter++;
            word_seq = word.substr(first_letter_index, i);
            sequence.push_back(word_seq);
            first_letter_index = i;
        }
    }
    if(sequence.size()==n){
    for(int i=0; i<sequence.size(); i++)
    {
        cout << sequence[i] << endl;
    }
    }
    else if(n==1){
        cout << "YES" << endl;
        cout << word << endl;
    }
    else
        cout <<"NO";
}

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

#define inf 1000000000
#define mod 1000000007
#define For(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define FOR(i, x, n) for(int (i) = (x); i<(n); (i)++)

#define sqr(a) (a)*(a)

#define pb push_back
#define mp make_pair
#define ll long long

#define MAX 1000
using namespace std;

ll binpow(ll a, ll n)
{
	ll b = 1;
	while (n>0)
	{
		if (n & 1)
			b *= a;
		a *= a;
		n >>= 1;
	}
	return b;
}

ll gcd(ll a, ll b)
{
	if (b == 0) return a;
	return gcd(b, a%b);
}

int main()
{
	//ios_base::sync_with_stdio(0);
	int n;
	cin >> n;
	string q;
	cin >> q;
	string a[110];
	int c = 0;
	int st = 0;
	if (c == n)
	{
		a[c] += q.substr(0, q.length() - 1);
		cout << "YES\n";
		for (int i = 1; i <= n; i++)
		{
			cout << a[i] << endl;
		}
		return 0;
	}
	for (int i = 0; i < q.length()-1; i++)
	{
		if (q[i] != q[i + 1])
		{
			c++;
			a[c] = q.substr(st, i+1-st);
			st = i + 1;
			if (c == n)
			{
				a[c] += q.substr(i + 1, q.length() - i - 1);
				cout << "YES\n";
				for (int i = 1; i <= n; i++)
				{
					cout << a[i] << endl;
				}
				return 0;
			}
		}

	}
	if (q[q.length() - 2] != q[q.length() - 1] && c == n)
	{
		a[n] = q.substr(st, q.length()-st);
		cout << "YES\n";
		for (int i = 1; i <= n; i++)
		{
			cout << a[i] << endl;
		}
	}
	else
	{
		cout << "NO" << endl;
	}
	return 0;
}

#include <string>
#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int k,t,i,j;
    string q;
    cin >> k;
    cin >> q;
    t = q.length() / k;
    if (t<1)
        cout << "NO";
    else
    {
        cout << "YES"<<endl;
        for (i = 0; i < k-1; i++)
        {
            for (j = 0; j < t; j++)
                cout << q[t*i + j];
            cout << endl;
        }
        for (i = t*(k-1); i < q.length(); i++)
            cout << q[i];
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9+7;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("test.txt","r",stdin);
	ll n,K;
	cin>>n>>K;
	ll ma;
	char arr[n][n];
	ll cnt=0;
	bool res=false;
	for(ll i=0;i<n;i+=2)
	{
		bool check=false;
		for(ll j=i,k=0;;j++,k++)
		{
			if(j>=n || k>=n)
				break;
			//cout<<j<<" "<<k<<"\n";
			arr[j][k]='L';
			cnt+=1;
			if(cnt==K)
			{
				check=true;
				break;
			}
		}
		if(check==true){
			res=true;
			break;
		}
	}
	/*for(ll i=0;i<n;i++)
	{
		for(ll j=0;j<n;j++)
			cout<<arr[i][j];
		cout<<"\n";
	}*/

	if(res)
	{
		cout<<"YES"<<"\n";
		for(ll i=0;i<n;i++)
		{
			for(ll j=0;j<n;j++){
				if(arr[i][j]=='L')
					cout<<arr[i][j];
				else
					cout<<'S';
			}
			cout<<"\n";
		}

		return 0;
	}
	for(ll j=2;j<n;j+=2)
	{
		bool check=false;
		for(ll k=j,i=0;;k++,i++)
		{
			if(k>=n || i>=n)
				break;
			arr[i][k]='L';
			cnt+=1;
			//cout<<cnt<<"\n";
			if(cnt==K)
			{
				check=true;
				break;
			}
		}
		if(check==true)
		{
			res=true;
			break;
		}
	}
	if(res)
	{
		cout<<"YES"<<"\n";
		for(ll i=0;i<n;i++)
		{
			for(ll j=0;j<n;j++){
				if(arr[i][j]=='L')
					cout<<arr[i][j];
				else
					cout<<'S';
			}
			cout<<"\n";
		}
	}
	else
		cout<<"NO"<<"\n";

}

//============================================================================
// Name        : ramadan2515
// Author      : Mohamed Ahmed Ramadan
// Version     :
// Copyright   : Your copyright notice
// Description :  C++,
//============================================================================

#include <bits/stdc++.h>
#define fore(i,n) for(long long i = 0; i< n ; i++ )
#define lop(i,n) for(long long i = 1 ; i<=n ; i++ )
#define ops(i,n) for(long long  i = n-1 ; i>=0 ; i-- )
#define MAX 100001
#define MAXI 10000000
#define r(input) freopen("input.in","r",stdin)
#define w(output) freopen("output.out","w",stdout)

using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
typedef pair<long long,long long>pll;
typedef vector<int> vi;
typedef vector<ll> vll;
bool visited[27];
int main(){
    //freopen("output.txt","w",stdout);
    ll n;
    string s;
    cin >> n;
    n--;
    cin >> s;
    if(n>=s.size()){
        cout << "NO";
        return 0;
    }
    string k[1000];
    int i;
    int counter=0;
    for( i=0;i<n;i++){
        char c =s[i];
        visited[c-'a']=true;
        k[counter]+=s[i];
        int j=i;
        while(c==s[i+1]){
            k[counter]+=s[i+1];
            i++;
        }
        counter++;
    }
    if(n+1>counter+1||i==s.size()){
        cout << "NO";
        return 0;
    }

    for(;i<s.size();i++){
        k[counter]+=s[i];
    }
    counter++;
    bool flag=true;
    fore(i,counter){
        fore(j,counter){
            if(k[i][0]==k[j][0]&&i!=j)flag=false;
        }
    }
    if(!flag){
        cout << "NO";
        return 0;
    }
    else {
        cout << "YES" <<endl;
        fore(i,counter){
            cout << k[i] <<endl;
        }
    }
}

#include <iostream>
#include <string>
using namespace std;
bool ves[30];
int cut[30];
string data;

int main()
{
    int n,cnt=0;
    cin>>n;
    cin>>data;
    if (n>data.size())
    {
        cout <<"NO"<<endl;
    }
    else
    {

        for (int i=0; i<data.size(); i++)
        {
            if (ves[data[i]-'a']==false)
            {
                ves[data[i]-'a']=true;
                cut[i]=++cnt;
            }
            if (cnt==n)
            {
                cout <<"YES"<<endl;
                break;
            }
        }
        if (cnt<n)
            cout <<"NO"<<endl;
        else
            for (int i=0; i<data.size(); i++)
            {
                if(cut[i]!=0 && i!=0)
                    cout <<endl;
                cout <<data[i];
            }
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int i,sz,k;
    cin>>k>>s;
    sz=s.size();
    int h[26],cnt=0;
    memset(h,0,26);
    for(i=0;i<sz;i++)
    {
        if(!h[s[i]-'a'])
        {
            h[s[i]-'a']=1;
            cnt++;
        }
    }
    if(cnt<k)
        cout<<"NO";
    else
    {
        memset(h,0,26);
        cnt=0;
        cout<<"YES";
        for(i=0;i<sz;i++)
        {
            if(h[s[i]-'a'])
            {
                cout<<s[i];
            }
            else
            {
                if(cnt==k-1)    break;
                h[s[i]-'a']=1;
                cout<<"\n"<<s[i];
                cnt++;
            }
        }
        if(i<sz)
        {
            cout<<"\n"<<s.substr(i,sz-i);
        }
    }
    return 0;
}

#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#define forl(i,n) for(int i=0;i<(int)n;i++)
#define pb(x) push_back(int x)
#define lld long long int
#define pii pair<int,int>
#define mem(x,y) memset(x,y,sizeof(x))
using namespace std;
vector<char>t;
int a2[120];
int main()
{
    int k,j,k1,k2,k3;
    char s[110];
    char s1[30][110];
    int f2=0;
    for(int i=0; i<30; i++)
    {
        for(int j=0; j<110; j++)
        {
            s1[i][j]='\0';
        }
    }
    scanf("%d %s",&k,s);
    int len=strlen(s);

    int l=0;
    t.clear();
    int f=0,f3=0;
    forl(i,len)
    {
        if(l==k-1)
        {
            for(j=i,k2=0; j<len; j++,k2++)
            {
                if(a2[s[j]]==1 && f3==0)
                {
                    s1[l-1][k1]=s[j];
                    k1++;
                    k2--;
                }
                else
                {
                    s1[l][k2]=s[j];
                    f3=1;
                }

            }
            f=1;

        }
        else if(a2[s[i]]==1)
        {
            s1[l-1][k1]=s[i];
            k1++;
        }
        else if(s[i]==s[i+1])
        {
            t.push_back(s[i]);
        }
        else
        {
            if(a2[s[i]]==0)
            {
                t.push_back(s[i]);
                f2=1;
            }
            else if(a2[s[i]]==1)
            {
                s1[l-1][k1]=s[i];
                k1++;
            }
            if(f2==1)
            {
                for( k1=0; k1<t.size(); k1++)
                {
                    s1[l][k1]=t[k1];
                    a2[s1[l][0]]=1;
                }
                //s1[l][k1]='\0';
                t.clear();
                l++;
                f2=0;
            }

        }
        if(f==1)break;
    }
    //cout<<s1[l]<<endl;
    if(f==0)printf("NO\n");
    else
    {
        printf("YES\n");
        for(int i=0; s1[i][0]!='\0'; i++)
        {
            for(int j=0; s1[i][j]!='\0'; j++)
            {
                printf("%c",s1[i][j]);
            }
            printf("\n");

        }

    }
    return 0;
}

#include<cstdio>
#include<cstring>
char a[101];
int n,i,j,k=1,b[28],c[28];
int main(){
    scanf("%d",&n);
    scanf("%s",a);
    b[1]=0;
    c[n]=strlen(a)-1;
    for(i=0;i<strlen(a);i++){
        if(a[b[k]]!=a[i]){
        c[k++]=i-1; b[k]=i;}
        if(k==n) break;
    }
    if(k==n){
        printf("YES\n");
        for(i=1;i<=k;i++){
            for(j=b[i];j<=c[i];j++) printf("%c",a[j]);
            printf("\n");
        }
    }
    else printf("NO");
}

#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
int k;
cin>>k;
string s;
vector<string>v;
cin>>s;
if(k>s.length())
cout<<"NO"<<endl;
else
{
int count=0,pos=0;
for(int i=1;i<s.length();i++)
{
if(s[i]!=s[pos])
{
count++;
if(count!=k)
v.push_back(s.substr(pos,i-pos));
if(count==k)
v.push_back(s.substr(pos,s.length()-pos));
pos=i;
if(count==k)
break;
}
}
if(count!=k)
printf("NO\n");
else
{
printf("YES\n");
vector<string>::iterator it;
for(it=v.begin();it!=v.end();it++)
cout<<*it<<endl;
}
}
return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    string ans[100009];
    int n;
    cin>>n;
    string s;
    cin>>s;
     int l=0;
    int nn=s.size();
    if(nn%n==0)
    {
        n=nn/n;
        for(int i=0; i<s.size(); i++)
        {
            string sss;
            for(int j=i; j<i+n; j++)
            {
               sss+=s[j];
            }
            ans[l++]=sss;
            i+=(n-1);
        }
    }
    else
    {
        if(n>s.size())
        {
            cout<<"NO\n";
            return 0;
        }
        else
        {
            int ed=0;
            for(int i=0; i<n-1; i++)
            {
                ans[l++]=s[i];
            }
            ed=n-1;
            string sss;
            for(int i=ed; i<s.size(); i++)
            {
               sss+=s[i];
            }
            ans[l++]=sss;
        }
    }
    int sum=0;
    for(int i=0; i<l-1; i++)
    {
        string s1=ans[i];
        string s2=ans[i+1];
        int l=0;
        while(s1[s1.size()-1]==s2[l])
        {
            s1+=s2[l];
            s2.erase(0,1);
            l++;
        }
        ans[i]=s1;
        ans[i+1]=s2;
        if(ans[i].empty())
        {
            cout<<"NO\n";
            return 0;
        }
       sum+=s1.size();
       if(sum==s.size())
        {
        cout<<"NO\n";
        }
    }
    if(sum==s.size())
    {
    cout<<"NO\n";
    return 0;
    }
    cout<<"YES\n";
    for(int i=0; i<l-1; i++)
    {
        cout<<ans[i]<<endl;;
    }
    for(int i=sum; i<s.size();i++)
    {
        cout<<s[i];
    }

}

#include <iostream>
#include<vector>
#include<queue>
#include<stack>

using namespace std;

int main()
{
    int k;
    cin>>k;
    string q;
    cin>>q;
    if (k>q.length())cout<<"NO"<<endl;
    else
    {
    cout<<"YES"<<endl;
        int d=q.length()/k;
        int i=0;
        while(i<d*k)
        {
            for(int j=1;j<=d;j++)
            {
                cout<<q[i];
                i++;
            }
            cout<<endl;
        }
        while(i<q.length()){
            cout<<q[i];
            i++;
        }
        cout<<endl;

    }
    return 0;
}

#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int n,num=0;
string s;
int len;
bool b[100],bb[100];
int main()
{
	cin>>n>>s;
	len=s.length();
	if(len<n) {printf("NO\n"); return 0;}
	if(n==1)  {cout<<"YES"<<endl<<s<<endl;  return 0;}
	b[int(s[0]-'a')]=1;
	for(int i=0;i<len;i++)
	  if(!bb[int(s[i]-'a')])  {num++;bb[int(s[i]-'a')]=1;}

	if(num<n)  {printf("NO\n"); return 0;}
	printf("YES\n");
	int i;
	num=0;
	printf("%c",s[0]);
	for(i=1;i<len;i++)
	{
		if(!b[int(s[i]-'a')])
		{
		  printf("\n%c",s[i]);
	          num++;
		}
		else  printf("%c",s[i]);
		if(num==n-1)  break;
	}
	i++;
        for(i;i<len;i++) cout<<s[i];
	cout<<endl;
	return 0;
}

#include<bits/stdc++.h>
#define FAST ios::sync_with_stdio(false);
#define ll long long
using namespace std;
int main(){
	FAST;
	int k,j=0,hi=0;
	cin >> k;
	string s,a[k];
	cin >> s;
	set<pair<int,string>>st;
	int mp[k];
	int dem=1,sz=s.size();
	if(k==1){
	    cout <<"YES" <<endl;
	    cout << s;
	}
	else{
	    for(int i=0,id=0;i<sz-1;i++){
	        mp[s[i]]++;
	        if(s[i] != s[i+1]){
	            if(mp[s[i+1]] == 0){
	            st.insert({id++,s.substr(hi,i+1-hi)}); // make_pair() <=> {}
	            // st.insert(make_pair(id++,s.substr(hi,i+1-hi)));
	            hi=i+1;
	            }
	        }
	        if(st.size()+1==k){
	            cout <<"YES"<<endl;
	            st.insert({id++,s.substr(hi,sz-hi)});
	            for(auto x:st) cout << x.second <<endl;
	            return 0;
	        }
	    }
	    cout <<"NO";
	}
    return 0;
}

#include<iostream>
#include<string.h>
#include<cstring>
#define maxn 150
using namespace std;
int k;
char s[maxn];
bool a[maxn];
bool alpha[27];
int main()
{
	scanf("%d",&k);
	scanf("%s",s);
	int len=strlen(s);
	int count=0;
	for(int i=0;i<len;i++)
	{
		if(alpha[s[i]-'a']==NULL)
		{
			alpha[s[i]-'a']=true;
			a[i]=true;
			count++;
		}
	}
	if(count>=k)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
		return 0;
	}
	printf("%c",s[0]);

	for(int i=1;i<len;i++)
	{
		if(k==1)
		{
			printf("\n%s",s+i);
			break;
		}
		else
		{
			if(a[i])
			{
				printf("\n%c",s[i]);
			}
			else
			{
				printf("%c",s[i]);
			}
		}
		if(a[i+1])
		{
			k--;
		}
	}
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char str[105];
int a[30],w[30];
int main()
{
    int x,i,ans=0,k=0,u;
    scanf("%d",&x);
    scanf("%s",str);
    int len=strlen(str);
    for(i=0; i<len; i++)
    {
        if(a[str[i]]==0)
        {
            w[k]=i;
            k++;
        }
        a[str[i]]++;
    }
    if(k<x)
        printf("NO\n");
    else
    {
        u=0;
        if(x==1)
            printf("%s\n",str);
        else
        {
            while(1)
            {
                for(i=w[u]; i<w[u+1]; i++)
                {
                    printf("%c",str[i]);
                }
                puts("");
                u++;
                if(u==x-1)
                    w[u+1]=len;
                if(u==x)
                    break;

            }
        }

        printf("YES\n");
    }

}
/*2018-02-19 12:57:46.443*/

#include<bits/stdc++.h>

#define ntest 0

using namespace std;

int k;
string q;
void solve() {
    cin >> k >> q;
    vector<int> candidate;
    set<char> s;
    for (int i = 1; i < q.size(); ++i) {
        if (!s.count(q[i])) {
            candidate.push_back(i);
            s.insert(q[i]);
        }
    }
    if (candidate.size() < k) {
        cout << "NO\n";
        return;
    }
    candidate.push_back(q.size());
    cout << "YES\n";
    int cur = 0;
    for (int i = 0; i < k - 1; ++i) {
        for (cur = candidate[i]; cur < candidate[i+1]; ++cur) cout << q[cur];
        cout << endl;
    }
    for (;cur < q.size(); ++cur) cout << q[cur];
}
int main() {
    //ios::sync_with_stdio(0);
    //cin.tie(0);
    if(ntest){
        int t;
        cin >> t;
        while(t--) solve();
    } else {
        solve();
    }

}

#include <stdio.h>
char d[105];
int chk[26];
bool ANS_CHK[26];
int main() {
	int i, j, K;
	scanf("%d %s", &K, &d[1]);
	for(i = 1; d[i] != 0; i++) {
		if(chk[d[i]-'a'] == 0) chk[d[i]-'a'] = i;
	}
	int cnt = 0;
	for(i = 0; i <= 25; i++) {
		if(chk[i] != 0) {
			cnt++;
			if(cnt <= K) ANS_CHK[chk[i]] = true;
			if(cnt == K) break;
		}
	}
	if(i == 26) printf("NO");
	else {
		printf("YES");
		for(i = 1; d[i] != 0; i++) {
			if(ANS_CHK[i]) printf("\n");
			printf("%c", d[i]);
		}
	}
	return 0;
}

#include<iostream>
#include<string>
#include<cstring>
#include<set>
#include<vector>
using namespace std;
int main()
{
	int n;
	cin>>n;
	string str;
	cin>>str;
	char *_str=(char*)str.c_str();
	set<char> c_set;
	vector<char> v_set;
	int old_size=0;
	for(int i=0;i<strlen(_str);i++)
	{
		c_set.insert(_str[i]);
		if (c_set.size() != old_size)
		{
			old_size = c_set.size();
			v_set.push_back(_str[i]);
		}
	}
	if(c_set.size()<n)
	{
		cout<<-1<<endl;
		return 0;
	}
	else
	{
		v_set.resize(n);
		vector<char>::iterator it=v_set.begin();
		it++;
		for(int i=0;_str[i]!='\0';)
		{
			cout<<_str[i];
			i++;
			if(it!=v_set.end()&&_str[i]==*it)
			{
				it++;
				cout<<endl;
			}
		}
	}
	cout << endl;
}

#include<bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#define PI  3.1415926535898
#define ll  long long
using namespace std;
int main () {
    int i,j,k,m,n,t;
    int len, res, ans, key, sum;char temp;
    char String[30],String1[30];
    int flag[30];
    while(~scanf("%d",&n)){
        getchar();
        gets (String);
        len = strlen(String);
        if(n > len)
            cout << "NO" << endl;
        else {
            strcpy(String1,String);
            sort(String1,String1 + len );
            temp = String1[0];
            k = 1;
            for(i = 0 ; i < len; i++)
                if(temp != String1 [i] ) {
                    k++;
                    temp = String1[i];
                }
            if(k < n )  cout << "NO" << endl;
            else {
                cout << "YES" << endl;
                memset(flag,0,sizeof(flag));
                putchar(String[0]);
                flag[String[0] - 'a' + 1] = 1;
                n--;
                for(i = 1; i < len; i++){
                    if(flag[String[i] - 'a' + 1] == 0 && n != 0) {
                        cout << endl << String[i];
                        n--;
                    }
                    else
                         cout << String[i];
                }
            }
        }
    }
return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <sstream>
#include <vector>
#include <queue>
#include <string>
#include <stdio.h>
#include <string.h>
#include <functional>    //for hash
#include <bitset>        //for binary

using namespace std;
string arr[300];
int main(int argc, char *argv[])
{
  //  freopen("input.iN","r" , stdin);
//	freopen("ans.txt","w" , stdout);
	int k,c=0;
	cin>>k;
	string s;
	cin>>s;
	if(s.length()<k){
		cout<<"NO"<<endl;
		return 0;
	}
	char a=s[0];
	for(int i=0;i<s.length();i++)
	{//cout<<arr[c]<<endl;
		if(s[i]==a)
		{
			arr[c]+=s[i];
		}
		else
		{
			c++;
			arr[c]+=s[i];
			a=s[i];
		}
	}
	if(c<k){
		cout<<"NO"<<endl;
		return 0;
	}
	else{string v="";
		cout<<"YES"<<endl;
		for(int y=0;y<k-1;y++)cout<<arr[y]<<endl;
		for(int y=k-1;y<=c;y++){v+=arr[y];};
		cout<<v<<endl;
	}
	return 0;
}

//----->|try=0; while(!success) try++;|<------
#include<bits/stdc++.h>
using namespace std;
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define PI acos(-1.0)
#define LL long long
#define INF_MAX 2147483647
#define INF_MIN -2147483647
#define MX 1000005
#define MOD 1000000007
int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    int n,k;
    string s;
    while(cin>>k>>s)
    {
        if(s.size()<k) cout<<"NO"<<endl;
        else
        {
            int len=s.size()/k;
            int cnt=0,p=0,i,j;
            cout<<"YES"<<endl;
            for(i=0; i<k-1; i++)
            {
                string ss="";

                for( j=p; j<len; j++)
                {
                    ss+=s[j];
                    cnt++;
                }
                p=j;
                cout<<ss<<endl;
            }
            //cout<<"cnt = "<<cnt<<endl;
            int keep=s.size()-cnt;
            if(keep)
            {

                for(int t=s.size()-1; keep>0; t--,keep--)
                {
                    cout<<s[t];
                }
                cout<<endl;
            }

        }
    }
}

#include<bits/stdc++.h>

using namespace std;

int n, m, a[int(1e5)], b[111];
string s, S;

vector<string> v;

int main ()
{
    cin >> n >> s;
    int k = 0;
    for(int i = 0; i < s.size(); i++)

    {
         if(!a[s[i] - 'a']){
            k++;
            a[s[i] - 'a']++;
         }
    }
    if(n > k)
         cout << "NO";
    else
    {
         cout << "YES" << endl << s[0];
         b[s[0] - 'a'] = 1;
         n--;
         for(int i = 1; i < s.size(); i++)
         {
               if(b[s[i] - 'a'] == 0 && n){
                    cout << endl;
                    n--;
               }
               cout << s[i];
         }
    }
return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define ll long long int

int main(){
    int n;
    string s;
    cin>>n;
    cin>>s;
    map<char,int> mp;
    mp[s[0]]=1;
    vector<string> ans;
    int st=0, cut;
    bool yes=false;
    for(int i=1; i<s.size(); i++){
        if(!mp[s[i]]){
            if(ans.size()==n-1){ans.push_back(s.substr(st, s.size()-st)); yes=true; break; }
            ans.push_back(s.substr(st, i-st));
            st=i;
        }
    }
    if(!yes)
    {
        ans.push_back(s.substr(st, s.size()-st));
    }
    if(ans.size()==n){
        cout<<"YES\n";
        for(string it : ans)
            cout<<it<<"\n";
    }
    else cout<<"NO";
    return 0;
}

#include <string>
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int k;
	cin >> k;
	string s;
	cin >> s;

	using index = int;
	pair<vector<index>, vector <char>> p;

	auto & indiciesVector = p.first;
	auto & charFirstVector = p.second;
	for (int i = 0; i < s.size(); ++i)
	{
		char c = s.at(i);

		if (find(charFirstVector.begin(), charFirstVector.end(), c)
			==
			charFirstVector.end())
		{
		indiciesVector.push_back(i);
			charFirstVector.push_back(c);
		}
	}

	auto maxString = p.second.size();
	if (maxString < k)
	{
		cout << "NO" << endl;
		return 0;
	}
	else
	{
		auto indiciesCount = maxString;
		for (int i = 0; i != k; ++i)
		{
			string ans = "";

			for (int j = indiciesVector.at(i); j
				!=
				(i != k - 1 ? (p.first.at(i + 1) ) :  s.size()); ++j)
			{
				ans += s.at(j);
			}
			cout << ans << endl;
		}
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k, l, c=0, j, i=0;
    string s;
    cin>>k;
    cin>>s;
    l=s.size();
    if(l/k>0)
    {
        cout<<"YES"<<endl;
        for(j=0; j<l; j++)
        {
            cout<<s[j];
            if(j==k-1)
            {
                for(i=j+1; i<l; i++)
                {
                    cout<<s[i];
                }
                break;
            }
            else
            {
                cout<<endl;
            }
        }
            cout<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>
//nclude<iostream>

using namespace std;

char a[10000];
int has[1000];
int main()
{

    for(int i=0;i<900;i++) has[i]=0;

    int k,i,j,l,diff=0;
    cin>>k;

    scanf("%s",a);

    l=strlen(a);

   if(k==1)
     {

        cout<<"YES"<<endl;
        printf("%s",a);
     }

    else
     {
        //cout<<"3"<<endl;
        for(i=0;i<l;i++)
            has[a[i]]=1;

        for(i=0;i<125;i++) {

        if(has[a[i]]==1) {

         diff++;} }

    //  cout<<diff<<endl;
        if(k>diff) { cout<<"NO"<<endl;}

        else
         {
             cout<<"YES"<<endl;
            int  m=0;
             //cout<<"ye"<<endl;

             for(i=0;i<k;i++)
              {

              //    if(has[a[i]]==1)
                {

                //  has[a[i]]=0;
                  for(j=m;j<l;j++)
                   {

                        cout<<a[j];
                        has[a[j]]=0;

                        if(j+1<l && has[a[j+1]]==1 && i!=k-1) {m=j+1; cout<<endl; break;}
                  }

              }

              }

                  }
     }

    return 0;
}

#include<bits/stdc++.h>
#include<stdint.h>
using namespace std;
#define IOS {cin.tie(0);ios_base::sync_with_stdio(false);}
#define MAXN 100001

string s;
vector<int> v;
bool alp[128];

int main()
{
	//IOS;
	int l;
	cin >> l >> s;
	for(int i=0;i<s.length();i++){
		if(!alp[s[i]]){
			v.push_back(i);
			alp[s[i]] = true;
		}
	}
	if(v.size()<l){
		cout << "NO\n";
		return 0;
	}
	cout << "YES\n";
	int j;
	for(int i=1;i<l;i++){
		for(j=v[i-1];j<v[i];j++){
			cout << s[j];
		}cout << '\n';
	}
	for(;j<s.length();j++) cout << s[j];

  return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define TEST int t;cin>>t;for(int T=1;T<=t;T++)
#define F first
#define S second
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    map <char, int> mp;
    set <char> st;
    for(int i=0; i<s.size(); i++)
        st.insert(s[i]);
    if(st.size()<n)
        cout << "NO" << endl;
    else {
        if(n==1) {
            cout << "YES" << endl;
            cout << s << endl;
        } else {
            cout << "YES" << endl;
            for(int i=0; i<s.size(); i++) {
                if(mp[s[i]]!=1) {
                    if(i!=0)
                        cout << endl;
                    cout << s[i];
                    mp[s[i]]=1;
                } else {
                    cout << s[i];
                }
            }
            cout << endl;
        }
    }
    // main();
}

#include <iostream>
#include <vector>
#include <string>
#include <set>
using namespace std;

int main() {
    int k; cin >> k;
    string q, temp = ""; cin >> q;
    vector<string> v;
    for (auto c : q) {
        if (temp == "" || temp[temp.length() - 1] == c) {
            temp += c;
        } else {
            v.push_back(temp);
            temp = c;
        }
    }
    v.push_back(temp);

    if (v.size() < k) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
        for (int i = 0; i < k-1; i++) {
            cout << v[i] << endl;
        }
        string last = "";
        for (int i = k-1; i < v.size(); i++) {
            last += v[i];
        }
        cout << last << endl;
    }
}

#include <fstream>
#include <time.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#define pb push_back
#define mp make_pair
#define sortvi(a) sort(a.begin(), a.end())
#define FOR(i, start, final) for (int i=start; i<=final; ++i)
#define ROF(i, start, final) for (int i=start; i>=final; --i)

#define f cin
#define g cout

//void f(int &x){char k;for(k=getchar();k<= 32;k=getchar());for(x=0;'0'<=k;k=getchar())x=x*10+k-'0';}

/*void f(int &x)//parsare cu semn
{
    char k; bool semn=0;
    for (k = getchar(); (k>'9' || k<'0');)
    {
        if (k=='-') semn=1;
        k=getchar();
    }
    for (x = 0; '0' <= k; k = getchar())    x = x * 10 + k - '0';
    if (semn==1) x=-x;
}*/

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair < int, int> pi;
typedef vector< int > vi;
typedef vector< pair< int, int > > vpi;

char s[105];
int N, K, cnt[30], x, ap[30], last, i;

int main()
{
    f.sync_with_stdio(false);
    f>>K>>(s+1); N=strlen(s+1);
    if (K>N) { g<<"NO\n"; return 0;}
    FOR(i,1,N)
    {
        ++cnt[s[i]-'a'+1];
        if (cnt[s[i]-'a'+1]==1)
            ap[i]=1;
    }

    FOR(i,1,N) x+=ap[i];
    if (x<K) { g<<"NO\n"; return 0;}

    g<<"YES\n"; last=1;
    for (i=1; i<=N; ++i)
        if (ap[i]==1)
        {
            if (K>1)
            {
                ap[i]=0; --K;
                for (; i<=N && ap[i]==0; ++i)g<<s[i], last=i+1;
                --i;
                g<<'\n';
            }
            else break;
        }
    for (i=last; i<=N; ++i)
        g<<s[i];
    return 0;
}

#include <iostream>
#include <algorithm>

int main()
{
    int i, k;
    std::string tmp;
    std::cin >> k;
    std::cin >> tmp;
    if (k > tmp.length()) {
        std::cout << "NO" << std::endl;
    } else {
        std::vector<int> arr;
        bool used[30];
        for (i = 0; i < tmp.length(); i++) {
            if (!used[tmp[i] - 'a']) {
                used[tmp[i] - 'a'] = true;
                arr.push_back(i);
            }
        }
        if (arr.size() < k) {
            std::cout << "NO" << std::endl;
        } else {
            std::cout << "YES" << std::endl;
            std::string word;
            for (i = 0; i < k - 1; i++) {
                word = tmp.substr((size_t) arr[i], (size_t) arr[i + 1] - arr[i]);
                std::cout << word << std::endl;
            }
            if (arr.size() > i) {
                word = tmp.substr((size_t) arr[i], tmp.length() - arr[i]);
                std::cout << word << std::endl;
            }
        }
    }
    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    string str;
    int n;
    cin >> n >> str;
    vector<int> pos(26, -1);
    for(int i = 0; i < str.size(); i++)
    {
        if(pos[str[i] - 97] == -1)
        {
            pos[str[i] - 97] = i;
        }
    }
    vector<int> index;
    for(int i = 0; i < 26; i++)
    {
        if(pos[i] != -1)
            index.push_back(pos[i]);
    }
    if(index.size() < n)
    {
        cout << "NO" << endl;
        return 0;
    }
    for(int i = 0; i < index.size(); i++)
        cout << index[i] << " ";
    sort(index.begin(), index.end());
    cout << "YES" << endl;
    int i;
    for(i = 0; i < n - 1; i++)
    {
        cout << str.substr(index[i], index[i + 1] - index[i]) << endl;
    }
    cout << str.substr(index[i], str.size() - index[i]) << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
vector<int>v;
int main(){
	int k,j=1;
	string s;
	cin>>k>>s;
	v.push_back(-1);
	for(int i=1;i<k;i++){
		while(s[j]==s[j+1] && j<s.size()){
			j++;
		}
		if(s.size()==j){
			cout<<"NO";
			return 0;
		}
		v.push_back(j);
	}
	v.push_back(s.size()-1);
	cout<<"YES"<<endl;
	for(int i=1;i<=k;i++){
		for(int j=v[i-1]+1;j<=v[i];j++){
			cout<<s[j];
		}
		cout<<endl;
	}
	return 0;
}

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <set>
using namespace std;

int main()
{
	string q;
	int k;
	cin>>k;
	cin>>q;
	int kil = 0;
	string checking ="";
	string mas[26];
	checking+=q[0];
	string temp ="";
	temp+=q[0];
	for (int i=1;i<q.length();i++)
	{
		temp+=q[i];
		if (checking.find(q[i+1])>q.length())
		{
			checking+=q[i];
			mas[kil]=temp;
			kil++;
			temp="";
		}
		if (kil == k)
		{
			for (int j=i;j<q.length();j++)
			mas[kil-1]+=q[j];
			for (int i=0;i<k;i++) cout<<mas[i]<<endl;
			cout<<"YES"<<endl;
			return 0;
		};
	}
	cout<<"NO"<<endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){

    int k; cin>>k;
    string a; cin>>a;
    if(a.size()<k) cout<<"NO\n";
    else{
        cout<<"YES\n";
        for(int i=0;i<k-1;i++){
            cout<<a[i]<<endl;
        }
        for(int i=k-1;i<a.size();i++) cout<<a[i];
        cout<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define mk make_pair
#define pb push_back
#define pp pop_back
using namespace std;
string s , s1[12345] ;
int n , c , j ;
map<char,bool> mp ;
set<char> ss ;
int main ()
{
    cin >> n >> s ;
    if ( s.size() < n )
    {
        cout << "NO" ; return 0 ;
    }
    for ( int i = 0 ; i < s.size() ; ++i )
    {
        ss.insert(s[i]) ;
    }
    if ( n > ss.size() )
    {
        cout << "NO" ; return 0 ;
    }
    for ( int i = 0 ; i < s.size() ; ++i )
    {
        for ( int j = i + 1 ; j < s.size() ; ++j )
        {
            if ( s[i] != s[j] && mp[s[j]] == false && mp[s[i]] == false  )
            {
                    mp[s[i]] = true ;
                    if ( c == n -1 )
                    {
                        s1[c] = s.substr(i,s.size()-1) ;
                        c++ ;
                    }
                    else
                    {
                        s1[c] = s.substr(i,j-i) ;
                        c++ ;
                    }
            }
            if ( c == n -1 && mp[s[i]] == false )
            {
                s1[c] = s.substr(i,s.size()-1) ;
                c++ ;
                break ;
            }
        }
        if ( c == n )
        {
            break ;
        }
    }
    cout << "YES" <<endl ;
    for ( int i = 0 ; i < c ; ++i )
    {
        cout << s1[i] <<endl ;
    }
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<math.h>
#include<cstdio>
#include<deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){

    int n, k;
    cin >> n >> k;

    char a[105][105];

    int cnt = 0;
    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= n; j++){
            if (cnt < k){
                if (i % 2 == 1){
                    if (j % 2 == 1){
                        a[i][j] = 'L';
                        cnt++;
                    }
                    else{
                        a[i][j] = 'S';
                    }
                }
                else{
                    if (j % 2 == 0){
                        a[i][j] = 'L';
                        cnt++;
                    }
                    else
                        a[i][j] = 'S';
                }
            }
            else{
                a[i][j] = 'S';
            }
        }
    }

    if (cnt == k){
        cout << "YES";
        for (int i = 1; i <= n; i++){
            for (int j = 1; j <= n; j++){
                cout << a[i][j];
            }
            cout << endl;
        }
    }
    else
        cout << "NO";

    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

typedef struct ss
{
    int a;
    char b;
}ss;

int main()
{
    int k;
    char a[50];
    int n,f,m,l;
    scanf("%d",&k);
    scanf("%s",a);
    n = strlen(a);
    ss z[200];
    z[0].a = 0;
    z[0].b = a[0];
    m = 1;
    for(int i = 1;i < n;i++){
            f = 1;
        for(int j = 0;j < m;j++){
            if(a[i] == z[j].b){
                f = 0;
            }
        }
        if(f == 1){
            z[m].a = i;
            z[m].b = a[i];
            m++;
        }
    }
    if(k > m){
        printf("NO\n");
        return 0;
    }
    else{
        printf("YES\n");
        l = 1;
        for(int i = 0; i < n;i++){
            if(a[i] == z[l].b && l < k){
                printf("\n");
                l++;
            }
            printf("%c",a[i]);
        }
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;

int main()
{
	int a;
	string str;

	cin >> a;
	cin >> str;

	if(a * 100 < (int)str.length() || a > (int)str.length())
	{
		printf("NO\n");
		return 0;
	}

	int l = ceil((double)str.length() / a);
	int k = 0;
	for (int i = 0; i < a-1; ++i)
	{
		for (int j = i * l; j < ((i + 1) * l); ++j, k++)
		{
			printf("%c", str[i]);
		}

		printf("\n");
	}

	for (int i = k; i < (int)str.length(); ++i)
	{
		printf("%c", str[i]);
	}
	printf("\n");

	return 0;
}

#include<bits/stdc++.h>

using namespace std;

string s;
int n;
int dem=0;
int res=0;
map<char,int>cnp;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    freopen("544A.inp","r",stdin);
    freopen("544A.out","w",stdout);
    cin>>n>>s;
    for(int i=0; i<s.size(); i++)
    {
        cnp[s[i]]=1;
    }
    if(s.size()<n)
    {
        cout<<"NO";
        return 0;
    }
    cout<<"YES";
    for(int i=0; i<s.size(); i++)
    {
        if(cnp[s[i]]==1&&n!=0)
        {
            cout<<endl;
            n--;
            cnp[s[i]]=0;
        }
        cout<<s[i];
    }

}

#include <bits/stdc++.h>
using namespace std;
bool book[26];
char a[105];
int main()
{
    int k;
    cin>>k;
    cin>>a;
    for(int i = 0;a[i];i++) book[a[i]-'a'] = 1;
    int cnt = 0;
    for(int i = 0;i < 26;i++)   cnt += book[i];
    if(cnt < k)
    {
        cout<<"NO";
        return 0;
    }
    cout<<"YES"<<endl;
    int index = 0;
    for(int i = 0;a[i],cnt;i++)
    {
        if(a[i] == a[index])    cout<<a[i];
        else
        {
            index = i;
            k--;
            if(!k)    break;
            cout<<endl;
            cout<<a[i];
        }
    }
    while(a[index]) cout<<a[index++];
    return 0;
}

//Faithless is he that says farewell when the road darkens

#include<bits/stdc++.h>
using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main(){
   int n,a,c=0;
   int A[26]={};
   cin>>n;
   string s;
   cin>>s;
   for(char ch:s)c++;
   if(c<n)return cout<<"NO",0;
   string s2=string(1,s[0]);
   A[s[0]-'a']=1;
   cout<<"YES"<<endl;
   int i=0;
   while(i<s.size()){
        if(n==1){cout<<s.substr(i);break;}
        while(i<s.size()&&A[s[i]-'a'])s2+=s[i++];
        A[s[0]-'a']=1;
        cout<<s2<<endl;
        n--;
   }

}

/*
Rasedur Rahman Roxy
Facebook: www.facebook.com/MdRoxy
E-mail: roxy.xmw@gmail.com
Condeforces: mdroxy

Problem link:
*/

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

#define ll long long
#define read freopen("in.txt","r",stdin)
#define loop(x,y,z) for(int i=x;i<y;i+=z)
#define cloop(x,y,z) for(int i=x;i>=y;i-=z)
#define PI acos(-1.0)
#define pf printf

using namespace std;

int main()
{
    //read;
    int k;
    while(cin>>k)
    {
        string s;
        cin>>s;
        if(k>26)
        {
            cout<<"NO"<<endl;
            continue;
        }
        bool a[26];
        int l=s.size();
        memset(a,0,sizeof(a));
        loop(0,l,1)
            a[s[i]-97]=1;
        int sum=0;
        loop(0,26,1)
            sum+=a[i];
        if(sum<k)
        {
            cout<<"NO"<<endl;
            continue;
        }
        int c=1;
        cout<<"YES"<<endl;
        memset(a,1,sizeof(a));
        a[s[0]]=0;
        loop(0,l,1)
        {
            if(a[s[i]]==1&&c<k)
            {
                a[s[i]]=0;
                c++;
                cout<<endl;
            }
            cout<<s[i];
        }
        cout<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, j;
bool c[27];
string a, *arr;
void me()
{
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}
int main()
{
	me(); cin >> n >> a; set <char> x;
	arr = new string[n];
	for (int i = 0; i < a.size(); i++) x.insert(a[i]);
	if (x.size() < n) return cout << "NO" << endl, 0;
	if (n == 1) return cout << "YES" << endl << a << endl, 0;
	cout << "YES" << endl; c[a[0]-'a']=1;
	for (; 1;)
	{
		if (c[a[0]-'a']) arr[j] += a[0],a.erase(a.begin());
		else arr[++j] += a[0], c[a[0]]=1, a.erase(a.begin());
		if (j == n - 1) break;
	}
	arr[n - 1] += a;
	for (int i = 0; i < n; i++) cout << arr[i] << endl;
	delete[]arr;
	arr = NULL;
	return 0;
}