#include <stdio.h>

int main( ){
    int n;
    scanf("%d", &n);
    int A[n];
    int i;
    for(i=0;i<n;i++)
    	scanf("%d", A+i);
    printf("3\n");
    printf("13 4 1\n");
    shellSort(A, n);
    for(i=0;i<n;i++){
    	printf("%d\n", A[i]);
    }
}

int insertionSort(A, n, g){

	int i,j,count=0;

	for(i=g;i<n;i++){
		v = A[i];
		j = i - g;
		while(j>0&&A[j]>v){
			A[j+g] = A[j];
			j = j - g;
			count++;
		}
		A[j+g] = v;
	}

	return count;
}

void shellSort(A, n){

	int count = 0;
	m = 3;
	int G[m] = [13,4,1];

	int i;
	for(i=0;i<m;i++){
		count += insertionSort(A, n, G[i]);
	}
}
