Problem Description

Sort n strings by length, and for equal length sort lexicographically.

Input Format

First n. Next n lines strings.

Output Format

n lines sorted.

Sample Test Case

Input:
4 pear apple kiwi fig
Output:
fig kiwi pear apple

Constraints

n

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next