N = gets.to_i


v = 2

while true
	x = v * (v - 1) / 2
	if x == N
		break
	elsif x > N
		puts "No"
		exit
	end
	v += 1
end

puts x

table = x.times.collect{[]}

#p table
n = 1
v.times{|i|
	v.times{|j|
		if i < j
			table[i] << n
			table[j] << n
			n += 1
		end
	}
}
table.each{|list|
	puts "#{list.length} " + list.join(" ")
}

