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

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

The second line contains string *q*, consisting of lowercase Latin letters. The length of the string is within range from 1 to 100, inclusive.
import sys

k = int(input("the number of strings: "))
Q = input("line: ")

def rink(k,Q):
    a=0
    b=0
    s=0
    li = []
    for i in range(0,k):
        while Q[a]==Q[b]:          
            b+=1
            if b==int(len(Q)):
                if not (Q[a] in li):
                    return s+1
                else:
                    return s 
        if not (Q[a] in li):
            li.append(Q[a])
            s +=1
        a = a-a+b
        if (len(Q)-len(Q[a:b]))<k:
            return False
    return s    

def rink2(k,Q):
    a=0
    b=0
    li=[]
    i=0
    for i in range(0,k):
        while Q[a]==Q[b]:          
            b+=1
            if b==int(len(Q)):
                if not (Q[a] in li):
                    print(Q[a:b])
                    return 0
        if (i == k-1):
            print(Q[a:])
            return 1
        if not (Q[a] in li):
            print(Q[a:b])            
        a = a-a+b
        i +=1
        
if len(Q)<k:
    print("NO")
    sys.exit()

if rink(k,Q) == False:
    print("NO")    
elif int(rink(k,Q))==k:
    print("YES")
    rink2(k,Q)
else:
    print("NO")



