#c22104. 排序5
排序5
Sorting 5
Problem Description
Given positive integers , sort them from small to large and output them. Also output the rank of each original number after sorting (for equal numbers, the one with the smaller original index comes first).
Input Format
The first line is an integer , the number of values.
The next line contains integers .
Output Format
The first line contains integers: the sorted result.
The second line contains integers: the rank of each original number after sorting.
Sample Input
5
3 9 5 3 2
Sample Output
2 3 3 5 9
2 5 4 3 1
Constraints
For of the data, and .