Time limit
2s
Memory limit
128 MB
Count positions in a string starting from 1. A string is ideal if, for every character in the string, the total number of times that character appears is equal to the position where it first appears.
For example, BAOOOA is an ideal string. B first appears at position 1 and appears 1 time in total. A first appears at position 2 and appears 2 times in total. O first appears at position 3 and appears 3 times in total.
Given the length N, print the lexicographically smallest ideal string of length N. If no such string exists, print -1.
The first line contains a natural number N. (1 <= N <= 100)
Print the answer string on one line.