Problem
Input format
The first line contains `n`. Each of the following `n` lines contains a word (at most `30` characters) and its frequency, separated by a space. - `1 <= n <= 100` - frequency is between `1` and `1000000` - words are unique and consist of lowercase or uppercase letters
Output format
The program prints `n` lines, each containing the word and its frequency separated by a space, in the required order.
Example
4 mar 2 para 5 cais 5 prun 1
cais 5 para 5 mar 2 prun 1
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
4 mar 2 para 5 cais 5 prun 1
cais 5 para 5 mar 2 prun 1
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.