program main
implicit None
	integer(8)::n,i,p,a(314),s,k,x
	integer(8),allocatable::b(:,:)
	
	do i = 2,315
		a(i-1) = i*(i + 1)
	enddo
	
	read *,n
	
	p = 0
	i = 1
	do while(a(i) <= 2*n)
		if(a(i) == 2*n)then
			p = 1
		endif
		i = i + 1
	enddo
	
	if(p == 0)then
		print 101,"No"
		stop
	endif
	
	allocate(b(i,i+1))
	b = 0
	s = 1
	k = 0
	
	do while(s <= i)
	do p = s,i
		b(s,p) = p+k
		b(p+1,s) = p+k
	enddo
	s = s + 1
	k = b(s,i+1)
	enddo
	
	print 101,i + 1
	
	do x = 1,i + 1
	print 102,i,b(:,x)
	enddo
	
101 format(a)
102 format(400i0,1x)
end program main