You are developing a new feature for the website which sells airline tickets: being able to sort tickets by price! You have already extracted the tickets' prices, so there's just the last step to be done...

You are given an array of integers. Sort it in non-descending order.


-----Input-----

The input consists of a single line of space-separated integers. The first number is n (1 ≤ n ≤ 10) — the size of the array. The following n numbers are the elements of the array (1 ≤ a_{i} ≤ 100).


-----Output-----

Output space-separated elements of the sorted array.


-----Example-----
Input
3 3 1 2

Output
1 2 3 



-----Note-----

Remember, this is a very important feature, and you have to make sure the customers appreciate it!

Difficulty: HARD
Tags: Implementation

Starter code:

Solutions:
import time
t0 = time.time()
while time.time() - t0 < 1:
	continue
print(*sorted(list(map(int, input().split()))[1:]))


arr = input().split()[1:]
import time
current_milli_time = lambda : int(round(time.time() * 1000))
s = current_milli_time()
for i in range(len(arr)):
	for j in range(len(arr) - i - 1):
		if int(arr[j]) > int(arr[j + 1]):
			(arr[j], arr[j + 1]) = (arr[j + 1], arr[j])
while current_milli_time() - s <= 1.5 * 1000:
	pass
print(' '.join(arr))


l = list(map(int, input().split()))
n = l[0]
del l[0]
a = 0
for i in range(10 ** 7):
	a += 1
l.sort()
print(*l)


a = input()[2:]
n = [0 for i in range(1000000)]
g = 123
for i in range(130000):
	g *= 3
a = list(map(int, a.split()))
x = [0 for _ in range(len(a))]
for i in range(len(x)):
	x[i] = min(a)
	a.remove(x[i])
for o in x:
	print(o, end=' ')


a = [int(x) for x in input().split()]
del a[0]
k = 7777777 ** 66666
k = 7777777 ** 66666
k = 7777777 ** 66666
k = 7777777 ** 66666
k = 7777777 ** 66666
print(*sorted(a))


a = 123 ** 511211
print(*sorted(list(map(int, input().split()))[1:]))


from random import randint
xs = list(map(int, input().split()))[1:]
for _ in range(8 * 10 ** 5):
	randint(3, 10)
print(' '.join(map(str, sorted(xs))))


import time
kal = list(map(int, input().split()))
p = kal[1:]
kaleee = []
for i in range(6300):
	kaleee.append(i)
	kaleee.count(i)
p.sort()
for i in p:
	print(i, end=' ')


for i in range(30000000):
	1 + 1
print(*sorted(list(map(int, input().split()))[1:]))


import time
a = list(map(int, input().split()))[1:]
now = time.time()
a.sort()
a = [str(x) for x in a]
x = 1
while time.time() - now < 1:
	x += 1
print(' '.join(a), end='')


import time
now = time.time()
while time.time() < now + 0.987:
	pass
for i in sorted(list(map(lambda x: int(x), input().split()))[1:]):
	print(i, end=' ')


def doStuff():
	l = []
	for i in range(4000000):
		l.append(i * i % 123)
	l.sort()
doStuff()
s = list(map(int, input().split(' ')))[1:]
s.sort()
s = list(map(str, s))
ans = ' '.join(s)
print(ans)


import sys
for i in range(10 ** 6):
	sys.stderr.write(str(i))
print(' '.join(map(str, sorted(list(map(int, input().split()[1:]))))))


import time

def busy_wait(dt):
	current_time = time.time()
	while time.time() < current_time + dt:
		pass
a = list(map(int, input().split()))
a = a[1:]
busy_wait(1.8)
a.sort()
w = len(str(max(a)))
print(a[0], end='')
for x in a[1:]:
	print(str(x).rjust(w + 1), end='')
print()


a = list(map(int, input().split()))[1:]
a.sort()
for i in range(3 * 10 ** 7):
	continue
print(*a)


import time
start_ = time.time()
(n, *a) = input().split()
a = list(map(int, a))
print(' '.join((str(ch) for ch in sorted(a))))
while True:
	if time.time() - start_ > 1.7:
		break


cnt = 1234 ** 456789
print(*sorted([*map(int, input().split())][1:]))


a = list(map(int, input().split()))
n = a[0]
a = sorted(a[1:])
x = 1234 ** 500000
for i in range(n):
	print('{} '.format(a[i]), end='')
print('')


a = list(map(int, input().split()))
b = a[1:]
b.sort()
n = 0
for i in range(10000000):
	n += 1
for i in b:
	print(i, end=' ')


import time
t = time.time() + 1.9
a = [int(i) for i in input().split(' ') if i]
a = a[1:a[1] + 1]
a.sort()
while time.time() < t:
	pass
for i in a:
	print(i, end=' ')
print()


a = [int(x) for x in input().split()][1:]
a.sort()
res = 0
for i in range(7000000):
	res ^= i
print(' '.join([str(x) for x in a]))


import sys
import time
for line in sys.stdin:
	for i in range(20000000):
		j = i
	vec = line.split()
	val = [str(y) for y in sorted([int(x) for x in vec[1:]])]
	print(' '.join(val))


import time
import random
l = list(map(int, input().split()))
assert len(l) == l[0] + 1
l = l[1:]
l.sort()
v = [0 for i in range(10 ** 4)]
for i in range(4 * 10 ** 5):
	v[random.randrange(0, len(v))] = random.randrange(-1000, 1000)
print(' '.join(map(str, l)))


import collections as col
import itertools as its
import sys
import operator
from bisect import bisect_left, bisect_right
from copy import copy, deepcopy
from time import sleep

class Solver:

	def __init__(self):
		pass

	def solve(self):
		a = list(map(int, input().split()))
		n = a[0]
		a = a[1:]
		c = 0
		for i in range(10 ** 7):
			c += i
		print(' '.join(map(str, sorted(a))))

def __starting_point():
	s = Solver()
	s.solve()
__starting_point()


x = list(map(int, input().split()))[1:]
s = 1
for i in range(10000000):
	s *= i
print(*sorted(x))


from time import time
initial = time()
while time() - initial < 1:
	continue
a = sorted(list(map(int, input().split()))[1:])
print(*a, sep=' ')


def main():
	try:
		while True:
			for i in range(int(30000000.0)):
				pass
			print(*sorted(map(int, input().split()[1:])))
	except EOFError:
		pass
main()


a = [int(i) for i in input().split()][1:]
for i in range(15000000):
	b = 1 == 1
print(*sorted(a))


import time
li = list(map(int, input().split()))
n = li.pop(0)
li.sort()
for i in range(20000000):
	s = 0
print(' '.join(map(str, li)))


import time
now = time.time()
a = list(map(int, input().split()))
len = a[0]
a = a[1:]
a.sort()
while time.time() < now + 0.987:
	pass
for i in range(len):
	print(a[i], end=' ')


for i in range(0, int(30000000.0)):
	pass
print(' '.join([str(i) for i in sorted([int(x) for x in input().split(' ')[1:]])]))


import time
a = input().split()
n = int(a[0])
del a[0]
a = map(int, a)
a = sorted(a)
b = [10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30, 10, 30]
for i in range(2500000):
	b = b * i
	sorted(b)
for i in range(len(a)):
	print(a[i], end=' ')