Input
The input consists of several lines ending with a line with a single hashtag sign #.
- The first line contains the letters of the alphabet with a new order. The position in the line defines the order from left to right. - The following lines contain a single word.
Output
The output prints in a single line the words ordered according to the new alphabetical order.
Input
xdhwjtklnoapqersuivmygzbcf me here crazy is alphabet world making hello this hereafter #
Output
hello here hereafter world this alphabet is making me crazy