2
aaab
 2
babac
 2
aaaaaabbbb
 1
aabaab
 2
aabbbbccccccdddddddd
 2
abba
 2
aaaazzzz
 250
cececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececece
 3
aaaaaaaaacccdddddd
 2
aabaab
 1
aaaaa
 7
abacaba
 2
aaaabbbb
 5
aaaaa
 1
aaa
 2
aaazz
 3
aabaaaaabb
 2
aaaa
 2
aa
 3
bbbccc
 15
abaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaaabaabbbcababaaa
 1
a
 2
bbaaaa
 2
aaaabb
 2
aabbbb
 2
aaaaaazz
 3
aaaaaaaaacccbbbbbb
 2
bbbbaa
 2
aaaazz
 2
aazzzz
 2
acaccc

-1
 -1
 aaabbaaabb aaaabb
 abbcccddddabbcccdddd abab
 aazzaazz cececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececececece
 aaacddaaacddaaacdd aabaab
 aaaaa
 -1
 aabbaabb
 aaaaa
 aaa
 -1
 -1
 aaaa
 aa
 bcbcbc
 aaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbcaaaaaaaabbbbbbc a
 aabaab
 aabaab
 abbabb
 aaazaaaz aaabbcaaabbcaaabbc
 abbabb
 aazaaz azzazz
 accacc



import java.io.*;
import java.util.*;

public class TestClass {
	public static void main(String args[] ) throws Exception {

		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		InputReader s = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		int k=s.nextInt();
		String str=s.nextLine();
		char arr[]=str.toCharArray();
		int freq[]=new int[26];
		for(int i=0;i<str.length();i++)
		{
			freq[arr[i]-'a']++;

		}
		int i;
		int x=freq[arr[0]-'a'];
		for(i=0;i<26;i++)
		{

			if(freq[i]!=x && freq[i]!=0)
			{
				break;
			}
		}
		if(i!=26)
			System.out.println("-1");
		else
		{
			int y=0;
			for(i=0;i<26;i++)
			{
				x=0;
				if(freq[i]==0)
					continue;
				while(freq[i]!=0)
				{
					if(y+x>str.length())
					{
						System.out.println("-1");
						break;
					}
					arr[y+x]=(char)(i+'a');
					x+=k;
					freq[i]--;

				}
				y++;



			}
			if(i!=26)
			{
				for(i=0;i<str.length();i++)
					out.print(arr[i]);
				out.println();
			}
		}
		out.close();




	}

	public static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}
		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}
class DisJointSetsUnion
{
	int n;
	int[] rank,parent;

	public DisJointSetsUnion(int n)
	{
		this.n = n;
		rank = new int[n];
		parent = new int[n];
		makeSet();
	} 
	void makeSet()
	{
		for(int i=0;i<n;i++)
		{
			parent[i] = i;
			rank[i] = 1;
		}

	}
	/*	int findSet(int x)
	{
		if(parent[x]!=x)
		{ 

			parent[x] = findSet(parent[x]);
		}

		return parent[x];
}*/
	int findAns(int y,int x)
	{
		int count= 0;
		while(parent[y]!=x)
		{
			if(y == parent[y])
				return -1;
			y = parent[y];
			count++;
		}
		return count;
	}
	void union(int a,int b)
	{
		//	if(findSet(a) == findSet(b))
		//		return;

		//	int yRoot = findSet(b);
		//	int xRoot = findSet(a);

		parent[a]= b;
		//	rank[yRoot]+=rank[xRoot];

	}


}
