#include <stdio.h>

#define MAX 1000000

void shellSort(int A[], int n);
void insertionSort(int A[], int n, int g);

int A[MAX];
int cnt = 0;
int m = 1;
int G[] = {1};

int main(void) {
  int n;
  scanf("%d", &n);

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

  shellSort(A, n);

  printf("%d\n", m);
  for(int i=0; i<m; ++i) {
    if(i != m-1) printf("%d ", G[i]);
    else  printf("%d\n%d\n", G[i], cnt);
  }

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

  return 0;
}

void shellSort(int A[], int n) {

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

void insertionSort(int A[], int n, int g) {
  int v, j;

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

