For this Question: You will be given an array A of n integers, you need to rearrange the array to the lexicographically smallest array such that the elements of array appear in the following manner:
A[0] >= A[1] <= A[2] >= A[3] <= A[4] ....The first line of input contains an integer n, the number of elements in array.
The next line contains n integers, the elements of the array.

Constraints
1 <= n <= 100000
1 <= A[i] <= 1000000000Output the required array with space separated integers.Sample Input
4
3 2 1 4

Sample Output
2 1 4 3

Explanation
Other possible array satisfying the condition is [4 1 3 2] but that is not lexicographically smallest., I have written this Solution Code: n = int(input())
nums = list(map(int,input().split()))
nums.sort()

for i in range(0,n-1,2):
	print(nums[i+1],nums[i],end=" ")

if n%2 != 0:
	print(nums[n-1]), In this Programming Language: Python, Now tell me if this Code is compilable or not?