Slava plays his favorite game "Peace Lightning". Now he is flying a bomber on a very specific map.

Formally, map is a checkered field of size 1 × n, the cells of which are numbered from 1 to n, in each cell there can be one or several tanks. Slava doesn't know the number of tanks and their positions, because he flies very high, but he can drop a bomb in any cell. All tanks in this cell will be damaged.

If a tank takes damage for the first time, it instantly moves to one of the neighboring cells (a tank in the cell n can only move to the cell n - 1, a tank in the cell 1 can only move to the cell 2). If a tank takes damage for the second time, it's counted as destroyed and never moves again. The tanks move only when they are damaged for the first time, they do not move by themselves.

Help Slava to destroy all tanks using as few bombs as possible.


-----Input-----

The first line contains a single integer n (2 ≤ n ≤ 100 000) — the size of the map.


-----Output-----

In the first line print m — the minimum number of bombs Slava needs to destroy all tanks.

In the second line print m integers k_1, k_2, ..., k_{m}. The number k_{i} means that the i-th bomb should be dropped at the cell k_{i}.

If there are multiple answers, you can print any of them.


-----Examples-----
Input
2

Output
3
2 1 2 
Input
3

Output
4
2 1 3 2

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Constructive algorithms


Solutions:
n = int(input())
m = n + int(n / 2)
print(m)
out = ''
out1 = ''
j = 1
for i in range(2, n + 1, 2):
	out += str(i) + ' '
	out1 += str(j) + ' '
	j += 2
if n % 2 == 1:
	out1 += str(j) + ' '
print(out + out1 + out)


import sys
import itertools
input = iter(sys.stdin.read().splitlines()).__next__
N = int(input())
res = list(itertools.chain(range(2, N + 1, 2), range(1, N + 1, 2), range(2, N + 1, 2)))
print(len(res))
print(' '.join(map(str, res)))


n = int(input())
ans = [i for i in range(2, n + 1, 2)]
ans.extend([i for i in range(1, n + 1, 2)])
ans.extend([i for i in range(2, n + 1, 2)])
print(len(ans))
print(*ans)


n = int(input())
print(n + n // 2)
k = 1 - n % 2
rs = []
for i in range(1, n + 1):
	if i % 2 == k:
		rs.append(i)
for i in range(1, n + 1):
	if i % 2 != k:
		rs.append(i)
for i in range(1, n + 1):
	if i % 2 == k:
		rs.append(i)
print(' '.join(list(map(str, rs))))


n = int(input())
n += 1
ans = []
for i in range(2, n, 2):
	ans.append(i)
for i in range(1, n, 2):
	ans.append(i)
for i in range(2, n, 2):
	ans.append(i)
print(len(ans))
for i in ans:
	print(i, end=' ')


x = int(input())
y = int(x / 2)
moves = []
if x % 2 == 0:
	print(int(x + y))
	for i in range(y):
		moves.append((i + 1) * 2)
	for i in range(y):
		moves.append(i * 2 + 1)
	for i in range(y):
		moves.append((i + 1) * 2)
if x % 2 != 0:
	print(int(x + y))
	y = int(x / 2)
	for i in range(y):
		moves.append((i + 1) * 2)
	for i in range(y + 1):
		moves.append(i * 2 + 1)
	for i in range(y):
		moves.append((i + 1) * 2)
print(*moves, sep=' ')


n = int(input())
a = []
b = []
for i in range(1, n + 1):
	if i % 2 != 0:
		a.append(i)
	else:
		b.append(i)
print(len(a) + 2 * len(b))
for el in b:
	print(el, end=' ')
for el in a:
	print(el, end=' ')
for el in b:
	print(el, end=' ')


import sys, os, io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import math
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

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 SieveOfEratosthenes(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

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

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

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def power_set(L):
	cardinality = len(L)
	n = 2 ** cardinality
	powerset = []
	for i in range(n):
		a = bin(i)[2:]
		subset = []
		for j in range(len(a)):
			if a[-j - 1] == '1':
				subset.append(L[j])
		powerset.append(subset)
	powerset_orderred = []
	for k in range(cardinality + 1):
		for w in powerset:
			if len(w) == k:
				powerset_orderred.append(w)
	return powerset_orderred

def fastPlrintNextLines(a):
	print('\n'.join(map(str, a)))
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
t = 1
for _ in range(t):
	n = ii()
	if n == 2:
		print(3)
		print(2, 1, 2)
		continue
	ans = []
	l = []
	for i in range(1, n + 1):
		if i % 2 == 0:
			l.append(i)
	for i in range(1, n + 1):
		if i % 2 == 1:
			ans.append(i)
	ans = l + ans + l
	print(len(ans))
	print(*ans)


from sys import stdin, stdout
n = int(stdin.readline().rstrip())
if n % 2 == 0:
	print(3 * (n // 2))
else:
	print(3 * (n - 1) // 2 + 1)
bombOrder = []
i = 2
while i <= n:
	bombOrder.append(str(i))
	i += 2
i = 1
while i <= n:
	bombOrder.append(str(i))
	i += 2
i = 2
while i <= n:
	bombOrder.append(str(i))
	i += 2
print(' '.join(bombOrder))


r = list(range(1, int(input()) + 1))
print(3 * len(r) // 2)
for i in r[1::2] + r[::2] + r[1::2]:
	print(i)


n = int(input())
e = []
o = []
for i in range(1, n + 1):
	if i % 2 == 0:
		e.append(str(i))
	else:
		o.append(str(i))
print(len(e) + len(o) + min(len(e), len(o)))
if len(e) < len(o):
	print(' '.join(e), ' '.join(o), ' '.join(e))
else:
	print(' '.join(o), ' '.join(e), ' '.join(o))


def reader(contest):
	inp = input
	if not contest:
		fin = open('in', 'r')
		inp = lambda : fin.readline()[:-1]
	read = lambda : tuple(map(int, inp().split()))
	return (inp, read)
(inp, read) = reader(True)
n = read()[0]
(l1, l2) = ([], [])
for i in range(1, n, 2):
	l1 += [i + 1]
for i in range(0, n, 2):
	l2 += [i + 1]
for i in range(1, n, 2):
	l1 += [i + 1]
l1ld2 = len(l1) // 2
print(len(l1) + len(l2))
print(*l1[:l1ld2] + l2 + l1[l1ld2:])


n = int(input())
ans = []
for i in range(1, n + 1):
	if i % 2 == 0:
		ans.append(i)
for i in range(1, n + 1):
	if i % 2 == 1:
		ans.append(i)
for i in range(1, n + 1):
	if i % 2 == 0:
		ans.append(i)
print(len(ans))
print(*ans)


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


n = int(input())
ans = list()
for i in range(2, n + 1, 2):
	ans.append(i)
for i in range(1, n + 1, 2):
	ans.append(i)
for i in range(2, n + 1, 2):
	ans.append(i)
print(len(ans))
print(' '.join(map(str, ans)))


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


n = int(input())
ans = [x for x in range(2, n + 1, 2)]
ans.extend([x for x in range(1, n + 1, 2)])
ans.extend([x for x in range(2, n + 1, 2)])
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input())
if n == 2:
	print(3)
	print(2, 1, 2)
	exit()
else:
	l = []
	for i in range(2, n + 1):
		if i % 2 == 0:
			l.append(i)
	for i in range(1, n + 1):
		if i % 2 != 0:
			l.append(i)
	for i in range(2, n + 1):
		if i % 2 == 0:
			l.append(i)
	print(len(l))
	print(*l)


from math import *
tt = int(input())
print(tt + tt // 2)
a1 = list(range(2, tt + 1, 2))
a2 = list(range(1, tt + 1, 2))
a1 = ' '.join([str(i) for i in a1])
a2 = ' '.join([str(i) for i in a2])
if tt % 2 == 1:
	print(a1, end=' ')
	print(a2, end=' ')
	print(a1)
else:
	print(a2, end=' ')
	print(a1, end=' ')
	print(a2)


n = int(input())
if n == 2:
	print(3)
	print(2, 1, 2)
	exit(0)
ans = [i for i in range(2, n + 1, 2)]
ans += [i for i in range(1, n + 1, 2)]
ans += [i for i in range(2, n + 1, 2)]
print(len(ans))
print(*ans)


n = int(input())
even = [i for i in range(1, n + 1) if i % 2 == 0]
odd = [i for i in range(1, n + 1) if i & 1]
print(2 * len(even) + len(odd))
l = even + odd + even
print(*l)


n = int(input())
a = [*range(2, n + 1, 2)]
print(int(n * 1.5), '\n', *a, *range(1, n + 1, 2), *a)


n = int(input())
tot = n + n // 2
flat_list = [str(x) for x in range(2, n + 1, 2)] + [str(x) for x in range(1, n + 1, 2)] + [str(x) for x in range(2, n + 1, 2)]
print(tot)
print(' '.join(flat_list))


n = int(input())
print(n // 2 + n)
a = [int(i) for i in range(2, n + 1, 2)]
b = a + [int(i) for i in range(1, n + 1, 2)] + a
for i in b:
	print(i, end=' ')


even = []
odd = []
n = input()
n = int(n)
list = []
for i in range(1, n + 1):
	if i & 1 == 1:
		odd.append(i)
	else:
		even.append(i)
print(2 * len(even) + len(odd))
for i in even:
	print(i, end=' ')
for i in odd:
	print(i, end=' ')
for i in even:
	print(i, end=' ')


n = int(input())
l1 = []
l2 = []
for i in range(1, n + 1, 2):
	l1.append(i)
for i in range(2, n + 1, 2):
	l2.append(i)
ans = l2 + l1 + l2
print(len(ans))
print(*ans)


n = int(input())
ans = n + n // 2
print(ans)
if n % 2 == 1:
	for i in range(n // 2):
		print('%d' % (2 * (i + 1)), end=' ')
	for i in range(n // 2 + 1):
		print('%d' % (2 * i + 1), end=' ')
	for i in range(n // 2):
		print('%d' % (2 * (i + 1)), end=' ')
else:
	for i in range(n // 2 - 1):
		print('%d' % (2 * (i + 1)), end=' ')
	for i in range(n // 2):
		print('%d' % (2 * i + 1), end=' ')
	for i in range(n // 2 - 1):
		print('%d' % (2 * (i + 1)), end=' ')
	print('%d %d' % (n, n - 1), end='\n')


from sys import stdin, stdout
n = int(stdin.readline())
ans = []
if n & 1:
	for i in range(2, n + 1, 2):
		ans.append(i)
	for i in range(1, n + 1, 2):
		ans.append(i)
	for i in range(2, n + 1, 2):
		ans.append(i)
else:
	for i in range(1, n + 1, 2):
		ans.append(i)
	for i in range(2, n + 1, 2):
		ans.append(i)
	for i in range(1, n + 1, 2):
		ans.append(i)
stdout.write(str(len(ans)) + '\n')
for v in ans:
	stdout.write(str(v) + ' ')


n = int(input())
if n % 2 == 0:
	print(int(n * 1.5))
	print(*list(range(1, n + 1, 2)), end=' ')
	print(*list(range(2, n + 1, 2)), end=' ')
	print(*list(range(1, n + 1, 2)), end=' ')
else:
	print(3 * (n // 2) + 1)
	print(*list(range(2, n + 1, 2)), end=' ')
	print(*list(range(1, n + 1, 2)), end=' ')
	print(*list(range(2, n + 1, 2)), end=' ')


import math
n = int(input())
print(n + math.floor(n / 2))
for even in [True, False, True]:
	for i in range(n):
		if (i + 1) % 2 == 1 and (not even):
			print(i + 1, end=' ')
		if (i + 1) % 2 == 0 and even:
			print(i + 1, end=' ')


e = []
o = []

def solve():
	n = int(input())
	for i in range(1, n + 1):
		if i % 2 == 0:
			e.append(i)
		else:
			o.append(i)
	print(len(e) * 2 + len(o))
	for i in range(len(e)):
		print(e[i], end=' ')
	for i in range(len(o)):
		print(o[i], end=' ')
	for i in range(len(e)):
		print(e[i], end=' ')
solve()


n = int(input())
A = []
B = []
for i in range(1, n + 1, 2):
	A.append(i)
for i in range(2, n + 1, 2):
	B.append(i)
if len(A) < len(B):
	A = A + B + A
else:
	A = B + A + B
print(len(A))
for i in A:
	print(i, end=' ')


n = int(input())
outstr = ''
if n % 2 == 0:
	print(n // 2 * 3)
	phrasea = ''
	phraseb = ''
	for i in range(1, n // 2 + 1):
		phrasea += '{} '.format(2 * i)
		phraseb += '{} '.format(2 * i - 1)
	outstr = phrasea + phraseb + phrasea
	outstr = outstr[:-1]
	print(outstr)
else:
	print((3 * n - 1) // 2)
	phrasea = ''
	phraseb = ''
	for i in range(1, (n + 1) // 2):
		phrasea += '{} '.format(2 * i)
		phraseb += '{} '.format(2 * i - 1)
	phraseb += '{} '.format(n)
	outstr = phrasea + phraseb + phrasea
	outstr = outstr[:-1]
	print(outstr)


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


n = int(input())
i = 2
ar = list()
while i <= n:
	ar.append(i)
	i += 2
i = 1
while i <= n:
	ar.append(i)
	i += 2
i = 2
while i <= n:
	ar.append(i)
	i += 2
print(len(ar))
for i in ar:
	print(i, end=' ')


n = int(input())
if n == 2:
	print('3', '2 1 2', sep='\n')
elif n == 3:
	print('4', '2 1 3 2', sep='\n')
else:
	b = []
	for i in range(2, n + 1, 2):
		b.append(i)
	for i in range(1, n + 1, 2):
		b.append(i)
	for i in range(2, n + 1, 2):
		b.append(i)
	print(len(b))
	print(*b)


n = int(input())
ans = ''
count = 0
for i in range(2, n + 1, 2):
	ans += str(i) + ' '
	count += 1
for i in range(1, n + 1, 2):
	ans += str(i) + ' '
	count += 1
for i in range(2, n + 1, 2):
	ans += str(i) + ' '
	count += 1
print(count)
print(ans)


import math
n = int(input())
if n == 2:
	print(3)
	print('2 1 2')
elif n == 3:
	print(4)
	print('2 1 3 2')
else:
	print(n + math.floor(n / 2))
	for even in [True, False, True]:
		for i in range(n):
			if (i + 1) % 2 == 1 and (not even):
				print(i + 1, end=' ')
			if (i + 1) % 2 == 0 and even:
				print(i + 1, end=' ')


n = int(input())
if n == 2:
	print(3)
	print(2, 1, 2)
else:
	shoots = [i for i in range(2, n + 1, 2)] + [i for i in range(1, n + 1, 2)] + [i for i in range(2, n + 1, 2)]
	print(len(shoots))
	print(' '.join(map(str, shoots)))


n = int(input())
x = list(range(1, n, 2)) + list(range(0, n, 2)) + list(range(1, n, 2))
print(len(x))
for i in x:
	print(i + 1)


i = int(input())
A = [*range(2, i + 1, 2)]
B = [*range(1, i + 1, 2)]
print(len(A) + i)
print(*A, *B, *A)


from math import sqrt

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

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

def map_string():
	return input().split()
n = int(input())
a = []
for i in range(2, n + 1, 2):
	a.append(i)
for i in range(1, n + 1, 2):
	a.append(i)
for i in range(2, n + 1, 2):
	a.append(i)
print(len(a))
for i in a:
	print(i, end=' ')


n = int(input())
x = list(range(2, n + 1, 2))
y = list(range(1, n + 1, 2))
print(len(x + y + x))
print(*x + y + x)


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


M = int(input())
if M % 2 == 0:
	ans = M // 2 * 3
else:
	ans = M // 2 * 3 + 1
print(ans)
rua = 2
while rua <= M:
	print(rua, end=' ')
	rua += 2
rua = 1
while rua <= M:
	print(rua, end=' ')
	rua += 2
rua = 2
while rua <= M:
	print(rua, end=' ')
	rua += 2


import math
n = int(input())
m = n + math.floor(n / 2)
print(m)
for i in range(2, n + 1, 2):
	print(i, end=' ')
for i in range(1, n + 1, 2):
	print(i, end=' ')
for i in range(2, n + 1, 2):
	print(i, end=' ')


a = int(input())
l = []
r = []
ans = []
for i in range(1, a + 1, 2):
	l.append(i)
for i in range(2, a + 1, 2):
	r.append(i)
s = len(r) + len(l) + len(r)
print(s)
for i in range(len(r)):
	print(r[i], end=' ')
for i in range(len(l)):
	print(l[i], end=' ')
for i in range(len(r)):
	print(r[i], end=' ')


from __future__ import print_function
n = int(input())
k = 3 * (n // 2) + n % 2
print(k)
a = list()
for i in range(2, n + 1, 2):
	a.append(i)
for i in range(1, n + 1, 2):
	a.append(i)
for i in range(2, n + 1, 2):
	a.append(i)
print(*a, sep=' ')


import os
import sys
import math
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())
r = 2 * (n // 2) + math.ceil(n / 2)
print(r)
s = []
for i in range(1, n, 2):
	s.append(i + 1)
for i in range(0, n, 2):
	s.append(i + 1)
for i in range(1, n, 2):
	s.append(i + 1)
print(*s)


n = int(input())
print(2 * (n // 2) + (n + 1) // 2)
odd = [i for i in range(1, n + 1, 2)]
even = [i for i in range(2, n + 1, 2)]
print(*even, end=' ')
print(*odd, end=' ')
print(*even)


n = int(input())
ss = 0
e = [int(i) for i in range(2, n + 1, 2)]
ss += 2 * len(e)
o = [int(i) for i in range(1, n + 1, 2)]
ss += len(o)
e += o + e
print(ss)
print(*e)


n = int(input())
r = [i for i in range(2, n + 1, 2)] + [i for i in range(1, n + 1, 2)] + [i for i in range(2, n + 1, 2)]
print(len(r))
print(*r)


n = int(input())
an = []
for i in range(1, n, 2):
	an.append(i)
for i in range(0, n, 2):
	an.append(i)
for i in range(1, n, 2):
	an.append(i)
print(len(an))
for i in an:
	print(i + 1, end=' ')


from math import *
n = int(input())
print(n // 2 * 2 + int(ceil(n / 2)))
for i in range(2, n + 1, 2):
	print(i, end=' ')
for i in range(1, n + 1, 2):
	print(i, end=' ')
for i in range(2, n + 1, 2):
	print(i, end=' ')


n = int(input())
list_range = []
list_range += list(range(2, n + 1, 2))
list_range += list(range(1, n + 1, 2))
list_range += reversed(list(range(2, n + 1, 2)))
print(len(list_range))
print(*list_range)


n = int(input())
uno = list(range(2, n + 1, 2))
dos = list(range(1, n + 1, 2))
print(2 * len(uno) + len(dos))
print(*uno, *dos, *uno)


import math
n = int(input())
tanks = [[x] for x in range(1, n + 1)]
odds = []
for i in range(1, n + 1, 2):
	odds.append(i)
evens = []
for i in range(2, n + 1, 2):
	evens.append(i)
operations = evens + odds + evens
iter_count = math.floor(n * 1.5)
print(iter_count)
print(' '.join(map(str, operations[:iter_count])))


s = int(input())
i = 2
print(s // 2 + s - s // 2 + s // 2)
while i <= s:
	print(i, end=' ')
	i += 2
i = 1
while i <= s:
	print(i, end=' ')
	i += 2
i = 2
while i <= s:
	print(i, end=' ')
	i += 2


n = int(input())
if n == 1:
	ans = 2
	strs = '1 1'
else:
	ans = n // 2 + n
	strs = ''
	i = 0
	while i < ans:
		j = 2
		while j <= n and i < ans:
			strs += str(j)
			strs += ' '
			j += 2
			i += 1
		j = 1
		while j <= n and i < ans:
			strs += str(j)
			strs += ' '
			j += 2
			i += 1
print(ans)
print(strs)


n = int(input())
print(n + n // 2)
print(*range(2, n + 1, 2), *range(1, n + 1, 2), *range(2, n + 1, 2))


n = int(input())
R = [i + 1 for i in range(n)]
even = list(filter(lambda x: x % 2 == 0, R))
odd = list(filter(lambda x: x % 2 != 0, R))
num = 2 * len(even) + len(odd)
print(num)
print(' '.join(map(str, even + odd + even)))


def main():
	n = int(input())
	k1 = [i for i in range(2, n + 1, 2)]
	k2 = [i for i in range(1, n + 1, 2)]
	k = k1 + k2 + k1
	print(len(k))
	print(*k)
	return
main()


def solve(m):
	ans = []
	for i in range(3):
		for j in range(1, n + 1):
			if (i - j) % 2 == 0:
				ans.append(j)
	return ans
n = int(input())
x = solve(n)
print(len(x))
print(*x)


N = int(input())
if N % 2 == 0:
	print(int(3 * (N / 2)))
else:
	print(int(N + N / 2))
for i in range(2, N + 1, 2):
	(print(i, end=' '),)
for i in range(1, N + 1, 2):
	(print(i, end=' '),)
for i in range(2, N + 1, 2):
	(print(i, end=' '),)


from itertools import chain
n = int(input())
print(n + n // 2)
print(' '.join(map(str, chain(range(2, n + 1, 2), range(1, n + 1, 2), range(2, n + 1, 2)))))


n = int(input())
print(str(n + n // 2))
for i in range(n + 1):
	if i == 0 or i % 2 == 1:
		continue
	print(str(i) + ' ', end='')
for i in range(n + 1):
	if i == 0 or i % 2 == 0:
		continue
	print(str(i) + ' ', end='')
for i in range(n + 1):
	if i == 0 or i % 2 == 1:
		continue
	print(str(i) + ' ', end='')


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


import math
import re
import os
import string
import sys

def ria():
	return [int(i) for i in input().split()]

def ri():
	return int(input())

def rfa():
	return [float(i) for i in input().split()]
eps = 1e-09

def is_equal(a, b):
	return abs(a - b) <= eps

def distance(p0, p1):
	return math.sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2)
n = ri()
ar = []
for i in range(1, n + 1):
	if i % 2 == 0:
		ar.append(i)
for i in range(1, n + 1):
	if i % 2 == 1:
		ar.append(i)
for i in range(1, n + 1):
	if i % 2 == 0:
		ar.append(i)
print(len(ar))
for i in ar:
	print(i, end=' ')


n = int(input())
even = n // 2
odd = n - even
ans = 2 * even + odd
print(ans)
lo = []
le = []
for x in range(1, n + 1):
	if x % 2 == 0:
		le.append(str(x))
	else:
		lo.append(str(x))
lans = le + lo + le
print(' '.join((x for x in lans)))


n = int(input())
if n % 2 == 1:
	print(n // 2 * 3 + 1)
else:
	print(n // 2 * 3)
print(*range(2, n + 1, 2), end=' ')
print(*range(1, n + 1, 2), end=' ')
print(*range(2, n + 1, 2), end=' ')


from sys import stdin
n = int(input())
print(n + n // 2)
for i in range(2, n + 1, 2):
	print(i)
for i in range(1, n + 1, 2):
	print(i)
for i in range(2, n + 1, 2):
	print(i)


n = int(input())
print(n + n // 2)
x = [i for i in range(2, n + 1, 2)]
x += [i for i in range(1, n + 1, 2)]
x += [i for i in range(2, n + 1, 2)]
print(' '.join(map(str, x)))


n = int(input())
mina = 0
minb = 0
a = ''
b = ''
for i in range(1, n + 1):
	if i % 2 == 0:
		a += ' ' + str(i)
		mina += 1
	else:
		b += ' ' + str(i)
		minb += 1
print(mina * 2 + minb)
print(a[1:], b[1:], a[1:])


n = int(input())
k = list(range(2, n + 1, 2)) + list(range(1, n + 1, 2)) + list(range(2, n + 1, 2))
print(len(k))
print(' '.join(map(str, k)))


t = int(input())
a = []
for i in range(1, t + 1):
	if i % 2 == 0:
		a.append(i)
for i in range(1, t + 1):
	if i % 2 == 1:
		a.append(i)
for i in range(1, t + 1):
	if i % 2 == 0:
		a.append(i)
print(str(len(a)))
print(' '.join(list(map(str, a))))


n = int(input())
x = n // 2
y = n - x
print(2 * x + y)
for i in range(n % 2, n, 2):
	print(i + 1, end=' ')
for i in range(1 - n % 2, n, 2):
	print(i + 1, end=' ')
for i in range(n % 2, n, 2):
	print(i + 1, end=' ')


n = int(input())
o = n // 2 + n % 2
e = n // 2
kk = [0] * (e + e + o)
r = 0
for i in range(e):
	kk[r] = 2 + i * 2
	r += 1
for i in range(o):
	kk[r] = 1 + i * 2
	r += 1
for i in range(e):
	kk[r] = 2 + i * 2
	r += 1
print(len(kk))
print(' '.join(map(str, kk)))


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


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
ans = []
for i in range(2, N + 1, 2):
	ans.append(i)
for i in range(1, N + 1, 2):
	ans.append(i)
for i in range(2, N + 1, 2):
	ans.append(i)
print(len(ans))
print(' '.join(map(str, ans)))


n = int(input().strip())
tmp = []
i = 2
while i <= n:
	tmp.append(i)
	i = i + 2
i = 1
while i <= n:
	tmp.append(i)
	i = i + 2
i = 2
while i <= n:
	tmp.append(i)
	i = i + 2
print(len(tmp))
print(' '.join(map(str, tmp)))