1704 - DS_19_CHEN_QUIZ5 (CS2351) Scoreboard

Time

2019/06/03 18:30:00 2019/06/03 20:20:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12313 Secret Codes Quiz

12313 - Secret Codes Quiz   

Description

You will be given a text and a word. You should:

  1. Calculate the character distribution in the text  and sort it using stable ascending sort (from low to high).
  2.  Reorder the word using the character distribution order.

Input

  • The first line of input contains a single positive integer n (number of lines of the text) and a word, separated by a comma, followed by newline
  • The next n lines contains zero or more characters(with whitespace), they all end in newlines. This will be the text.

Output

The reordered word using the character distribution order, followed by a new line

Sample Input  Download

Sample Output  Download

Tags




Discuss