Time limit
2s
Memory limit
128 MB
A positive integer K is given. A string S is called K-repeat-free if there is no nonempty string T such that T repeated K consecutive times appears as a substring of S.
Given K, N, and A, find the lexicographically smallest word of length N that is K-repeat-free and uses only the first A uppercase English letters.
The first line contains three integers K, N, and A.
Print the required word. If no such word exists, print -1.