#include<stdio.h>
#include<stdlib.h>

int insertion_sort(int *A, int n, int g){
    int i, j, v;
    int cnt = 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;
            cnt++;
        }
        A[j+g] = v;
    }
    return cnt;
}

int shell_sort(int *A, int n, int m, int* G){
    int cnt=0, i;
    for(i=0;i<m;i++){
        cnt += insertion_sort(A, n, G[i]);
    }
    return cnt;
}

int main(){
    int n, r[1000000];
    int i;
    int res;
    
    int m;
    int *G;

    m = 1;
    G = (int *)malloc(m * sizeof(int));
    for(i=0;i<m;i++){
        G[i] = 1;
    }

    scanf("%d", &n);
    for(i=0;i<n;i++) scanf("%d", &r[i]);
    
    res = shell_sort(r, n, m, G);
    
    printf("%d\n", m);
    for(i=0;i<m-1;i++) printf("%d ", G[i]);
    printf("%d\n", G[m-1]);
    printf("%d\n", res);
    for(i=0;i<n;i++) printf("%d\n", r[i]);

    return 0;
}