Sorting :)

Given a list of n numbers, sort them and output them one per line from smallest to largest

Input

The first line of the input contains a positive integer n no greater than 100, the number of numbers to follow.

Each line after will have a single positive integer less than 32000

Output

Output the numbers in sorted order from smallest to largest, one per line.

Sample Input

4
4
3
2
1

Sample Output

1
2
3
4

All Submissions
Best Solutions


Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2011

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)


The input is on multiple lines...

Also, please refrain from writing actual code in comments. Admins (and in fact, people who've solved the problem) are able to look at your submissions and decide to help or not.

Python 2's
list.sort()
is the best method

If your goal is to get points, then sure!

If your goal is to learn how to sort, then maybe not so much ...

I have used two different way to sort the integers;
all passed case #1;
but both got 4 in case #2?
how is this happened?
sort:
9 8 7 6 5 4 1 2 3 10 10 3 2 3 4 1 4
to:
1 2 3 4 5 6 7 8 9 10
i think these data include all possible case of this problem......

9 8 7 6 5 4 1 2 3 10 10 3 2 3 4 1 4

should actually be sorted to become
1 1 2 2 3 3 3 4 4 4 5 6 7 8 9 10 10

omg... i did totally wrong... thx :)

cant see the analysis(actual input data) for this question? Not understanding why is my code not working properly for the second test case...

The numbers are not guaranteed to be unique.

I did the remove the same number part, and I got OK for the first test case which contains the same number too...

I've looked at each of your submissions, and aside from the first, which got WA for output format but nothing else, you've always kept a line that filters out numbers that you've already seen.

Specifically, that would be this line:
    if each not in new:


As an aside, no, the first case contains all unique numbers.



I recommend just doing some research on how sorting can be done.