import sys

n = int(input())
if n == 1:
	G = [1]
else:
	G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n]
	while True:
		g = int(2.25 * G[-1])
		if g > n:
			break
		G.append(g)
	G.reverse()

A = list(map(int, sys.stdin))
cnt = 0
for g in G:
	for j, v in enumerate(A[g:]):
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		A[j+g] = v

print(len(G))
print(*G)
print(cnt)
for a in A:
	print(a) import sys sys n = int(input()) n int(input()) int input() input if n == 1:
	G = [1]
else:
	G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n]
	while True:
		g = int(2.25 * G[-1])
		if g > n:
			break
		G.append(g)
	G.reverse() n == 1 n 1 G = [1] G [1] 1 g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n g [1, 4, 10, 23, 57, 132, 301, 701] 1 4 10 23 57 132 301 701 g < n g n if g < n g G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n] G [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n] while True:
		g = int(2.25 * G[-1])
		if g > n:
			break
		G.append(g)
	 True g = int(2.25 * G[-1]) g int(2.25 * G[-1]) int 2.25 * G[-1] 2.25 G[-1] G -1 if g > n:
			break
		 g > n g n break G.append(g) G.append G append g G.reverse() G.reverse G reverse A = list(map(int, sys.stdin)) A list(map(int, sys.stdin)) list map(int, sys.stdin) map int sys.stdin sys stdin cnt = 0 cnt 0 for g in G:
	for j, v in enumerate(A[g:]):
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		A[j+g] = v g G for j, v in enumerate(A[g:]):
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		A[j+g] = v j v enumerate(A[g:]) enumerate A[g:] A g: g while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		 j >= 0 and A[j] > v j >= 0 j 0 A[j] > v A[j] A j v A[j+g] = A[j] A[j+g] A j+g j g A[j] A j j -= g j g cnt += 1 cnt 1 A[j+g] = v A[j+g] A j+g j g v print(len(G)) print len(G) len G print(*G) print *G G print(cnt) print cnt for a in A:
	print(a) a A print(a) print a cnt += 1 1 cnt g = int(2.25 * G[-1]) int(2.25 * G[-1]) g G = [1] [1] G j -= g g j n = int(input()) int(input()) n A = list(map(int, sys.stdin)) list(map(int, sys.stdin)) A cnt = 0 0 cnt G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n] [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n] G
import sys

n = int(input())
if n == 1:
	G = [1]
else:
	G = [g for g in [1, 4, 10, 23, 57, 132, 301, 701] if g < n]
	while True:
		g = int(2.25 * G[-1])
		if g > n:
			break
		G.append(g)
	G.reverse()

A = list(map(int, sys.stdin))
cnt = 0
for g in G:
	for j, v in enumerate(A[g:]):
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j -= g
			cnt += 1
		A[j+g] = v

print(len(G))
print(*G)
print(cnt)
for a in A:
	print(a)
