#include <stdio.h>
#define N 100000000

int insertionSort(int n,int g);
int shellSort(int n);

int A[N];
int G[2]={4,1};
int cnt = 0,m = 2;    //m=2??¨??????; //G[]????????????m??????????????????????????´

int main(){
	int i,j,n;
	scanf("%d",&n);
	for(i=0; i<n; i++){
		scanf("%d",&A[i]);
	}
	
	cnt = shellSort(n);
	
	printf("%d\n",m);
	for(i=0; i<m-1; i++){
	printf("%d ",G[i]);
	}
	printf("%d\n",G[m-1]);
	printf("%d\n",cnt);
	for(i=0; i<n; i++) printf("%d\n",A[i]);

return 0;

}


int insertionSort(int n,int g){
	int v,i,j;
	for(i=0; i<n; i++){
		v = A[i];
		j = i - g;
		while(j >= 0 && A[j] > v){
			A[j+g] = A[j];
			j = j-g;
			cnt++;
			A[j+g] = v;
		}
	}
return cnt;
}


int shellSort(int n){
	int i;
	for(i=0; i<m; i++){
		cnt = insertionSort(n,G[i]);
	}
return cnt;
}