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

Difficulty: MEDIUM_HARD

Solutions:
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())
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=' ')


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))


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)


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())
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=' ')


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)


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)))


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)


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())
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=' ')


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