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.
from itertools import groupby

k = int(input())
text = input()

len_tekrar = [len(list(group)) for key, group in groupby(text)]

print(len_tekrar)

if k == 1 || len(len_tekrar) == 1:
	print("-1")
	exit()

if 1 in len_tekrar:
	print("-1")
	exit()

for i in len_tekrar:
	if len_tekrar[0] != i:
		print("-1")
		exit()
	if i != k:
		print("-1")
		exit()

text = list(set(text))
text = sorted(text)

text = ''.join(text)
print(text * k)
