// editor1
#include <stdio.h>

void shellsort(int arr{}, int n){
    int gap=n/2;
    while(gap>0){
        for(int i=gap; i< n; i++){
            int temp=arr[i];
            int j=i;
            while(j>=gap && arr[j -gap]<temp){
                arr[j]=arr[j-gap];
                j-=gap;
            }
            arr[j]=temp;
        }
        gap /= 2;
    }
    
}
void printArray(int arr[], int n){
    for(int i=0; i<n; i++){
        printf("%d", arr[i]);
    }
    print("\n");
}
int main(){
    int n;
    printf("Enter the number of boxes: ");
    scanf("%d", &n);
    
    int weights[n];
    printf("Enter the weights of the boxes: ");
    for(int i=0; i<n; i++){
        scanf("%d",&weights[i]);
    }
    shellsort(weights, n);
    printf("Weights in descending order: ");
    printArray(Weights, n);
    
    return 0;
}