A boy, whose ID is smzzl, loves solving problems on Codeforces. Some day, he was solving the following problem:
Given a string $S$, find the lexicographical-smallest string $T$, whose lexicographical order is no smaller than $S$, the times each letter appears in $T$ are multiples of $k$, and $|S|=|T|$.
"The problem is too easy! I want a harder one!"
So, he modified the problem. He no longer requires the times each letter appears in $T$ to be a multiple of $k$. Instead, he wants them to be a factor of $k$ or 0.
The problem actually becomes harder, but not so much harder. Fall, the teammate of smzzl, solved it immediately! And now, Fall wants you to solve it, so he can check his answer.