from random import randint
N=5
A = [randint(1,100) for i in range(N)]
print("A = ", A)
def sort(A):	
	str = range(len(A) - 1)		
	while True:
		for j in (str, reversed(str)):
			swapped = False
			for i in j:
				if A[i] > A[i+1]:  
					A[i], A[i+1] =  A[i+1], A[i]
					swapped = True
			if not swapped:
				return A

B = sort(A)
print(B)