Given a string, an operation consists of either adding, changing, or removing one letter. The string must change.
Given an alphabet and an original string, compute all strings which are attainable from that string using one operation.
Constraints
Input Specification
The first line contains a string of lowercase letters, the alphabet of letters to use.
The second line contains the original string .
Output Specification
Output all such strings in sorted order.
Sample Input
eg
egg
Sample Output
eeg
eegg
eg
ege
egeg
egge
eggg
gegg
gg
ggg
Comments