Frog studies algorithms on strings. He finds it so interesting that he can't stop playing with his strings. These days he has just learnt about palindrome, and comes up with a problem about it.
Given two integers, $N$ and $M$, he wants to construct a string of length $N$, whose substrings contain exactly $M$ distinct non-empty palindromes. A palindrome is a string which is exactly the same as the reverse of itself. For example, “ABBA”, “ADA”, “A”, and “UUSSUU” are palindromes, but “USTC”, “AB”, and “ABC” are not. A substring is a consecutive part of the original string. For example, “US”, “USTC”, “STC”, and “TC” are substrings of “USTC”, but “UC” and “CT” are not.
Frog finds it too hard for him to solve this problem. So he asks you for help. BTW, he won't make it too easy for you, so he decided to ask you solve this problem under his restrictions. You can only use the first $K$ capital letters in the English alphabet $(A-Z)$. Please write a program to solve this problem.