#!python # -*- coding: utf-8 -*- def main(): K = int(input()) if K > 5000: i = 0 n = 0 while n + i + 1 < K: i += 1 n += i s = ('1 ' * (i + 1) + '3 3 ' + '8 ' * ((K - n) // 2) + '6 7' * ((K - n) % 2))[:-1] print(i + 1 + 2 + (K - n) // 2 + ((K - n) % 2) * 2) print(s) return i = 0 n = 0 while n + i + 1 <= K: i += 1 n += i s = ('1 ' * (i + 1) + '5 ' + '8 ' * (K - n))[:-1] print((len(s) + 1) // 2) print(s) if __name__ == '__main__': main()