#include<stdio.h>

int cnt = 0;
int g[2]={1,4};
//int g[9]={1,4,13,40,121,364,1093,3280,9841};


void insertion(int *a,int n,int g){
  int i,j,k,v;
  for(i=g;i<n;i++){
    v=a[i];
    j=i-g;
    while(j>=0 && a[j]>v){
      a[j+g]=a[j];
      j-=g;
      cnt++;
    }
    a[j+g]=v;
  }
}

void shellsort(int *a,int n){
  int i;

  for(i=8;i>=0;i--){
    insertion(a,n,g[i]);
  }
}

int main(){
  int a[1000000],n,i;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }

  shellsort(a,n);

  printf("%d\n",2);
  for(i=1;i>=0;i--){
    printf("%d ",g[i]);
  }

  printf("\n%d\n",cnt);
  for(i=0;i<n;i++){
    printf("%d\n",a[i]);
  }
}
