From A to Z X67052


Statement
 

pdf   zip

html

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.

Public test cases
  • Input

    xdhwjtklnoapqersuivmygzbcf
    me
    here
    crazy
    is
    alphabet
    world
    making
    hello
    this
    hereafter
    #
    

    Output

    hello here hereafter world this alphabet is making me crazy
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    Haskell Python