Vasya has his favourite number $n$. He wants to split it to some non-zero digits. It means, that he wants to choose some digits $d_1, d_2, \ldots, d_k$, such that $1 \leq d_i \leq 9$ for all $i$ and $d_1 + d_2 + \ldots + d_k = n$.

Vasya likes beauty in everything, so he wants to find any solution with the minimal possible number of different digits among $d_1, d_2, \ldots, d_k$. Help him!


-----Input-----

The first line contains a single integer $n$ — the number that Vasya wants to split ($1 \leq n \leq 1000$).


-----Output-----

In the first line print one integer $k$ — the number of digits in the partition. Note that $k$ must satisfy the inequality $1 \leq k \leq n$. In the next line print $k$ digits $d_1, d_2, \ldots, d_k$ separated by spaces. All digits must satisfy the inequalities $1 \leq d_i \leq 9$.

You should find a partition of $n$ in which the number of different digits among $d_1, d_2, \ldots, d_k$ will be minimal possible among all partitions of $n$ into non-zero digits. Among such partitions, it is allowed to find any. It is guaranteed that there exists at least one partition of the number $n$ into digits.


-----Examples-----
Input
1

Output
1
1 
Input
4

Output
2
2 2

Input
27

Output
3
9 9 9



-----Note-----

In the first test, the number $1$ can be divided into $1$ digit equal to $1$.

In the second test, there are $3$ partitions of the number $4$ into digits in which the number of different digits is $1$. This partitions are $[1, 1, 1, 1]$, $[2, 2]$ and $[4]$. Any of these partitions can be found. And, for example, dividing the number $4$ to the digits $[1, 1, 2]$ isn't an answer, because it has $2$ different digits, that isn't the minimum possible number.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation

Constructive algorithms


Solutions:
a = int(input())
if a % 9 == 0:
	print(a // 9)
	for i in range(a // 9):
		print(9, end=' ')
elif a % 8 == 0:
	print(a // 8)
	for i in range(a // 8):
		print(8, end=' ')
elif a % 7 == 0:
	print(a // 7)
	for i in range(a // 7):
		print(7, end=' ')
elif a % 6 == 0:
	print(a // 6)
	for i in range(a // 6):
		print(6, end=' ')
elif a % 5 == 0:
	print(a // 5)
	for i in range(a // 5):
		print(5, end=' ')
elif a % 4 == 0:
	print(a // 4)
	for i in range(a // 4):
		print(4, end=' ')
elif a % 3 == 0:
	print(a // 3)
	for i in range(a // 3):
		print(3, end=' ')
elif a % 2 == 0:
	print(a // 2)
	for i in range(a // 2):
		print(2, end=' ')
else:
	print(a // 1)
	for i in range(a // 1):
		print(1, end=' ')


def split_digits(n):
	if n % 2 == 0:
		return [2] * (n // 2)
	elif n % 3 == 0:
		return [3] * (n // 3)
	elif n % 5 == 5:
		return [5] * (n // 5)
	else:
		return [1] * n
n = int(input())
digits = split_digits(n)
print(len(digits))
print(' '.join(map(str, digits)))


n = int(input())
print(n, '1 ' * n)


n = int(input())
f = 0
for i in range(9, 0, -1):
	if n % i == 0:
		f = 1
		break
if f == 0:
	print(1)
	print(n)
else:
	print(n // i)
	print(*n // i * str(i).split())


n = int(input())
for i in range(9, 0, -1):
	(q, r) = divmod(n, i)
	if r == 0:
		print(q)
		print('{} '.format(i) * q)
		break


n = int(input())
a = [1] * n
print(n)
print(*a)


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		print(n // i)
		for j in range(n // i):
			print(i, end=' ')
		exit()


N = int(input())
print(N)
print(*[1] * N)


def int_lst_input():
	return [int(val) for val in input().split()]

def int_input():
	return int(input())

def print_lst(lst):
	print(' '.join([str(val) for val in lst]))

def solve():
	n = int_input()
	print(n)
	print(' '.join(['1' for _ in range(n)]))
solve()


n = int(input())
print(n)
ans = [1] * n
print(*ans)


n = int(input())
i = 9
while i > 0:
	if n % i == 0:
		print(n // i)
		for j in range(n // i):
			print(i, end=' ')
		break
	else:
		i -= 1


x = int(input())
l = []
for i in range(9, 1, -1):
	if x % i == 0 and x != i:
		c = x // i
		p = i
		break
	else:
		c = x
		p = 1
for i in range(c):
	l.append(p)
print(len(l))
for i in l:
	print(i, end=' ')


n = int(input())
a = []
print(n)
for i in range(n):
	a.append(1)
print(*a)


def answer():
	a = int(input())
	print(a)
	print('1 ' * (a - 1) + '1')
answer()


from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial
from random import randint

def solution(n):
	for i in range(1, 10):
		if n % i == 0:
			stdout.write(str(n // i) + '\n')
			for j in range(n // i):
				stdout.write(str(i) + ' ')
			break
	else:
		stdout.write(str(n // 9 + 1) + '\n')
		for j in range(n // 9):
			stdout.write(str(9) + ' ')
		stdout.write(str(n % 9))
n = int(stdin.readline())
solution(n)


N = int(input())
ans2 = N
ans = 1
if N % 2 == 0:
	ans2 = int(N / 2)
	if ans2 == 1:
		ans = 1
		ans2 = N
	else:
		ans = 2
if N % 3 == 0:
	ans2 = int(N / 3)
	if ans2 == 1:
		ans = 1
		ans2 = N
	else:
		ans = 3
if N % 4 == 0:
	ans2 = int(N / 4)
	if ans2 == 1:
		ans = 2
		ans2 = 2
	else:
		ans = 4
if N % 5 == 0:
	ans2 = int(N / 5)
	if ans2 == 1:
		ans = 1
		ans2 = N
	else:
		ans = 5
if N % 6 == 0:
	ans2 = int(N / 6)
	if ans2 == 1:
		ans = 3
		ans2 = 2
	else:
		ans = 6
if N % 7 == 0:
	ans2 = int(N / 7)
	if ans2 == 1:
		ans = 1
		ans2 = N
	else:
		ans = 7
if N % 8 == 0:
	ans2 = int(N / 8)
	if ans2 == 1:
		ans = 4
		ans2 = 2
	else:
		ans = 8
if N % 9 == 0:
	ans2 = int(N / 9)
	if ans2 == 1:
		ans = 3
		ans2 = 3
	else:
		ans = 9
print(ans2)
for i in range(ans2):
	print(ans, end=' ')


n = int(input())
print(n)
while n != 0:
	print(1, end=' ')
	n = n - 1


i = int(input())
print(i)
print('1 ' * i)


n = int(input())
l = []
for i in range(1, 10):
	if n % i == 0:
		l.append(i)
if n < 10 and n > 1:
	p = min(l)
	l.remove(p)
	x = min(l)
else:
	x = max(l)
s = int(n / x)
print(s)
for i in range(s):
	print(x, end=' ')


n = int(input())
print(f"{n}\n{'1 ' * n}")


n = int(input())
print(n)
print('1', end='')
print(' 1' * (n - 1))


n = int(input())
print(str(n))
print(*['1' for i in range(n)], sep=' ')


x = int(input())
print(x)
for i in range(x):
	print(1, end=' ')


a = int(input())
if a % 2 == 0:
	print(int(a / 2))
	[print(2, end=' ') for x in range(int(a / 2))]
elif a % 3 == 0:
	print(int(a / 3))
	[print(3, end=' ') for x in range(int(a / 3))]
else:
	print(a)
	[print(1, end=' ') for x in range(a)]


m = int(input())
t = 0
for i in range(9, 1, -1):
	if m % i == 0:
		k = int(m / i)
		l = i
		t = 1
		break
if t == 0:
	print(m)
	for i in range(m):
		print(1, end=' ')
if t == 1:
	print(k)
	for i in range(k):
		print(l, end=' ')


n = int(input())
c = 0
for i in range(9, 0, -1):
	if n % i == 0:
		c = i
		break
if c != 0:
	arr = [c] * (n // c)
	print(n // c)
	for i in arr:
		print(i, end=' ')
	print()
else:
	arr = [9] * (n // 9)
	arr.append(n % 9)
	print(n // 9 + 1)
	for i in arr:
		print(i, end=' ')
	print()


n = int(input())
lst = ['1'] * n
print(n)
print(' '.join(lst))


import sys
from math import *
from copy import copy
import pdb
n = int(input())
print(n)
for i in range(n):
	print(1)


n = int(input())
print(n)
k = [1] * n
print(*k)


import math
import bisect
import itertools
import sys
I = lambda : sys.stdin.readline()
mod = 10 ** 9 + 7

def mindiff(a):
	b = a[:]
	b.sort()
	m = 10000000000
	for i in range(len(b) - 1):
		if b[i + 1] - b[i] < m:
			m = b[i + 1] - b[i]
	return m

def lcm(a, b):
	return a * b // math.gcd(a, b)

def merge(a, b):
	i = 0
	j = 0
	c = 0
	ans = []
	while i < len(a) and j < len(b):
		if a[i] < b[j]:
			ans.append(a[i])
			i += 1
		else:
			ans.append(b[j])
			c += len(a) - i
			j += 1
	ans += a[i:]
	ans += b[j:]
	return (ans, c)

def mergesort(a):
	if len(a) == 1:
		return (a, 0)
	mid = len(a) // 2
	(left, left_inversion) = mergesort(a[:mid])
	(right, right_inversion) = mergesort(a[mid:])
	(m, c) = merge(left, right)
	c += left_inversion + right_inversion
	return (m, c)

def is_prime(num):
	if num == 1:
		return False
	if num == 2:
		return True
	if num == 3:
		return True
	if num % 2 == 0:
		return False
	if num % 3 == 0:
		return False
	t = 5
	a = 2
	while t <= int(math.sqrt(num)):
		if num % t == 0:
			return False
		t += a
		a = 6 - a
	return True

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1

def binsearch(arr, b, low, high):
	if low == high:
		return low
	if arr[math.ceil((low + high) / 2)] < b:
		return binsearch(arr, b, low, math.ceil((low + high) / 2) - 1)
	else:
		return binsearch(arr, b, math.ceil((low + high) / 2), high)

def ncr1(n, r):
	s = 1
	for i in range(min(n - r, r)):
		s *= n - i
		s %= mod
		s *= pow(i + 1, mod - 2, mod)
		s %= mod
	return s

def calc(n, m, r):
	s = 0
	for i in range(0, r + 1, 2):
		s += ncr1(n, i) * ncr1(m, i)
		s %= mod
	return s
n = int(input())
print(n)
print('1 ' * n)


n = int(input())
print(n)
for i in range(n):
	print(1, end=' ')


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		print(n // i)
		print((str(i) + ' ') * (n // i))
		break


n = int(input())
print(n)
ls = [1] * n
print(*ls)


n = int(input())
if n <= 9:
	print('1')
	print(n)
elif n % 7 == 0:
	print(int(n / 7))
	for i in range(int(n / 7) - 1):
		print('7', end=' ')
	print('7')
elif n % 5 == 0:
	print(int(n / 5))
	for i in range(int(n / 5) - 1):
		print('5', end=' ')
	print('5')
elif n % 3 == 0:
	print(int(n / 3))
	for i in range(int(n / 3) - 1):
		print('3', end=' ')
	print('3')
elif n % 2 == 0:
	print(int(n / 2))
	for i in range(int(n / 2) - 1):
		print('2', end=' ')
	print('2')
else:
	print(n)
	for i in range(n - 1):
		print('1', end=' ')
	print('1')


n = int(input())
k = 0
ans = []
f = 0
for i in range(9, 0, -1):
	if n % i == 0:
		print(n // i)
		print(n // i * (str(i) + ' '))
		f = 1
		break
if f == 0:
	if n % 9 != 0:
		k += 1
		ans += [n % 9]
	print(n // 9 + k)
	ans += [9] * (n // 9)
	print(*ans)


x = int(input())
print(x)
res = [1 for i in range(x)]
print(*res)


n = int(input())
i = 9
while i > 0:
	if n % i == 0:
		print(int(n / i))
		for _ in range(int(n / i)):
			print(int(i), end=' ')
		break
	i -= 1


number = int(input())
digit = 1
for i in range(9, 1, -1):
	if number % i == 0:
		digit = i
		break
partitions = int(number / digit)
print(str(partitions))
print(''.join([str(digit) + ' '] * partitions))


n = int(input())
a = []
if n == 1:
	print(1)
	print(1)
	exit()
for i in range(9, 0, -1):
	if n % i == 0 and n != i:
		print(n // i)
		for j in range(n // i):
			a.append(i)
		break
print(*a)


e = int(input())
print(e)
print('1 ' * e)


n = int(input())
print(n)
X = ['1'] * n
print(' '.join(X))


def main():
	n = int(input())
	print(n)
	for i in range(n):
		print(str(1) + ' ', end='')
	print()
main()


n = int(input())
if n < 9:
	print(1)
	print(n % 9)
else:
	l = [1] * n
	print(n)
	print(' '.join(map(str, l)))


n = int(input())
print(n)
res = [1] * n
print(' '.join(map(str, res)))


a = int(input())
print(str(a))
while a > 0:
	print(1, end=' ')
	a -= 1


n = int(input())
print(n)
for item in [1] * n:
	print(item, end=' ')
print('')


N = int(input())
Max = 0
for i in range(N, 0, -1):
	if N % i == 0:
		Max = i
		break
print(N)
print('1 ' * N)


a = int(input())
l = ''
print(a)
for i in range(a):
	l += str(1) + ' '
print(l[:-1])


n = int(input())
p = 9
k = n
j = []
while p >= 1:
	l = []
	while n > 0:
		n = n - p
		if n >= 0:
			l.append(p)
	if n == 0:
		j.append(l)
	p = p - 1
	n = k
m = []
for w in j:
	m.append(len(w))
r = m.index(min(m))
print(min(m))
for z in j[r]:
	print(z, end=' ')


n = int(input())
c = 0
for i in range(9, 0, -1):
	if n % i == 0:
		print(n // i)
		c = 1
		for j in range(n // i):
			print(i, end=' ')
		break
if c == 0:
	print(n // 9 + 1)
	for j in range(n // 9):
		print('9', end=' ')
	print(n % 9)


num = int(input())
print(num)
for i in range(num):
	print(1, end=' ')
print('')


n = int(input())
print(n)
print(' '.join(('1' for _ in range(n))))


a = int(input())
print(a)
i = 0
while i < a:
	print('1', end=' ')
	i += 1


num = int(input())
array = []
print(num)
for _ in range(num):
	array.append(1)
print(*array, sep=' ')


import math, sys, itertools
from fractions import *

def mp():
	return list(map(int, input().split()))

def main():
	input = sys.stdin.readline
	n = int(input())
	print(n)
	print('1 ' * n)
main()


n = int(input())
print(n)
ans = ' '.join(('1' for i in range(n)))
print(ans)


n = int(input())
numbers = [1] * n
for i in range(9, 1, -1):
	j = i
	aux = n
	ns = []
	while j != 0 and len(set(ns)) <= len(set(numbers)):
		if aux < j:
			j -= i
		else:
			aux -= j
			ns.append(j)
	if aux == 0:
		numbers = ns
print(len(numbers))
print(' '.join([str(x) for x in numbers]))


n = int(input())
arr = []
for i in range(n):
	arr.append(1)
print(n)
print(*arr)


n = int(input())
f = False
while f != True:
	for num in range(9, 0, -1):
		mp1 = n // num
		mp2 = n % num
		if mp2 == 0:
			f = True
			break
print(mp1)
for i in range(mp1):
	print(num, end=' ')


(lambda n: print(n, '\n', *[1] * n))(int(input()))


def get():
	return list(map(int, input().split()))
n = int(input())
a = n * [1]
print(n)
print(*a)


n = int(input())
print(n)
x = [1] * n
print(*x)


n = int(input())
print(n)
for _ in range(1, n):
	print('1 ', end='')
print(1)


def imprime(x):
	for i in range(len(x)):
		print(x[i], end=' ')
	print()
n = int(input())
d = [[]] * 9
for i in range(1, 10):
	k = 0
	j = i - 1
	m = n // i
	for x in range(m):
		d[j] = [i] * m
count = [0] * 9
for i in range(9):
	t = sum(d[i])
	count[i] = 1
	if n > t:
		count[i] += 1
		d[i].append(n - sum(d[i]))
minimo = min(count)
for i in range(9):
	if count[i] == minimo:
		print(len(d[i]))
		imprime(d[i])
		break


n = int(input())
ar = []
for i in range(9, 0, -1):
	if n % i == 0:
		d = i
		break
while n > 0:
	n = n - d
	ar.append(d)
print(len(ar))
print(*ar)


n = int(input())
flag = False
for div in [9, 8, 7, 6, 5, 4, 3, 2, 1]:
	if n % div == 0:
		flag = True
		break
if flag:
	divs = n // div
	list_n = [div for i in range(divs)]
else:
	list_n = [9 for i in range(n // 9)]
	list_n.append(n % 9)
digits = ''
k = len(list_n)
for d in list_n:
	digits = digits + '{} '.format(d)
print(k)
print(digits[:-1])


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def main():
	n = int(input())
	print(n)
	ans = [1] * n
	print(*ans)
main()


n = int(input())
m = []
sum = 0
while sum != n:
	sum += 1
	m.append(str(1))
print(n)
print(' '.join(m))


inp = int(input())
print(inp)
for i in range(inp):
	print(1, end=' ')


n = int(input())
print(n)
s = '1 ' * n
s = s[:len(s) - 1]
print(s)


a = int(input())
print(a)
for i in range(0, a):
	print('1', end=' ')


n = int(input())
for i in range(9, 0, -1):
	if n < 10:
		print(1)
		print(n)
		break
	elif i == 1:
		print(n)
		for j in range(n):
			print(i, end=' ')
		break
	elif n % i == 0:
		print(n // i)
		for j in range(n // i):
			print(i, end=' ')
		break


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		print(n // i)
		A = [i for k in range(n // i)]
		print(' '.join(map(str, A)))
		break
else:
	print(n // i + 1)
	A = [9 for k in range(n // 9)]
	A.append(n % i)
	print(' '.join(map(str, A)))


n = int(input())
print(n)
for x in range(n):
	print(1, end=' ')


n = int(input())
x = ''
for i in range(n):
	x = x + '1 '
print(n)
print(x)


n = int(input())
a = [1] * n
print(n)
for i in a:
	print(i, end=' ')


a = int(input())
print(a, '1 ' * a)


n = int(input())
ans = [1] * n
print(len(ans))
print(*ans, sep=' ')


n = int(input())
print(n)
string = ''
for i in range(n):
	string += '1' + ' '
print(string)


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	for i in range(9, 0, -1):
		if n % i == 0 and i != n:
			a = n // i
			print(a)
			for j in range(a):
				print(i, end=' ')
			break


list_int_input = lambda inp: list(map(int, inp.split()))
int_input = lambda inp: int(inp)
string_to_list_input = lambda inp: list(inp)
n = int_input(input())
for i in range(9, 0, -1):
	if n % i == 0:
		print(int(n / i))
		a = [i for j in range(int(n / i))]
		print(' '.join(list(map(str, a))))
		break


n = int(input())
k = 0
f = 1
w = ''
i = 9
if n == 1:
	print(1, 1, sep='\n')
	exit()
print(n)
for i in range(n):
	print(1, ' ', end='')


a = int(input())
print(a, ' '.join(['1' for i in range(a)]), sep='\n')


a = int(input())
print(a)
arr = [1 for i in range(a)]
for i in arr:
	print(i, end=' ')


n = int(input())
if n > 0 and n < 10:
	if n % 2 != 0:
		print(n)
		while n > 0:
			print(1, end=' ')
			n -= 1
	else:
		print(2)
		print(n // 2, n // 2)
else:
	for i in range(9, 0, -1):
		if n % i == 0:
			print(n // i)
			x = i
			y = n // i
			break
	for i in range(y):
		print(x, end=' ')


n = int(input())
print(n)
l = [1] * n
print(*l)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for tt in range(t):
	n = int(input())
	print(n)
	for i in range(n):
		print(1)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


number = int(input())
print(number)
print('1 ' * number)


n = int(input())
temp = 1
for i in range(1, 10):
	if n % i == 0:
		d = n / i
		if i > temp:
			temp = i
print(int(n / temp))
s = 0
while s < n:
	s = s + temp
	print(temp, end=' ')


import sys
input = sys.stdin.readline
N = int(input())
L = [1] * N
print(N)
print(' '.join(map(str, L)))


n = int(input())
print(n)
t = '1 ' * n
print(t)


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	for i in range(1, int(n / 2) + 1):
		if n % i == 0:
			print(int(n / i))
			print((str(i) + ' ') * int(n / i))
			break


n = int(input())
res = [1, n]
for k in range(1, 10):
	if n % k == 0:
		res = max(res, [k, n // k])
print(res[1])
print((str(res[0]) + ' ') * res[1])


n = int(input())
count = 1
a = 9
ans = []
while n != 0:
	if n % a == 0:
		ans.append(a)
		n -= a
	else:
		a -= 1
print(len(ans))
print(*ans)


n = int(input())
ans = []
for i in range(9, 0, -1):
	if n % i == 0:
		while n > 0:
			ans.append(i)
			n = n - i
print(len(ans))
for i in ans:
	print(i, end=' ')
print()


x = int(input())
print(x)
print('1 ' * x)


n = int(input())
l = []
if n % 9 == 0:
	for i in range(0, n // 9):
		l.append(9)
	print(len(l))
	print(*l)
elif n % 8 == 0:
	for i in range(0, n // 8):
		l.append(8)
	print(len(l))
	print(*l)
elif n % 7 == 0:
	for i in range(0, n // 7):
		l.append(7)
	print(len(l))
	print(*l)
elif n % 6 == 0:
	for i in range(0, n // 6):
		l.append(6)
	print(len(l))
	print(*l)
elif n % 5 == 0:
	for i in range(0, n // 5):
		l.append(5)
	print(len(l))
	print(*l)
elif n % 4 == 0:
	for i in range(0, n // 4):
		l.append(4)
	print(len(l))
	print(*l)
elif n % 3 == 0:
	for i in range(0, n // 3):
		l.append(3)
	print(len(l))
	print(*l)
elif n % 2 == 0:
	for i in range(0, n // 2):
		l.append(2)
	print(len(l))
	print(*l)
else:
	for i in range(0, n // 1):
		l.append(1)
	print(len(l))
	print(*l)


n = int(input())
l = int(0)
s = ''
for i in range(9, 0, -1):
	if n % i == 0:
		l = n // i
	if l != 0:
		break
for k in range(l):
	s += str(i) + ' '
print(l)
print(s)


a = int(input())
print(a)
print(' '.join([str(1) for x in range(a)]))


n = int(input())
i = 2
flag = 0
while i < n and flag == 0:
	if n % i == 0:
		if int(n / i) <= 9:
			print(i)
			s = str(int(n / i))
			print((s + ' ') * i)
			flag = 1
		else:
			break
	else:
		i += 1
if flag == 0:
	print(n)
	s = '1 '
	print(s * n)


n = int(input().strip())
i = 9
while i > 0:
	if n >= i:
		val = n // i
		if val * i == n:
			print(val)
			print(str(str(i) + ' ') * val)
			exit()
	i -= 1


n = int(input())
xx = 0
for i in range(2, 10):
	if n % i == 0:
		yy = n
		print(n // i)
		while yy > 0:
			print(i, end=' ')
			yy -= i
		print()
		exit()
print(n)
for i in range(1, n + 1):
	print(1, end=' ')
print()


n = int(input())
R = [1] * n
print(n)
print(' '.join(map(str, R)))


from sys import exit
n = int(input())
s = []
for i in range(9, 0, -1):
	if n % i == 0 and n // i <= n:
		print(n // i)
		for k in range(n // i):
			print(i, end=' ')
		exit()
while n:
	s.append(min(9, n))
	n -= min(n, 9)
print(len(s))
print(*s)


import math
from collections import Counter
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
t = I()
if t <= 9:
	print(1)
	print(t)
else:
	print(t)
	print('1 ' * t)


n = int(input())
result = []
x = 1
while True:
	if n % x == 0 and n / x < 10:
		print(x)
		for i in range(x):
			k = int(n / x)
			if i == x - 1:
				print(k)
			else:
				print('%d ' % k)
		break
	x += 1


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	print(n)
	for i in range(n):
		print(1, end=' ')
	print()


number = int(input())
for i in range(9, 0, -1):
	if number % i == 0:
		no_of_digits = number // i
		print(no_of_digits)
		print((str(i) + ' ') * no_of_digits)
		break


TN = 1

def solution():
	n = int(input())
	print(n)
	print('1 ' * n)
while TN != 0:
	solution()
	TN -= 1


from math import *
from collections import *

def inp():
	return map(int, input().split())

def inp_arr():
	return list(map(int, input().split()))
n = int(input())
print(n)
for i in range(n):
	print(1, end=' ')


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	s = 9 if n > 9 else n - 1
	for i in range(s, 0, -1):
		if n % i == 0:
			t = n // i
			print(t)
			print(' '.join([str(i) for _ in range(t)]))
			break


t = 1
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(1)
	print(len(a))
	print(*a)


n = int(input())
c = 0
l = []
for i in range(9, 0, -1):
	if n % i == 0:
		c = c + int(n / i)
		for k in range(c):
			l.append(i)
		break
print(c)
print(*l)


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
else:
	print(n)
	print('1 ' * n)


n = int(input())
for x in range(9, 0, -1):
	if n % x == 0:
		print(n // x)
		for y in range(n // x):
			print(x, end=' ')
		break


n = int(input())
array = [1] * n
print(n)
print(*array)


n = int(input())
s = 0
d = 0
print(n)
for i in range(n):
	print(1, end=' ')


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0 and (i != n or i == 1):
		qtd = int(n / i)
		l = [str(i) for _ in range(qtd)]
		print(qtd)
		print(' '.join(l))
		exit(0)


import sys

def solution():
	result = 0
	number = int(input())
	result = [1] * number
	print(number)
	print(*result, sep=' ')
solution()


n = int(input())
number = 1
for i in range(9, 1, -1):
	if n % i == 0:
		number = i
		break
times = n // number
print(times)
for i in range(times):
	print(number, end=' ')


import sys
data = sys.stdin.read().splitlines()
n = int(data[0])
print(n)
print(' '.join(map(str, [1] * n)))


n = int(input())
i = 2
if n == 1:
	print(1)
	print(1)
else:
	while n != 0:
		a = n % i
		if a == 0:
			x = n // i
			s = str(x)
			l = list(s)
			if len(l) == 1:
				break
		i += 1
	y = n // x
	print(y)
	for i in range(y):
		if i == y - 1:
			print(x)
		else:
			print(x, end=' ')


s = int(input())
print(s)
print(' '.join(map(str, [1] * s)))


nums = ['1' for x in range(int(input()))]
print(len(nums))
print(' '.join(nums))


n = int(input())
if n <= 9:
	print(1)
	print(n)
elif n % 9 == 0:
	k = n // 9
	print(k)
	for i in range(k):
		print(9, '', end='')
elif n % 8 == 0:
	k = n // 8
	print(k)
	for i in range(k):
		print(8, '', end='')
elif n % 7 == 0:
	k = n // 7
	print(k)
	for i in range(k):
		print(7, '', end='')
elif n % 6 == 0:
	k = n // 6
	print(k)
	for i in range(k):
		print(6, '', end='')
elif n % 5 == 0:
	k = n // 5
	print(k)
	for i in range(k):
		print(5, '', end='')
elif n % 4 == 0:
	k = n // 4
	print(k)
	for i in range(k):
		print(4, '', end='')
elif n % 3 == 0:
	k = n // 3
	print(k)
	for i in range(k):
		print(3, '', end='')
elif n % 2 == 0:
	k = n // 2
	print(k)
	for i in range(k):
		print(2, '', end='')
elif n % 1 == 0:
	k = n // 1
	print(k)
	for i in range(k):
		print(1, '', end='')


n = int(input())
if n <= 9:
	print(1)
	print(n)
if n > 9:
	print(n)
	print('1 ' * n)


n = int(input())
print(n, n * '1 ', sep='\n')


def main():
	n = int(input())
	ret = [1] * n
	print(n)
	for x in ret:
		print(x, end=' ')
	print()
main()


n = int(input())
print(n)
print(('1 ' * n).strip())


num = int(input())
arr = [1] * num
print(num)
print(*arr, sep=' ')


n = int(input())
if 1 <= n <= 9:
	print(1)
	print(n)
else:
	flag = 0
	print(n)
	for i in range(n):
		print(1, end=' ')


num = int(input())
split = ['1'] * num
print(num)
print(' '.join(split))


import math
n = int(input())
ans = [1] * n
print(n)
print(' '.join(map(str, ans)))


import sys
import math

def read_int():
	return int(input().strip())

def read_int_list():
	return list(map(int, input().strip().split()))

def read_string():
	return input().strip()

def read_string_list(delim=' '):
	return input().strip().split(delim)
n = read_int()
print(n)
for i in range(n):
	print(1, end=' ')
print()


def find_digit_that_divides_evenly(n: int) -> int:
	return next((d for d in range(9, 0, -1) if n % d == 0), None)
n = int(input())
divisor_digit = find_digit_that_divides_evenly(n)
digits = [divisor_digit] * (n // divisor_digit)
print(len(digits))
print(' '.join((str(d) for d in digits)))


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	for i in range(9, 0, -1):
		if n % i == 0 and n != i:
			temp = i
			templist = []
			while temp <= n:
				templist.append(i)
				temp += i
			print(len(templist))
			print(' '.join((str(e) for e in templist)))
			break


a = int(input())
res = []
for i in range(1, 10):
	if a % i == 0:
		res.append(a // i)
print(res[-1])
for i in range(res[-1]):
	print(a // res[-1], end=' ')


n = int(input())
print(n)
a = []
for i in range(n):
	a.append(1)
print(' '.join(map(str, a)))


n = int(input())
m = 9
ans = [1 for i in range(n)]
print(n)
print(*sorted(ans))


n = int(input())
i = n - 1
trigger = 0
while i >= 2:
	if n % i == 0:
		if n / i > 9:
			i -= 1
			continue
		trigger = 1
		break
	i -= 1
if trigger == 1:
	print(i)
	for x in range(i):
		print(int(n / i), end=' ')
else:
	print(n)
	for x in range(n):
		print(1, end=' ')


import math

def isPrime(n):
	i = math.floor(n / 2)
	while True:
		if i < 2:
			return 1
		if n % i == 0:
			return 0
		i -= 1
n = int(input())
x = 9
while True:
	if n % x == 0:
		print(int(n / x))
		for i in range(int(n / x)):
			print(x, end=' ')
		break
	x -= 1


a = int(input())
r = 9
while r > 0:
	if a % r == 0:
		print(a // r)
		s = 0
		while s < a // r:
			print(r, end=' ')
			s = s + 1
		break
	r = r - 1


n = int(input())
l = 9
for d in range(9, 0, -1):
	if n % d == 0:
		k = d
		break
res = [k] * (n // k)
if n % k != 0:
	res.append(n % k)
print(len(res))
print(*res)


def razbienie(n):
	return [1] * n
m = int(input())
print(m)
print(*razbienie(m))


given = int(input())
print(given)
print(*[1] * given)


from math import sqrt, ceil, floor
n = int(input())

def is_prime(x):
	for i in range(2, n):
		if x % i == 0:
			return False
	return True
if n < 10:
	print(1)
	print(n)
elif is_prime(n) == True:
	print(n)
	a = []
	for i in range(n):
		a.append(1)
	s = ''
	for each in a:
		s += str(each) + ' '
	print(s)
else:
	mod = -1
	for i in range(1, 10):
		if n % i == 0:
			mod = i
	print(int(n / mod))
	a = []
	for i in range(int(n / mod)):
		a.append(mod)
	s = ''
	for each in a:
		s += str(each) + ' '
	print(s)


n = int(input())
consegui = 0
for i in range(9):
	if n % (i + 1) == 0:
		k = int(n / (i + 1))
		print(k)
		for a in range(k):
			print(i + 1, end=' ')
		consegui = 1
		break
if consegui == 0:
	k = int(n / 9)
	ultimo = n - 9 * k
	if ultimo != 0:
		print(k + 1)
	else:
		print(k)
	for i in range(k - 1):
		print(9, end=' ')
	if ultimo != 0:
		if k > 1:
			print(9, end=' ')
		print(ultimo)
	else:
		print(9)


n = int(input())
re = 0
for i in range(9, 1, -1):
	if n % i == 0:
		re = i
		break
if re == 0:
	print(n)
	for i in range(n):
		if i == n - 1:
			print(1)
		else:
			print(1, end=' ')
else:
	print(n // re)
	res = n // re
	for i in range(res):
		if i == res - 1:
			print(re)
		else:
			print(re, end=' ')
		n -= re


n = int(input())
l = []
div = 9
while n != 0:
	if n % div == 0:
		n -= div
		l.append(div)
	else:
		div -= 1
print(len(l))
print(' '.join([str(i) for i in l]))


k = int(input())
l = [1] * k
print(k)
for i in l[:-1]:
	print(i, end=' ')
print(l[-1])


t = int(input())
print(t)
a = []
for _ in range(t):
	a.append(1)
print(*a)


n = int(input())
print(n)
c = []
for i in range(n):
	c.append(1)
print(*c)


def main():
	c = int(input())
	print(c)
	print(' '.join(['1' for _ in range(c)]))
main()


n = int(input())
x = []
print(n)
z = '1' * n
print(' '.join(z))


a = int(input())
b = ''
for x in range(a):
	b += '1 '
print(a)
print(b[0:-1])


import sys
n = int(input())
for i in range(1, 10):
	if n % i == 0:
		print(n // i)
		print(' '.join([str(i)] * (n // i)))
		sys.exit(0)
print(n // 2 + 1)
partition = ['2'] * (n // 2) + ['1']
print(' '.join(partition))


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
print(n)
ans = [1] * n
print(*ans)


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = 1
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
m = int(z())
for i in range(9, 0, -1):
	if m % i == 0:
		print(m // i)
		print(m // i * (str(i) + ' '), '' if m % i == 0 else m % i)
		break


def ii():
	return int(input())

def ss():
	return [x for x in input()]

def si():
	return [int(x) for x in input().split()]

def mi():
	return map(int, input().split())
a = ii()
print(a)
print(*[1 for _ in range(a)])


n = int(input())
print(n)
print(' '.join([str(1) for i in range(n)]))


import sys
inf = float('inf')

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()
n = int(input())
print(n)
print('1 ' * n)


l = input()
l = int(l)
for i in range(9, 0, -1):
	if l % i == 0:
		di = int(l / i)
		print(di)
		for j in range(di):
			print(i, end=' ')
		break


n = int(input())
print(n)
arr = [1] * n
print(*arr)


n = int(input())
a = []
if n == 1:
	print(1)
	print(1)
elif n <= 9 and n > 1:
	print(1)
	print(n)
else:
	for j in range(1, 10):
		if n % j == 0:
			k = j
			break
		else:
			k = 9
	ki = n // k
	a = a + [k] * ki
	r = n - k * ki
	if r != 0:
		a = a + [r]
		print(len(a))
		for ji in a:
			print(ji, end=' ')
	else:
		print(len(a))
		for ji in a:
			print(ji, end=' ')


def main():
	n = int(input())
	ans = []
	if n == 1:
		print('1\n1')
		return
	if n % 2 == 0:
		for i in range(int(n / 2)):
			ans.append('2')
		print(int(n / 2))
		print(' '.join(ans))
		return
	if 1:
		for i in range(9, 2, -1):
			if n % i == 0:
				for j in range(int(n / i)):
					ans.append(str(i))
				print(int(n / i))
				print(' '.join(ans))
				return
	for i in range(n):
		ans.append('1')
	print(n)
	print(' '.join(ans))
main()


from sys import stdin
n = int(stdin.readline())
l = []
for i in range(9, 0, -1):
	y = n // i
	z = n % i
	x = [i] * y
	if z != 0:
		x.append(z)
	l.append((set(x), len(x), x))
l.sort(key=lambda x: len(x[0]))
print(l[0][1])
for x in l[0][2]:
	print(x, end=' ')


t = int(input())
ans = []
for i in range(t):
	ans.append(1)
print(t)
print(*ans)


n = int(input())
print(n)
kam = [1] * n
print(*kam)


n = int(input())
k = 0
f = 0
u = 0
for i in range(1, 10):
	if n % i == 0:
		k = i
		u = n // i
print(u)
a = ''
a += (str(k) + ' ') * u
print(a)


q = int(input())
print(q)
for i in range(q):
	print(1, end=' ')


import copy
import itertools
import string

def powmod(x, p, m):
	if p <= 0:
		return 1
	if p <= 1:
		return x % m
	return powmod(x * x % m, p // 2, m) * (x % m) ** (p % 2) % m

def to_basex(num, x):
	while num > 0:
		yield (num % x)
		num //= x

def from_basex(it, x):
	ret = 0
	p = 1
	for d in it:
		ret += d * p
		p *= x
	return ret

def core():
	n = int(input())
	print(n)
	print(*(1 for _ in range(n)))
core()


x = int(input())
y = 1
an = []
c = 0
c = x // y
an = [1] * x
print(c)
print(*an, sep=' ')


n = int(input())
print(n)
s = ''
for i in range(n):
	s += '1 '
print(s)


n = int(input())
i = max(min(9, n - 1), 1)
while i >= 1:
	if n % i == 0:
		print(n // i)
		a = [i for j in range(n // i)]
		print(*a)
		break
	i -= 1


def find(n):
	j = 9
n = int(input())
k = 1
ns = []
while k <= n:
	b = n + 1
	for i in range(1, 10):
		if n % i == 0 and n % i < n:
			b = n // i
			ns = [i for i2 in range(b)]
	k += 1
print(b)
print(' '.join([str(i) for i in ns]))


n = int(input())
i = 9
qou = -1
while i > 0:
	if n % i == 0:
		qou = i
		break
	i -= 1
if qou != -1:
	print(n // qou)
	print(*[qou] * (n // qou))
elif n <= 1000:
	print(n)
	print(*[1] * n)
else:
	print(n // 9 + 1)
	print(*[9] * (n // 9), n % 9)


a = int(input())
print(a)
print((str(1) + ' ') * a)


n = int(input())
print(n)
a = [1] * n
print(' '.join((str(x) for x in a)))


import sys

def same(n):
	start = 9 if n > 9 else n
	for i in range(start, 0, -1):
		if n % i == 0:
			return i
	return 0
n = int(input())
if n == 1:
	print(n)
	print(n)
else:
	print(int(n / same(n)))
	a = []
	for i in range(0, int(n / same(n))):
		a.append(same(n))
	for x in a:
		sys.stdout.write(str(x))
		sys.stdout.write(' ')


nn = int(input())
print(nn)
print(' '.join(['1' for i in range(nn)]))


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		count = n // i
		print(count)
		print(' '.join([str(i)] * count))
		exit(0)


n = int(input())
k = 0
od = -1
odj = -1
ans = []
for j in range(1, 10):
	if n // j > od:
		od = n // j
		odj = j
for i in range(od):
	ans.append(odj)
if n % (od * odj) != 0:
	ans.append(n - od * odj)
k = len(ans)
print(k)
for i in range(k):
	print(ans[i], end=' ')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	return '{}\n{}'.format(n, ' '.join(['1'] * n))
print(main())


import math

def prime(a):
	c = 0
	for i in range(2, int(math.sqrt(a)) + 1):
		if a % i == 0:
			c = 1
			break
	if c == 1:
		return False
	else:
		return True

def divisors(b):
	d = []
	for i in range(2, 10):
		if i >= b:
			break
		if b % i == 0:
			d.append(i)
	return d
n = int(input())
if prime(n):
	print(n)
	print(' '.join((x for x in ['1'] * n)))
else:
	div = divisors(n)
	try:
		jj = int(n // max(div))
		print(jj)
		print(' '.join((str(x) for x in [int(max(div))] * jj)))
	except Exception as e:
		print(n)
		print(' '.join((x for x in ['1'] * n)))


import sys
n = int(input())
re = [1] * n
print(n)
for x in re:
	sys.stdout.write(str(x) + ' ')


import math
x = int(input())
if x < 10:
	print(1)
	print(x)
else:
	print(x)
	for i in range(x):
		print(1, end='')
		if i == x - 1:
			print()
		else:
			print('', end=' ')


n = int(input())
x = 0
y = 0
for i in range(9, 0, -1):
	if n % i == 0:
		x = n // i
		y = i
		break
print(x)
print(' '.join(str(y) * x))


def chPathToThis(f=None):
	import os
	f = __file__ if f is None else f
	os.chdir(os.path.dirname(f))
fle = None

def input():
	global fle

	def inner():
		if fle is None:
			from sys import stdin
			for line in stdin:
				yield line
			raise EOFError
		else:
			for line in fle:
				yield line.replace('\r', '').replace('\n', '')
			raise EOFError
	o = inner()
	return next(o)

def main():
	n = int(input())
	print(n)
	print(' '.join((str(e) for e in [1] * n)))
try:
	import time, numpy
	chPathToThis(__file__)
	(begin, fle) = (time.clock(), open('pytest.txt'))
	main()
	fle.close()
	print(time.clock() - begin)
except ImportError:
	main()


import math

def f():
	x = int(input())
	i = 9
	ans = 0
	while i > 0:
		if x % i == 0:
			ans = x / i
			break
		i -= 1
	print(int(ans))
	li = list()
	for _ in range(int(ans)):
		li.append(i)
	print(*li)
f()


x = int(input().strip())
print(x)
print(' '.join(['1'] * x))


n = int(input())
ans = [1 for _ in range(n)]
print(len(ans))
print(*ans)


x = int(input())
(y, z) = (print(x), print(' '.join(['1' for _ in range(x)])))


num = int(input())
a = list(range(1, 10))
j = len(a) - 1
while num:
	if not num % a[j]:
		g = num // a[j]
		break
	else:
		j -= 1
print(g)
print(' '.join(map(str, [a[j]] * g)))


n = int(input())
lis = []
for i in range(n):
	lis.append(1)
print(n)
for j in range(n):
	print(lis[j], end=' ')


n = int(input())
print(n)
a = [1] * n
print(' '.join(map(str, a)))


n = int(input())
arr = []
for i in range(10, 0, -1):
	if n % i == 0:
		a = n // i
		b = i
		arr = a * [b]
print(a)
[print(i, end=' ') for i in arr]


a = input()
print(a)
for i in range(int(a)):
	print(1)


n = int(input())
ans = []
if n == 1:
	k = 1
	ans = [1]
else:
	for i in range(9, 0, -1):
		if n % i == 0 and i != n:
			k = n // i
			p = i
			break
	ans = [p for j in range(k)]
print(k)
print(*ans)


n = int(input())
num = [1] * n
print(n)
print(*num)


if 1:
	x = int(input())
	print(x)
	print('1 ' * x)


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		c = i
a = []
for j in range(n // c):
	a.append(c)
print(n // c)
print(*a)


n = int(input())
print(n)
l = [1] * n
for i in l:
	print(i, end=' ')


def vasya(n):
	for i in range(9, 0, -1):
		if n % i == 0:
			print(n // i)
			print(' '.join([str(i)] * (n // i)))
			return
	return
n = int(input())
vasya(n)


t = int(input())
print(t)
for i in range(t):
	print(1)


from sys import stdin, stdout
from collections import defaultdict
import math
I = stdin.readline
P = stdout.write
n = int(I())
print(n)
print('1 ' * n)


n = int(input())
print('%i' % n)
s = '1 ' * n
print(s[0:2 * n - 1])


def rli():
	return list(map(int, input().split()))

def main():
	n = int(input())
	print(n)
	ans = ['1'] * n
	print(' '.join(ans))
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	print(n)
	l = [1 for _ in range(n)]
	print(' '.join((str(x) for x in l)))
main()


import math
t = int(input())
temp = 0
gem = 0
diff = 0
if t == 1:
	print('1')
	print('1')
for i in range(2, 10):
	if t % i == 0 and i < t:
		cal = int(t / i)
		pro = i
		temp = 1
		gem = cal
if temp == 0:
	cal = t
	pro = 1
	gem = t
if t != 1:
	print(gem)
	for i in range(0, cal):
		print(pro, end=' ')


n = int(input())
print(n)
i = 0
while i < n:
	print('1')
	i += 1


def A():
	n = int(input())
	a = ['1'] * n
	print(n)
	print(' '.join(a))
A()


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	count = 0
	for i in range(1, 10)[::-1]:
		if n % i == 0:
			break
	count = int(n / i)
	print(count)
	i = str(i)
	i += ' '
	print(i * count)


n = int(input())
L = ['1'] * n
print(n)
print(' '.join(L))


n = int(input())
part = ['1'] * n
print(n)
print(' '.join(part))


n = int(input())
print(n)
answer = [1] * n
print(str(answer).replace('[', '').replace(']', '').replace(',', ''))


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	status = True
	for i in range(9, 1, -1):
		if n % i == 0 and n // i != 1:
			print(n // i)
			status = False
			for j in range(n // i):
				if j == n // i - 1:
					print(i)
				else:
					print(i, end=' ')
			break
	if status:
		print(n)
		for i in range(n):
			if i == n - 1:
				print(1)
			else:
				print(1, end=' ')


n = int(input())
if n != 1:
	for c in range(9, 0, -1):
		ans = n / c
		if ans == int(ans):
			print(int(ans))
			for z in range(1, int(ans + 1)):
				print(c, '', end='')
			break
if n == 1:
	print(1)
	print(1)


n = int(input())
O = []
for i in range(min(9, n), 0, -1):
	m = n // i
	r = n % i
	if r == 0:
		O = [i] * m
		break
print(len(O))
print(' '.join(map(str, O)))


n = int(input())
k = n
if n > 9:
	k = 9
for i in sorted(range(1, k + 1), reverse=True):
	if n % i == 0:
		s = n // i
		k = []
		print(s)
		while s != 0:
			k.append(i)
			s -= 1
		k = list(map(str, k))
		print(' '.join(k))
		break


x = int(input())
z = []
if x == 1:
	print(1)
	print(1)
else:
	for i in range(1, 10):
		if x % i == 0:
			z.append(i)
	r = int(x / max(z))
	print(int(x / max(z)))
	k = str(max(z))
	print((k + ' ') * r)


s = int(input())
print(s)
for i in range(s):
	print(1, end=' ')


n = int(input())
if n % 2 == 0:
	print(n // 2)
	print('2 ' * (n // 2))
elif n % 3 == 0:
	print(n // 3)
	print('3 ' * (n // 3))
elif n % 5 == 0:
	print(n // 5)
	print('5 ' * (n // 5))
elif n % 7 == 0:
	print(n // 7)
	print('7 ' * (n // 7))
else:
	print(n)
	print('1 ' * n)


n = int(input())
for i in range(9, 0, -1):
	D = []
	if n % i == 0:
		while n != 0:
			D.append(i)
			n -= i
		print(len(D))
		print(*D)
		exit()


k = int(input())
d = 1
for i in range(1, min(k, 10)):
	if k % i == 0:
		d = i
num = k // d
print(num)
arr = [d for _ in range(num)]
print(' '.join(map(str, arr)))


def split_digit(n):
	if n <= 9:
		return [n]
	result_val = [1] * n
	return result_val
n = int(input())
ls = split_digit(n)
print(len(ls))
temp_str = ''
for i in range(len(ls)):
	temp_str += str(ls[i]) + ' '
print(temp_str)


n = int(input())
m = []
if n == 1:
	print(1)
	print(1)
elif n == 2:
	print(2)
	print('1', '1')
elif n == 3:
	print(3)
	print('1', '1', '1')
elif n == 5:
	print(5)
	print('1', '1', '1', '1', '1')
elif n == 7:
	print(7)
	print('1', '1', '1', '1', '1', '1', '1')
else:
	for i in range(2, n):
		if n % i == 0 and n // i <= 9:
			m.append(i)
	if len(m) != 0:
		print(m[0])
		for j in range(0, m[0]):
			print(n // m[0], end=' ')
	else:
		print(n)
		for g in range(0, n):
			print(1, end=' ')


from sys import stdin, stdout
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))
for _ in range(1):
	n = nmbr()
	print(n)
	print(*[1] * n)


n = int(input())
if n == 1:
	print(1)
	print(1)
	exit()
best = n + 2
best_sol = None
for x in range(9, 0, -1):
	base = n // x
	add = 1 if n % x != 0 else 0
	score = 1 + add
	if score < best:
		best = score
		best_sol = [x] * base
		if add:
			best_sol += [n % x]
print(len(best_sol))
print(*best_sol)


n = int(input())
yes = False
number = 0
for num in range(9, 0, -1):
	if n % num == 0:
		yes = True
		number = num
		break
if yes:
	print(int(n / number))
	print((str(number) + ' ') * int(n / number))
else:
	print(int(n / 9) + 1)
	print((str(number) + ' ') * int(n / number) + str(int(n % 9)))


fav_number = int(input())
division = ['1'] * fav_number
print(fav_number)
print(' '.join(division))


def input_ints():
	return list(map(int, input().split()))

def main():
	n = int(input())
	print(n)
	print(' '.join(['1'] * n))
main()


def main():
	n = int(input())
	print(n)
	string = ''
	for _ in range(n):
		string += '1 '
	print(string)
main()


import sys
n = int(sys.stdin.readline().strip())
print(n)
print(('1 ' * n).strip())


from sys import stdin
n = int(stdin.readline().strip())
print(n)
sol = '1 ' * n
print(sol[:-1])


n = int(input())
if n <= 9:
	print(1)
	print(n)
else:
	print(n)
	print(' '.join(['1'] * n))


n = int(input())
print(n)
out = [1 for i in range(n)]
print(*out)


import math

def split(n):
	a = []
	if n == 1:
		print(n)
		print(1)
		return
	if n < 9:
		for i in range(2, 9):
			if n % i == 0:
				res = n // i
				print(i)
				print(' '.join([str(e) for e in [res] * i]))
				return
	else:
		quo = n // 9
		rem = n % 9
		left = n - quo * 9
		if left == 0:
			print(quo)
			print(' '.join([str(e) for e in [9] * quo]))
		else:
			print(n)
			print(' '.join((str(e) for e in [1] * n)))
n = int(input())
split(n)


n = int(input())
for x in range(1, 10):
	if n % x == 0:
		k = n // x
		p = x
		break
else:
	k = n // 9
	p = 9
if n % x == 0:
	print(k)
	z = '{} '.format(p)
	print(z * k)
else:
	print(k + 1)
	print('{} '.format(p) * k + '{} '.format(n - k * p))


import getpass
import sys

def ria():
	return [int(i) for i in input().split()]
if getpass.getuser() != 'frohenk':
	filename = 'half'
else:
	sys.stdin = open('input.txt')
n = ria()[0]
print(n)
print('1 ' * n)


n = int(input())
cnt = 1
l = []
k = 9
while n > 0:
	l.append(1)
	n -= 1
print(len(l))
print(*l)


def solve(n):
	print(n)
	print(' '.join(map(str, [1] * n)))

def main():
	n = int(input())
	solve(n)
main()


n = int(input())
print(n)
s = ''
for x in range(n):
	s += str(1) + ' '
print(s)


import math

def solve(n):
	ans = 0
	size = int(math.sqrt(n)) + 1
	for i in range(2, size):
		if n % i == 0:
			ans = i
	if ans == 0 or ans > 9:
		print(n)
		for i in range(n):
			print(1, end=' ')
	else:
		loop = n // ans
		print(loop)
		for i in range(loop):
			print(ans, end=' ')

def main():
	n = int(input())
	solve(n)
main()


n = int(input())
ll = ['1'] * n
print(n)
print(' '.join(ll))


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import combinations
import functools
import sys
import math
MAX = sys.maxsize
MAXN = 10 ** 6 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN():
	return map(int, sys.stdin.readline().strip().split())

def charIN():
	return sys.stdin.readline().strip().split()

def ncr(n, k):
	res = 1
	c = [0] * (k + 1)
	c[0] = 1
	for i in range(1, n + 1):
		for j in range(min(i, k), 0, -1):
			c[j] = (c[j] + c[j - 1]) % MOD
	return c[k]
n = int(input())
x = [1] * n
print(n)
print(*x)


def main():
	n = int(input())
	d = next((i for i in range(9, 0, -1) if n % i == 0))
	k = n // d
	print(k)
	print((str(d) + ' ') * k)
main()


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		a = i
print(n // a)
for j in range(n // a):
	print(a, end=' ')


n = int(input())
viv = []
if n % 9 == 0:
	viv = [9] * (n // 9)
	print(n // 9)
	print(*viv)
	exit()
if n % 8 == 0:
	viv = [8] * (n // 8)
	print(n // 8)
	print(*viv)
	exit()
if n % 7 == 0:
	viv = [7] * (n // 7)
	print(n // 7)
	print(*viv)
	exit()
if n % 6 == 0:
	viv = [6] * (n // 6)
	print(n // 6)
	print(*viv)
	exit()
if n % 5 == 0:
	viv = [5] * (n // 5)
	print(n // 5)
	print(*viv)
	exit()
if n % 4 == 0:
	viv = [4] * (n // 4)
	print(n // 4)
	print(*viv)
	exit()
if n % 3 == 0:
	viv = [3] * (n // 3)
	print(n // 3)
	print(*viv)
	exit()
if n % 2 == 0:
	viv = [2] * (n // 2)
	print(n // 2)
	print(*viv)
	exit()
if n % 1 == 0:
	viv = [1] * (n // 1)
	print(n // 1)
	print(*viv)
	exit()


n = int(input())
dig = 0
fg = 0
for i in range(2, 10):
	if n % i == 0:
		dig = i
		fg = 1
		break
if fg == 0:
	print(n)
	for i in range(0, n):
		print(1, end=' ')
else:
	print(n // dig)
	for i in range(0, n // dig):
		print(dig, end=' ')
print()


t = int(input())
print(t)
for _ in range(0, t):
	print('1', end=' ')


n = int(input())
lst = []
for i in range(1, 10):
	Sum = 0
	sub_lst = []
	while i <= n and n % i == 0 and (Sum < n):
		Sum += i
		sub_lst.append(i)
	if len(sub_lst) > 0:
		lst.append(sub_lst)
lst.sort()
print(len(lst[len(lst) - 1]))
for i in lst[len(lst) - 1]:
	print(i, end=' ')


import math
z = int(input())
a = []
for i in reversed(range(1, 10)):
	if math.fmod(z, i) == 0:
		a.append(i)
print(int(z / a[0]))
for i in range(int(z / a[0])):
	print(a[0])


k = int(input())
l = list()
for i in range(1, 10):
	if k // i != 0:
		for j in range(1, k // i + 1):
			l.append(i)
	k = k % i
print(len(l))
for i in l:
	print(i, end=' ')


systemIn = int(input())
print(systemIn)
digits = ''
for i in range(systemIn):
	if i == systemIn - 1:
		digits += '1'
	else:
		digits += '1 '
print(digits)


from collections import Counter
import math
n = int(input())
print(n)
for i in range(n):
	print('1', end=' ')


N = int(input())
print(N)
for i in range(N):
	print('1', end=' ')


n = int(input())
dico = dict()
for d in range(9, 0, -1):
	if d == 1:
		d = 1
		k = n
	elif n % d == 0:
		k = n // d
		break
str1 = [d] * k
str1 = map(str, str1)
print(k)
print(' '.join(str1))


n = int(input())
out = []
for i in range(9, -1, -1):
	if n % i == 0:
		out = n // i * [str(i)]
		break
print(len(out))
print(' '.join(out))


x = int(input())
m = 0
for n in range(1, 10):
	if x % n == 0:
		if n >= m:
			m = n
		else:
			m = m
if m == 0:
	m = 1
print(int(x / m))
for n in range(int(x / m)):
	print(m, end=' ')


def main():
	n = int(input())
	print(str(n) + '\n' + ' '.join(['1'] * n))
main()


n = int(input())
numbers = []
for i in range(1, 10):
	if n % i == 0:
		numbers.append([i] * (n // i))
print(len(numbers[len(numbers) - 1]))
print(*numbers[len(numbers) - 1])


def ans(n):
	return [1] * n
n = int(input())
result = ans(n)
print(len(result))
print(*result)


n = int(input())
for i in range(1, 9):
	if n % i:
		continue
	print(n // i)
	for _ in range(n // i):
		print(i)
	break
else:
	print((n + 8) // 9)
	for _2 in range(n // 9):
		print(9)
	if n % 9:
		print(n % 9)


def disp(n, inp):
	print(int(inp / n))
	for _ in range(0, int(inp / n)):
		print(n, end=' ')

def ans(n, inp):
	c = n
	if c % 9 == 0:
		disp(9, inp)
	elif c % 8 == 0:
		disp(8, inp)
	elif c % 7 == 0:
		disp(7, inp)
	elif c % 6 == 0:
		disp(6, inp)
	elif c % 5 == 0:
		disp(5, inp)
	elif c % 4 == 0:
		disp(4, inp)
	elif c % 3 == 0:
		disp(3, inp)
	elif c % 2 == 0:
		disp(2, inp)
	elif c % 1 == 0:
		disp(1, inp)
inp = int(input())
ans(inp, inp)


n = int(input())
print('%d\n1' % n, end='')
for i in range(n - 1):
	print(' 1', end='')
print()


n = int(input())
ans = 0
for i in range(2, 10):
	if n % i == 0:
		ans = i
		break
if ans == 0:
	i = 0
	l = list()
	l = n * [1]
	print(len(l))
	for i in l:
		print(i, end=' ')
	print()
else:
	l = list()
	c = n // ans
	l = c * [ans]
	print(len(l))
	for i in l:
		print(i, end=' ')
	print()


N = int(input())
L = []
count = 0
for i in range(9, 0, -1):
	if N % i == 0:
		count = count + int(N / i)
		for j in range(count):
			L.append(i)
		break
print(count)
print(*L)


n = int(input())
print(n)
d = [1 for _ in range(n)]
print(*d)


n = int(input())
ans = []
if n <= 1:
	print(1, n, sep='\n')
	exit()
else:
	ans = []
	for i in range(1, 10):
		if n % i == 0:
			ans.append(i)
	if ans:
		ch = 0
		i = ans[-1]
		while n > 0:
			n -= i
			ch += 1
		print(ch)
		print(*[ans[-1]] * ch)
		exit()
ans = []
while n > 0:
	if n < 10:
		ans.append(n)
		n = 0
	else:
		n -= 9
		ans.append(9)
print(len(ans))
print(*ans)


import sys
n = int(sys.stdin.readline())
print(n)
for _ in range(n - 1):
	print(1, end=' ')
print(1)


numero = int(input())
a = 1000
while numero % a != 0:
	a -= 1
print(a)
print((str(numero // a) + ' ') * a)


n = int(input())
if n < 9:
	print(1)
	print(n)
else:
	l = [1] * n
	print(n)
	print(*l)


import math
mod = 1000000007
n = int(input())
f = 0
print(n)
for i in range(n):
	print('1', end=' ')


n = int(input())
a = []
x = n
for i in range(x):
	a.append(1)
y = len(a)
print(len(a))
for j in range(y):
	print(a[j], end=' ')


n = int(input())
count = n // 9
s = abs(n - count * 9)
if n <= 8:
	print(n)
	i = 0
	while i < n:
		print(1, end=' ')
		i += 1
else:
	print(n)
	i = 0
	while i < n:
		print(1, end=' ')
		i += 1


n = int(input())
z = str(1) * n
print(n)
for c in z:
	print(c, end=' ')


n = int(input())
print(n)
for i in range(0, n - 1):
	print(1, ' ')
print(1)


n = int(input())
A = []
j = 1
for i in range(9, 1, -1):
	if n % i == 0:
		j = i
		break
m = n // j
print(m)
for i in range(m):
	print(j, end=' ')


import math

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
print(n)
print('1 ' * n)


n = int(input())
print(n)
ans = ''
for x in range(n):
	ans += '1 '
print(ans)


n = int(input())
count = 0
lst = []
x = 1
for i in range(1, 10)[::-1]:
	if n % i == 0:
		x = i
		break
for i in range(n // x):
	lst.append(x)
	count += 1
print(count)
print(*lst)


n = int(input())
l1 = ['1'] * n
print(n)
print(' '.join(l1))


x = int(input())
if x <= 9:
	print(1)
	print(x)
else:
	print(x)
	print(('1 ' * x).strip())


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	for i in range(2, 10):
		if n % i == 0:
			if n // i <= 9:
				print(i)
				for j in range(i):
					print(n // i, end=' ')
				break
	else:
		print(n)
		for i in range(n):
			print(1, end=' ')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
print(n)
print('1 ' * n)


n = int(input())
print(n)
q = ['1'] * n
print(' '.join(q))


def solve():
	n = int(input())
	return (n, [1] * n)
(a1, res) = solve()
print(a1)
print(*res)


def fatora(n):
	digitos = ''
	primeiro = True
	for __ in range(n):
		if primeiro:
			digitos += '1'
			primeiro = False
		else:
			digitos += ' 1'
	return [n, digitos]
n = int(input())
print(fatora(n)[0])
print(fatora(n)[1])


n = int(input())
lst = [i for i in range(1, 10)][::-1]
for i in lst:
	result = ''
	if n % i == 0:
		print(int(n / i))
		for j in range(int(n / i)):
			result += '{} '.format(i)
		print(result)
		break


n = int(input())
print(n)
print(' '.join(list('1' * n)))


n = int(input())
result = [1 for _ in range(n)]
print(len(result), ' '.join(map(str, result)), sep='\n')


def razb(s):
	if s == 1:
		print(1)
		print(1)
		return
	i = 0
	if s > 9:
		i = 9
	else:
		i = s - 1
	result = ''
	while s % i != 0:
		if i == s:
			break
		i -= 1
	y = s / i
	for j in range(0, int(y)):
		if j == y - 1:
			result += str(int(i))
		else:
			result += str(int(i)) + ' '
	print(int(y))
	print(result)
razb(int(input()))


def main():
	n = int(input())
	if n <= 9:
		print(1)
		print(n)
	else:
		arr = [1] * n
		print(len(arr))
		for i in arr:
			print(i, end=' ')
main()


t = int(input())
if t <= 9:
	print(1)
	print(t)
else:
	print(t)
	print('1 ' * t)


a = int(input())
print(a)
b = []
for _ in range(a):
	b.append(1)
print(*b)


n = int(input())
l = 0
for i in range(1, 10):
	if n % i == 0:
		l = i
		break
print(n // l)
for i in range(n // l):
	print(l, end=' ')


number = int(input())
digits = [9, 8, 7, 6, 5, 4, 3, 2, 1]
for i in range(len(digits)):
	if number % digits[i] == 0:
		complemento = ' {0}'.format(digits[i])
		resp = str(digits[i]) + (number // digits[i] - 1) * complemento
		print(number // digits[i])
		print(resp)
		break


n = int(input())
a = []
for _ in range(n):
	a.append(1)
print(n)
print(*a, sep=' ')


n = int(input())
print(n)
l = [1] * n
print(' '.join(map(str, l)))


num = int(input())
print(num)
print('1 ' * num)


n = int(input())
print(n)
print('{} '.format(1) * n)


def do():
	n = int(input())
	for i in range(9, 0, -1):
		if n % i == 0:
			print(n // i)
			print(' '.join([str(i)] * (n // i)))
			return
	if n & 1 == 1:
		print(n // 2 + 1)
		print(' '.join(['1'] + ['2'] * (n // 2)))
		return
	if n & 1 == 0:
		print(n // 2)
		print(' '.join(['2'] * (n // 2)))
do()


def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))
n = int(input())
print(n)
for i in range(n):
	print(1, end=' ')


x = int(input())
if x < 9:
	print(1)
	print(x % 9)
else:
	c = [1] * x
	print(x)
	print(' '.join(map(str, c)))


n = int(input())
l = []
if n == 1:
	print('1')
	print('1')
	exit(0)
if n >= 10:
	for i in range(9, 0, -1):
		if n % i == 0:
			l.append(i)
			l.append(n // i)
			break
else:
	for i in range(n - 1, 0, -1):
		if n % i == 0:
			l.append(i)
			l.append(n // i)
			break
print(l[1])
for i in range(l[1]):
	print(l[0], end=' ')
print()


import math
n = int(input())
for i in reversed(range(1, 10)):
	if n % i == 0:
		print(n // i)
		for j in range(n // i):
			print(i, end=' ')
		exit()


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
print(n)
print(*[1] * n)


t = int(input())
k = [1] * t
print(t)
print(*k)


n = int(input())
x = min(9, n)
for i in range(x, 0, -1):
	if n % i == 0:
		break
a = n // i
print(a)
for j in range(a):
	print(i, end=' ')


import sys
n = int(sys.stdin.readline()[:-1])
print(n)
print(' '.join([str(1) for i in range(n)]))


N = int(input())
print(N)
S = ''
for i in range(N):
	S += '1 '
print(S)


import math
n = int(input())
a = []
for i in range(n):
	a.append(1)
print(n)
print(*a)


n = int(input())
if n == 1:
	ans = k = 1
else:
	for i in range(9, 0, -1):
		if i == n:
			continue
		if n % i == 0:
			k = i
			break
	ans = n // k
print(ans)
for i in range(ans):
	print(k, end=' ')


n = int(input())
if n is 1:
	div = 1
else:
	div = 2
for i in range(1, n + 1):
	if n % div is 0 and n // div < 10:
		break
	else:
		div += 1
print(div)
for _ in range(div):
	print(n // div, end=' ')


n = int(input())
ans = 0
ans1 = []
kek = []
for i in range(1, n + 1):
	if n % i == 0:
		ans1.append(i)
for i in range(n // ans1[0]):
	kek.append(ans1[0])
print(len(kek))
for i in kek:
	print(i, end=' ')


n = int(input())
output = []
suma = point = 0
exit = None

def check(num):
	for j in range(2, 10):
		if num % j == 0 and num != j:
			return j
	return 1
if n == 1:
	output.append(1)
else:
	while suma != n:
		for j in reversed(range(1, 10)):
			if j < n and n % j == 0:
				suma += j
				output.append(j)
				break
print(len(output))
print(*output)


num = int(input())
print(num)
print((str(1) + ' ') * num)


t = int(input())
print(t)
print('1 ' * t)


x = int(input())
o = 0
for i in range(1, x + 1):
	if x % i == 0 and i > 1 and (x != 1) and (x // i <= 9) or x < 10:
		print(i)
		for j in range(i):
			print(x // i, end=' ')
		break


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		print(n // i)
		ans = [i for j in range(n // i)]
		print(' '.join(map(str, ans)))
		exit(0)
ans = [9 for i in range(n // i)]
ans.append(n % 9)
print(' '.join(map(str, ans)))


from sys import stdin, stdout
import math
n = int(input())
print(n)
for i in range(n):
	print(1, end=' ')


n = int(input())
li = list()
i = 1
while i <= 9:
	if n % i == 0:
		li.append([n // i, i])
	i = i + 1
if len(li) > 1:
	li.pop(0)
if n == 1:
	li.append([1, 1])
t = min(li, key=lambda x: x[0])
print(t[0])
print((str(t[1]) + ' ') * t[0])


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
n = ini()
print(n)
out([1] * n, ' ')


t = int(input())
s = ''
print(t)
for i in range(t):
	s += '1 '
s.strip()
print(s)


n = int(input())
answer = []
for i in range(n):
	answer.append(1)
print(n)
print(str(answer).replace('[', '').replace(']', '').replace(',', ''))


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		num = i
		count = int(n / i)
		break
print(count)
for i in range(count):
	print(num, end=' ')


from math import ceil

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())
t = ii()
print(t)
for i in range(t):
	print('1', end=' ')


k = int(input())
print(k)
print('1 ' * k)


n = int(input())
x = [9, 8, 7, 6, 5, 4, 3, 2, 1]
for i in x:
	if n % i == 0:
		print(n // i)
		print((str(i) + ' ') * (n // i))
		break


n = int(input())
c = 1
j = n
for i in range(1, 10):
	if n // i > c and n % i == 0 and (n // i != n) and (n // i <= 9):
		c = n // i
		j = i
s = ''
print(j)
for k in range(j):
	print(c, end=' ')


n = int(input())
tot = ''
for item in range(n):
	tot += '1' + ' '
print(n)
print(tot[:-1])


n = int(input())
first_digit = None
include_digits = [9, 8, 7, 6, 5, 4, 3, 2, 1]
for digit in include_digits:
	if n % digit == 0:
		first_digit = digit
		break
times = int(n / first_digit)
print(times)
for t in range(times):
	print(first_digit, end=' ')


n = eval(input())
print(n)
for i in range(n):
	print(1, end=' ')


__author__ = 'Dilshod'
n = int(input())
print(n)
a = [1] * n
print(*a, sep=' ')


k = int(input())
m = 0
print(k)
for i in range(k):
	print('1', end=' ')


import sys
number = int(input())
if number <= 2:
	print(int(number))
	print((str(1) + ' ') * number)
else:
	for i in range(9, 1, -1):
		if number % i == 0 and i != number:
			print(int(number / i))
			print((str(i) + ' ') * int(number / i))
			sys.exit()
	print(int(number))
	print((str(1) + ' ') * number)


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		dig_lis = [i] * (n // i)
		dig_lis = ' '.join(list(map(str, dig_lis)))
		print(str(n // i) + '\n' + dig_lis)
		break


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
print(n)
print(*[1] * n)


import math
import os
import random
import re
import sys
n = int(input())
(c, mi) = (0, 1000000)
ind = 0
l = [0] * 11
l = [0] * 11
for i in range(1, 10):
	c = n // i
	if n % i == 0:
		mi = c
		ind = i
		break
	if n % i != 0:
		c += 1
		l[i] = 1
	if c < mi:
		mi = c
		ind = i
print(mi)
for i in range(mi):
	if i == 0 and l[ind] == 1:
		print(n % ind, end=' ')
	else:
		print(ind, end=' ')


n = int(input())
r = []
for i in range(n):
	r.append(1)
r = list(map(str, r))
print(len(r))
print(' '.join(r))


import sys
import heapq
import math
lines = sys.stdin.read().splitlines()
n = [int(x) for x in lines[0].split(' ')][0]
print(n)
for i in range(0, n):
	print(1, end=' ' if i < n - 1 else '\n')


n = int(input())
min = 10 ** 9
if n < 10:
	print(1)
	print(n)
else:
	for i in range(1, 10):
		if n % i == 0:
			print(n // i)
			for j in range(n // i):
				print(i, end=' ')
			quit()
	print(n // 9 + 1)
	for i in range(n // 9):
		print(9, end=' ')
	print(n % 9)


n = int(input())
strn = ''
i = 9
while i > 1:
	if n % i == 0:
		break
	i -= 1
j = 0
while j < n / i:
	strn += str(i)
	strn += ' '
	j += 1
print(int(n / i))
print(strn)


n = int(input())
a = [1]
k = a * n
print(len(k))
for i in k:
	print(i, end=' ')


def split1(n):
	print(n)
	while n:
		print(1, end=' ')
		n -= 1
n = int(input())
split1(n)


n = int(input())
s = ''
k = 0
a = n
if n == 1:
	print(1)
	print(1)
elif n == 3:
	print(3)
	print(f'{1} {1} {1}')
else:
	for i in range(9, 0, -1):
		while a % i == 0:
			a = a - i
			s = s + str(i) + ' '
			k += 1
			if a == 0:
				break
		if a == 0:
			break
	print(k)
	print(s)


import sys

def main():
	fin = sys.stdin
	n = int(fin.readline().strip())
	print(n)
	print(' '.join(['1' for i in range(n)]))
main()


import re, math, decimal, bisect

def read():
	return input().strip()

def iread():
	return int(input().strip())

def viread():
	return [int(_) for _ in input().strip().split()]
n = iread()
print(n)
print(*[1] * n)


a = int(input())
l = '1 ' * a
print(a)
print(l)


n = int(input())
print(n)
lst = [1] * n
print(' '.join((str(item) for item in lst)))


from itertools import repeat
n = int(input())
for c in range(9, 0, -1):
	if n % c == 0:
		print(n // c)
		print(*repeat(c, n // c))
		break


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
print(n)
for _ in range(n):
	print('1')


l1 = input()
l1 = int(l1)
print(l1)
for i in range(l1):
	print('1 ', end='')


n = int(input())
print(n)
for g in range(0, n):
	print(1, end=' ')


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		terms = [str(i) for _ in range(n // i)]
print(len(terms))
print(' '.join(terms))


n = int(input())
print(n)
str_out = ''
for i in range(n):
	str_out += '1'
	if i != n - 1:
		str_out += ' '
print(str_out)


u = int(input())
g = 1
print(u)
for j in range(u):
	print(1, end=' ')


n = int(input())
if n == 1:
	print(1)
	print('1')
elif n == 2:
	print(2)
	print('1 1')
else:
	k = 0
	for i in range(2, n + 1):
		if n % i == 0 and n / i < 10:
			k = i
			break
	print(k)
	s = str(int(n / k)) + ' '
	print((s * k).rstrip())


n = int(input())
if n == 1:
	print(1)
	print(1)
else:
	results = []
	for i in range(1, min(n, 10)):
		if n % i == 0:
			temp = n // i
			temp2 = [str(i)] * temp
			results.append(temp2)
	menor = results[0]
	for e in results:
		if len(e) < len(menor):
			menor = e
	print(len(menor))
	print(' '.join(menor))


n = int(input())
print(n)
ans = []
for i in range(n):
	ans.append(1)
print(*ans)


import sys

def main():
	n = int(sys.stdin.read().strip())
	for i in range(9, 0, -1):
		if not n % i:
			return (n // i, (n // i * f'{i} ').strip())
print(*main(), sep='\n')


n = int(input())
x = [j for j in range(2, 10)]
ch = 0
ct = 0
for i in x:
	if n % i == 0:
		ct = i
		ch = 1
if ch == 0:
	print(n)
	for k in range(n):
		print(1, end=' ')
else:
	print(n // ct)
	for k in range(n // ct):
		print(ct, end=' ')


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		a = [i] * (n // i)
		break
print(len(a))
print(*a)


n = int(input())
if n == 1:
	print(1)
	print(1)
	exit()
for i in range(2, 10):
	if n % i == 0:
		print(n // i)
		l = [i] * (n // i)
		print(*l, sep=' ')
		exit()
print(n)
l = [1] * n
print(*l, sep=' ')


digts = [9, 8, 7, 6, 5, 4, 3, 2, 1]
k = int(input())
for c in range(0, 9):
	if k % digts[c] == 0:
		dig = digts[c]
		vzs = int(k / dig)
		break
print(vzs)
for c in range(0, vzs):
	print(dig, end=' ')


def split_problem():
	num = eval(input())
	print(num)
	for i in range(num):
		print('1 ', end='')
	print()
	return
split_problem()


from math import *
import sys, random

def nextInt():
	return int(input())

def nextStrs():
	return input().split()

def nextInts():
	return list(map(int, nextStrs()))

def main():
	n = nextInt()
	print(n)
	for i in range(n):
		print(1, end=' ')
exit(main())


n = int(input())
print(n)
sol = ''
for i in range(n):
	sol += '1 '
print(sol)


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return len(set(factors))

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
MOD = 1000000007
T = 1
for _ in range(T):
	n = int(stdin.readline())
	x = factors(n)
	if len(x) == 1:
		print(1)
		print(1)
		continue
	k = 0
	for i in range(len(x)):
		if x[i] < 10:
			q = n // x[i]
			if q < 10:
				k = 1
				(a, b) = (min(x[i], q), max(x[i], q))
				print(a)
				print(*[b] * a)
				break
	if k == 0:
		print(n)
		print(*[1] * n)


n = int(input())
arr = [1] * n
print(n)
for i in arr:
	print(i, end=' ')


import math
n = int(input())
k = math.ceil(n / 9)
if n % k == 0:
	print(k)
	print(k * (str(math.ceil(n / k)) + ' '))
else:
	print(n)
	print(n * '1 ')


def main():
	n = int(input())
	st = ''
	print(n)
	for i in range(n):
		st = st + '1 '
	print(st)
main()