""" 300 ならできる n = int(k ** 0.5), m = k // n としたときに [2] * n + [3] * m + [6] + [7] * (k - n * m) 9998 = 99 * 100 + 98 3, 8, 1, 7, 24 でできるか [3] * a + [8] * b + [1] * c + [7] * d + [24] としたときに a * b + c * (c - 1) // 2 + d """ def solve(k): a = 100 b = k // a k -= a * b c = 0 while c * (c + 1) // 2 <= k: c += 1 k -= c * (c - 1) // 2 d = k ans = [3] * a + [8] * b + [1] * c + [7] * d + [24] return ans k = int(input()) ans = solve(k) print(len(ans)) print(*ans)