#include<iostream> #include<cstring> using namespace std; int arr[101]; int Partition(int A[],int low,int high){ A[0]=A[low]; while(low<high){ while(low<high && A[high]>=A[0])--high; A[low]=A[high]; while(low<high && A[low]<=A[0]) ++low; A[high]=A[low]; } A[low]=A[0]; return low; } void QuickSort(int A[],int low,int high){ if(low<high){ int pivotpos=Partition(A,low,high); QuickSort(A, low,pivotpos-1); QuickSort(A,pivotpos+1,high); } } int main(){ int n; while(cin>>n && n){ memset(arr,0,101); for(int i=1;i<=n;i++){ cin>>arr[i]; } QuickSort(arr, 1, n); for(int i=1;i<=n;i++){ cout<<arr[i]<<" "; } } }