#include <stdio.h>
#define N 1000000

int cnt;

void insertionSort(int *A, int n, int g){
  int i, j;
  for(i = g; i < n - 1; i++){
    int 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;
  }
}

void shellSort(int *A, int n){
  cnt = 0;
  int m = 6, i;
  int G[] = {103, 25, 13, 4, 3, 1};
  printf("%d ", m);
  for(i = 0; i < m; i++){
    printf("%d", G[i]);
    printf((i == m - 1) ? "" : " ");
  }
  printf("\n");
  for(i = 0; i < m; i++)
    insertionSort(A, n, G[i]);
}

int main(void){
  int i, a[N], n;
  scanf("%d", &n);
  for(i = 0; i < n; i++)
    scanf("%d", &a[i]);
  shellSort(a, n);
  printf("%d\n", cnt);
  for(i = 0; i < n; i++)
    printf("%d\n", a[i]);
  return 0;
}