After grading too many tests, Mr. DeMello decided to start grading strings instead.
Mr. DeMello has the correct
Now, Mr. DeMello considers all possible a
and z
have a distance of
Since Mr. DeMello knows all his students will get a score of at most
Input Specification
The first line will contain
The second line will contain
Output Specification
Output all possible strings in sorted alphabetical order (e.g., abc
should appear before bac
).
Sample Input
1
abcd
Sample Output
aacd
abbd
abcc
abcd
abce
abdd
accd
bbcd
zbcd
Comments