#135Easy
Ages
Time: 1 s · Memory: 256 MB
- Sorting
Statement
You are given the ages of residents. Every age is an integer from to . Print the ages in increasing order.
Input format
The first line contains (). The second line contains integers ().
Output format
A single line with numbers — the sorted ages.
Examples
Input
6 25 7 25 64 1 7
Output
1 7 7 25 25 64
Note
When the range of values is small, you can sort without comparisons — counting sort. Count in an array cnt of elements how many times each age occurs, then for print exactly cnt[v] times. This is — faster than .
Source: UVa 11462.
