Boy Dima gave Julian a birthday present — set $B$ consisting of positive integers. However, he didn't know, that Julian hates sets, but enjoys bipartite graphs more than anything else!

Julian was almost upset, but her friend Alex said, that he can build an undirected graph using this set in such a way: let all integer numbers be vertices, then connect any two $i$ and $j$ with an edge if $|i - j|$ belongs to $B$.

Unfortunately, Julian doesn't like the graph, that was built using $B$. Alex decided to rectify the situation, so he wants to erase some numbers from $B$, so that graph built using the new set is bipartite. The difficulty of this task is that the graph, Alex has to work with, has an infinite number of vertices and edges! It is impossible to solve this task alone, so Alex asks you for help. Write a program that erases a subset of minimum size from $B$ so that graph constructed on the new set is bipartite.

Recall, that graph is bipartite if all its vertices can be divided into two disjoint sets such that every edge connects a vertex from different sets.


-----Input-----

First line contains an integer $n ~ (1 \leqslant n \leqslant 200\,000)$ — size of $B$

Second line contains $n$ integers $b_1, b_2, \ldots, b_n ~ (1 \leqslant b_i \leqslant 10^{18})$ — numbers of $B$, all $b_i$ are unique


-----Output-----

In the first line print single integer $k$ – the number of erased elements. In the second line print $k$ integers — values of erased elements.

If there are multiple answers, print any of them.


-----Examples-----
Input
3
1 2 3

Output
1
2 
Input
2
2 6

Output
0

Difficulty: HARD
Tags: Number theory

Bit manipulation

Mathematics
Skill types: Bit manipulation

Starter code:

Solutions:
n = int(input())
l = list(map(int, input().split()))
ans = [0] * 65
bans = [0] * n
for i in range(n):
	b = l[i]
	score = 0
	while b % 2 == 0:
		b //= 2
		score += 1
	ans[score] += 1
	bans[i] = score
k = max(ans)
ind = ans.index(k)
print(n - k)
ta = [l[i] for i in range(n) if bans[i] != ind]
print(*ta)


import sys
input = sys.stdin.readline
from collections import *
n = int(input())
b = list(map(int, input().split()))
p = [0] * n
for i in range(n):
	t = b[i]
	while t % 2 == 0:
		p[i] += 1
		t //= 2
cnt = [0] * 70
for pi in p:
	cnt[pi] += 1
M = 0
max_p = -1
for i in range(70):
	if cnt[i] > M:
		M = cnt[i]
		max_p = i
ans = []
for i in range(n):
	if p[i] != max_p:
		ans.append(b[i])
print(n - M)
print(*ans)


n = int(input())
B = [int(a) for a in input().split()]

def extract_twos(x):
	ans = 0
	while x % 2 == 0:
		ans += 1
		x = int(x // 2)
	return ans
twos = [0 for i in range(n)]
counts = [0 for i in range(100)]
for (i, b) in enumerate(B):
	twos[i] = extract_twos(b)
	counts[twos[i]] += 1
best_2_power_count = 0
best_2_power = None
for (i, c) in enumerate(counts):
	if c >= best_2_power_count:
		best_2_power = i
		best_2_power_count = c
chosen = []
for (num_twos, b) in zip(twos, B):
	if num_twos != best_2_power:
		chosen.append(b)
print(n - best_2_power_count)
print(*chosen, sep=' ')


a = int(input())
l = list(map(int, input().split()))
ans = [0 for i in range(100)]
for i in l:
	n = 0
	while i % 2 == 0:
		n += 1
		i //= 2
	ans[n] += 1
k = ans.index(max(ans))
ann = []
for i in l:
	if i % 2 ** k != 0 or i % 2 ** (k + 1) == 0:
		ann.append(i)
	else:
		pass
print(len(ann))
print(*ann)


import sys, math, queue
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
n = int(input())
a = list(map(int, input().split()))
x = {}
for i in range(n):
	p = 0
	t = a[i]
	while t % 2 == 0:
		p += 1
		t = t >> 1
	if p in x:
		x[p].append(a[i])
	else:
		x[p] = [a[i]]
keep = []
for k in x:
	if len(x[k]) > len(keep):
		keep = x[k]
print(n - len(keep))
keep = set(keep)
for ai in a:
	if ai not in keep:
		print(ai, end=' ')
print()


import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
dic = {}
for a in A:
	c = (a & -a).bit_length()
	if c in dic:
		dic[c].append(a)
	else:
		dic[c] = [a]
L = []
num = -1
for (k, lst) in dic.items():
	if len(lst) > len(L):
		L = lst
		num = k
ans = []
for (k, lst) in dic.items():
	if k != num:
		ans += lst
print(len(ans))
print(*ans)


from collections import defaultdict

def solve(n):
	count = 0
	while n != 0:
		if n % 2 == 0:
			n //= 2
			count += 1
		else:
			return count
	return count
n = int(input())
l = list(map(int, input().split()))
hash = defaultdict(list)
maxi = -10
ans = -1
for i in l:
	z = solve(i)
	hash[z].append(i)
	if len(hash[z]) > maxi:
		maxi = max(len(hash[z]), maxi)
		ans = z
final = []
for i in hash:
	if i != ans:
		for j in hash[i]:
			final.append(j)
print(len(final))
print(*final)


n = int(input())
b = [int(x) for x in input().strip().split()]
result = {}
for x in b:
	tmp = x
	cnt = 0
	while tmp & 1 == 0:
		cnt += 1
		tmp >>= 1
	if cnt not in result:
		result[cnt] = []
	result[cnt].append(x)
res1 = max([len(result[x]) for x in result])
print(n - res1)
if n == res1:
	return
res2 = None
for x in result:
	if len(result[x]) == res1:
		res2 = x
		break
res3 = []
for x in result:
	if x != res2:
		for y in result[x]:
			res3.append(str(y))
print(' '.join(res3))


from collections import defaultdict
n = int(input())
b = list(map(int, input().split()))
a = defaultdict(list)
for x in b:
	y = x
	c = 0
	while y % 2 == 0:
		y //= 2
		c += 1
	a[c].append(x)
largest = max(a.keys(), key=lambda k: len(a[k]))
out = []
for (key, l) in a.items():
	if key == largest:
		continue
	out += l
print(len(out))
print(*out)


import os, sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split()))
	powe = [0] * 61
	po = [0] * n
	for (ind, i) in enumerate(a):
		ans = 0
		while not i & 1:
			i >>= 1
			ans += 1
		powe[ans] += 1
		po[ind] = ans
	maxi = powe.index(max(powe))
	re = [a[i] for i in range(n) if po[i] != maxi]
	print(len(re))
	print(*re)
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')
main()


def lastBit(n):
	i = 0
	while not n >> i & 1:
		i = i + 1
	return i
a = []
size = int(input())
a = list(map(int, input().split()))
last = []
for i in range(0, size):
	last.append(lastBit(a[i]))
freq = {}
for i in range(0, size):
	if last[i] in freq:
		freq[last[i]] += 1
	else:
		freq[last[i]] = 1
maxi = -1
for i in freq:
	if maxi < freq[i]:
		maxi = freq[i]
		e = i
print(size - maxi)
for i in range(0, size):
	if last[i] != e:
		print(a[i], end=' ')


import sys
input = sys.stdin.readline
n = int(input())
b = list(map(int, input().split()))
p = [[] for i in range(61)]
for i in range(n):
	c = b[i]
	cnt = 0
	while c % 2 == 0:
		cnt += 1
		c //= 2
	p[cnt].append(b[i])
max_l = 0
ans = []
for i in range(61):
	if max_l < len(p[i]):
		max_l = len(p[i])
		ans = p[i]
arr = list(set(b) - set(ans))
print(len(arr))
print(*arr)


from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect

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

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

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	res = list(sys.stdin.readline())
	if res[-1] == '\n':
		return res[:-1]
	return res

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def A():
	n = I()
	s = S()
	d = defaultdict(lambda : 0)
	for i in s:
		d[i] += 1
	ans = [1] * d['n']
	d['o'] -= d['n']
	ans += [0] * d['o']
	print(*ans)
	return

def B():
	n = I()
	m = LIR(n)
	f = [0] * n
	for i in range(n):
		for j in range(n):
			if i == j:
				continue
			f[i] += math.log(m[i][j], 10)
	F = sum(f)
	p = F / (2 * (n - 1))
	a = [round(10 ** ((f[i] - p) / (n - 2))) for i in range(n)]
	print(*a)
	return

def C():
	s = S()
	n = len(s)
	g = [0] * n
	m = 26
	f = [set() for i in range(n)]
	f[ord(s[0]) - ord('a')].add(0)
	for i in range(1, n):
		lis = set()
		k = ord(s[i]) - ord('a')
		for j in range(k):
			lis |= f[j]
		for j in range(100):
			if j not in lis:
				g[i] = j
				break
		f[k].add(j)
	for i in g:
		if i == 0:
			print('Mike')
		else:
			print('Ann')
	return

def D():
	n = I()
	b = LI()
	l = [i & -i for i in b]
	d = defaultdict(lambda : 0)
	for i in l:
		d[i] += 1
	m = [0, 0]
	for (i, j) in d.items():
		if m[1] < j:
			m = [i, j]
	ans = []
	for i in range(n):
		if m[0] != l[i]:
			ans.append(b[i])
	print(len(ans))
	print(*ans)
	return

def E():
	return

def F():
	return

def G():
	return
D()


from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
p = [0] * n
for i in range(n):
	xx = a[i]
	while xx % 2 == 0:
		p[i] += 1
		xx = xx // 2
c = Counter(p)
an = c.most_common(1)[0]
print(n - an[1])
for i in range(n):
	if p[i] != an[0]:
		print(a[i])


import os
from collections import *
n = int(input())
A = list(map(int, input().split()))
B = [(a & -a).bit_length() for a in A]
C = Counter(B).most_common(1)[0][0]
ans = []
for i in range(n):
	if C != B[i]:
		ans.append(A[i])
print(len(ans))
if ans:
	print(*ans)


n = int(input())
a = list(map(int, input().split()))
b = [0] * n
c = [0] * 64
pos = 0
for i in range(n):
	x = a[i]
	d = 0
	while x % 2 == 0:
		x //= 2
		d += 1
	b[i] = d
	c[d] += 1
for i in range(63):
	if c[pos] < c[i]:
		pos = i
print(n - c[pos])
for i in range(n):
	if b[i] != pos:
		print(a[i], end=' ')


import math
n = int(input())
B = list(map(int, input().split()))

def solve(B):
	odds = []
	evens = []
	for b in B:
		if b % 2 == 0:
			evens.append(b)
		else:
			odds.append(b)
	if len(evens) == 0:
		return []
	even_gcd = evens[0]
	for e in evens:
		even_gcd = math.gcd(even_gcd, e)
	even_remove = [even_gcd * x for x in solve([e // even_gcd for e in evens])]
	if len(odds) + len(even_remove) < len(evens):
		return odds + even_remove
	else:
		return evens
ans = solve(B)
print(len(ans))
if len(ans) != 0:
	print(' '.join([str(x) for x in ans]))


n = int(input())
B = list(map(int, input().split()))
A = []
for i in range(100):
	A.append([])
for i in B:
	x = i
	c = 0
	while x % 2 == 0:
		x //= 2
		c += 1
	A[c].append(i)
mlen = 0
f = 1
for lst in A:
	mlen = max(mlen, len(lst))
ans = []
for lst in A:
	if len(lst) == mlen and f:
		f = 0
	else:
		for x in lst:
			ans.append(x)
print(len(ans))
print(' '.join(list(map(str, ans))))


import sys
input = sys.stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())

class Solver:

	def __init__(self):
		self.n = I()
		self.a = L()
		self.b = [0] * self.n
		self.LOG = 62
		self.ans = []

	def pwrOfTwo(self, x):
		if x & 1 or x == 0:
			return 0
		return 1 + self.pwrOfTwo(x >> 1)

	def run(self):
		for i in range(self.n):
			self.b[i] = self.pwrOfTwo(self.a[i])
		mx = 0
		bit = 0
		for i in range(0, self.LOG):
			cnt = 0
			for x in self.b:
				if x == i:
					cnt += 1
			if cnt > mx:
				mx = cnt
				bit = i
		for i in range(self.n):
			if self.b[i] != bit:
				self.ans.append(self.a[i])
		print(len(self.ans))
		print(*self.ans)
o = Solver()
o.run()


import sys
from collections import Counter
readline = sys.stdin.readline
N = int(input())
A = list(map(int, readline().split()))
B = [(a & -a).bit_length() for a in A]
C = Counter(B).most_common(1)[0][0]
Ans = []
for i in range(N):
	if C != B[i]:
		Ans.append(A[i])
print(len(Ans))
if Ans:
	print(*Ans)


import sys
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = 1
uu = t
while t > 0:
	t -= 1
	n = fi()
	a = li()
	d = [0 for i in range(70)]
	w = []
	for i in range(n):
		p = a[i]
		c = 0
		while p % 2 == 0:
			p //= 2
			c += 1
		d[c] += 1
		w.append(c)
	j = 0
	p = max(d)
	for i in range(70):
		if d[i] == p:
			j = i
			break
	ans = []
	for i in range(n):
		if w[i] != j:
			ans.append(a[i])
	print(len(ans))
	print(*ans)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
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')

class SegmentTree:

	def __init__(self, data, default=-10 ** 6, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(50001)]
pp = []

def SieveOfEratosthenes(n=50000):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for i in range(50001):
		if prime[i]:
			pp.append(i)
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(list)
for num in a:
	c = 0
	copy = num
	while num % 2 == 0:
		c += 1
		num //= 2
	d[c].append(copy)
b = sorted(d, key=lambda k: len(d[k]), reverse=True)
res = []
c = 0
for i in range(1, len(b)):
	c += len(d[b[i]])
	res += d[b[i]]
print(c)
print(*res)


from collections import Counter
n = int(input())
b = list(map(int, input().split()))
a = [0] * n

def divide_count(n, p):
	cnt = 0
	val = p
	while n % p == 0:
		n //= p
		cnt += 1
	return cnt
for i in range(n):
	a[i] = divide_count(b[i], 2)
A = Counter(a).most_common()
k = A[0][0]
print(n - A[0][1])
ans = []
if not n - A[0][1] == 0:
	for i in range(n):
		if a[i] != k:
			ans.append(b[i])
print(*ans)


import sys
input = sys.stdin.readline
import copy
from math import *
n = int(input())
a = [int(x) for x in input().split()]
d = [0 for i in range(70)]
for i in range(n):
	l = bin(a[i])[2:]
	d[l[::-1].index('1')] += 1
print(n - max(d))
r = d.index(max(d))
for i in range(n):
	l = bin(a[i])[2:]
	if l[::-1].index('1') != r:
		print(a[i], end=' ')


N = int(input())
(*B,) = map(int, input().split())
C = [0] * 64
L = [[] for i in range(64)]
for b in B:
	l = (b & -b).bit_length()
	C[l] += 1
	L[l].append(b)
i = C.index(max(C))
R = [b for b in B if (b & -b).bit_length() != i]
print(len(R))
if R:
	print(*R)


n = int(input())
dists = list(map(int, input().split()))
pow2 = [[] for _ in range(64)]
Set = [0] * n
for i in range(n):
	ds = d = dists[i]
	powd = 0
	while d % 2 == 0:
		d >>= 1
		powd += 1
	pow2[powd].append(ds)
	Set[i] = powd
maxset = max(range(64), key=lambda x: len(pow2[x]))
print(n - len(pow2[maxset]))
for i in range(n):
	if Set[i] != maxset:
		print(dists[i], end=' ')


import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
fsum = 0
FANS = []
for base in range(65):
	bas = 1 << base
	sum = 0
	ANS = []
	for a in A:
		if a % bas == 0:
			if a // bas % 2 == 1:
				sum += 1
				ANS.append(a)
	if sum > fsum:
		fsum = sum
		FANS = ANS
print(n - fsum)
D = set()
for f in FANS:
	D.add(f)
T = [a for a in A if a not in D]
print(*T)


data = [[] for i in range(70)]
n = int(input())
d = [int(i) for i in input().split()]
for k in d:
	j = k
	cnt = 0
	while not j & 1:
		cnt += 1
		j >>= 1
	data[cnt].append(k)
ind = max(range(70), key=lambda a: len(data[a]))
print(n - len(data[ind]))
for i in range(70):
	if i != ind:
		for v in data[i]:
			print(v, end=' ')


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
import statistics

def main():
	n = inin()
	a = ain()
	b = [0] * n
	for i in range(n):
		j = a[i]
		x = 0
		while j % 2 == 0:
			x += 1
			j = j // 2
		b[i] = x
	p = statistics.mode(b)
	ans = []
	for i in range(n):
		if b[i] != p:
			ans.append(a[i])
	print(len(ans))
	print(*ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


try:
	from string_source import string_source
	source = string_source('2\n2 6')
except ImportError:
	source = input
from collections import Counter

def two_factors(n):
	if n == 0:
		return 0
	f = 0
	while n % 2 == 0:
		f += 1
		n //= 2
	return f

def f(numbers):
	twos = list(map(two_factors, numbers))
	m = max(Counter(twos).items(), key=lambda x: x[1])[0]
	erased = [n for (n, t) in zip(numbers, twos) if t != m]
	return (len(erased), erased)
source()
(n, erased) = f(list(map(int, source().split(' '))))
print(n)
print(' '.join(map(str, erased)))


n = int(input())
l = list(map(int, input().split()))
arr = [0] * 65
ll = [0] * n
for i in range(n):
	cou = 0
	a = l[i]
	while a % 2 == 0:
		cou += 1
		a = a // 2
	arr[cou] += 1
	ll[i] = cou
m = arr.index(max(arr))
res = []
rak = 0
for i in range(n):
	if ll[i] == m:
		rak += 1
	else:
		res.append(l[i])
print(n - rak)
if n - rak:
	print(*res)


def getLowestSetBit(x):
	i = 0
	while True:
		if x & 1 << i > 0:
			return i
		i += 1

def main():
	n = int(input())
	b = readIntArr()
	k = 0
	while 1 << k <= 10 ** 18:
		k += 1
	k += 2
	lsbCnts = [0] * k
	for x in b:
		lsbCnts[getLowestSetBit(x)] += 1
	maxLsbCntLsb = 0
	for i in range(1, k):
		if lsbCnts[i] > lsbCnts[maxLsbCntLsb]:
			maxLsbCntLsb = i
	erasedElements = []
	for x in b:
		if getLowestSetBit(x) != maxLsbCntLsb:
			erasedElements.append(x)
	print(len(erasedElements))
	multiLineArrayPrint(erasedElements)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

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

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(i, j):
	print('? {} {}'.format(i, j))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(' '.join([str(x) for x in ans])))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
for _abc in range(1):
	main()


n = int(input())
a = list(map(int, input().split()))
c = 0
b = []
for i in range(n):
	k = 1
	t = 0
	while a[i] % k == 0:
		k = k * 2
		t += 1
	b.append(t)
from collections import Counter
count = Counter(b)
p = count.most_common()
x = p[0][0]
print(n - p[0][1])
for i in range(n):
	if b[i] != x:
		print(a[i], end=' ')


from collections import Counter

def countbit(x):
	ans = 0
	while not x & 1:
		ans += 1
		x >>= 1
	return ans
n = int(input())
b = list(map(int, input().split()))
cnt = Counter()
for x in b:
	cnt[countbit(x)] += 1
mostcnt = cnt.most_common(1)
ans = []
for x in b:
	if countbit(x) != mostcnt[0][0]:
		ans.append(x)
print(len(ans))
print(' '.join([str(x) for x in ans]))


n = int(input())
l = list(map(int, input().split()))
wyk = [0] * n
for i in range(n):
	left = 0
	right = 72
	while abs(left - right) > 1:
		mid = (left + right) // 2
		if l[i] % 2 ** mid == 0:
			left = mid
		else:
			right = mid
	mid = (left + right) // 2
	if l[i] % 2 ** (mid + 1) == 0:
		wyk[i] = mid + 1
	else:
		wyk[i] = mid
d = {}
for i in wyk:
	d[i] = 0
for i in wyk:
	d[i] += 1
mak = -888999
faw = 0
for i in d:
	if d[i] >= mak:
		mak = d[i]
		faw = i
print(n - mak)
for i in range(n):
	if wyk[i] != faw:
		print(l[i])


n = int(input())
a = list(map(int, input().split()))
count = [0] * 100
b = [0] * 200005
for (i, v) in enumerate(a):
	tot = 0
	while v % 2 == 0:
		v //= 2
		tot += 1
	count[tot] += 1
	b[i] = tot
m = max(count)
idx = count.index(m)
print(n - m)
for i in range(n):
	if b[i] != idx:
		print(a[i], end=' ')


n = int(input())
u = list(map(int, input().split()))
a = []
for i in range(n):
	a.append(len(bin(u[i] & -u[i])[2:]))
x = [0] * 61
for i in range(len(a)):
	x[a[i]] += 1
mx = max(x)
p = -1
for i in range(61):
	if x[i] == mx:
		p = i
		break
q = []
for i in range(n):
	if a[i] != p:
		q.append(u[i])
print(len(q))
print(' '.join(map(str, q)))


import sys

def twoDiv(n):
	at = 0
	while n % 2 == 0:
		n = n // 2
		at += 1
	return at
total = int(next(sys.stdin))
nums = [int(k) for k in next(sys.stdin).split()]
comps = {}
largest = 0
for n in nums:
	k = twoDiv(n)
	if k not in comps.keys():
		comps[k] = set()
	comps[k].add(n)
	largest = max(largest, len(comps[k]))
good = -1
for c in comps:
	if len(comps[c]) == largest:
		good = c
		break
del comps[good]
ans = set()
for c in comps:
	ans = ans | comps[c]
ans = sorted(list(ans))
print(total - largest)
at = 0
for k in ans:
	at = at + 1
	if at == total - largest:
		print(k, end='\n')
		quit()
	print(k, end=' ')


n = int(input())
a = list(map(int, input().split()))
d = [[] for _ in range(64)]
for (j, i) in enumerate(a):
	c = 0
	while i % 2 == 0:
		i //= 2
		c += 1
	d[c].append(j)
u = 0
for i in range(64):
	if len(d[i]) > len(d[u]):
		u = i
print(n - len(d[u]))
r = []
for i in range(64):
	if i == u:
		continue
	for j in d[i]:
		r.append(a[j])
if r:
	print(*r)


n = int(input())
b = list(map(int, input().split()))
pwr2 = [0] * n
cnt = [0] * 64
for i in range(n):
	x = b[i]
	while x & 1 == 0:
		x >>= 1
		pwr2[i] += 1
	cnt[pwr2[i]] += 1
ind = 0
for i in range(64):
	if cnt[ind] < cnt[i]:
		ind = i
print(n - cnt[ind])
print(*(b[i] for i in range(n) if pwr2[i] != ind))


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * n
for (i, x) in enumerate(a):
	while x % 2 == 0:
		cnt[i] += 1
		x //= 2
ok = Counter(cnt).most_common(1)[0][0]
ans = []
for i in range(n):
	if cnt[i] != ok:
		ans.append(a[i])
print(len(ans))
if ans:
	print(*ans)


n = int(input())
a = list(map(int, input().split()))
b = []

def bin(n):
	for i in range(65):
		if n >> i & 1:
			return i
for i in range(n):
	b.append(bin(a[i]))
d = {}
for i in range(n):
	if b[i] in d:
		d[b[i]] += 1
	else:
		d[b[i]] = 1
mx = -1
for i in d:
	if mx < d[i]:
		mx = d[i]
		k = i
print(n - mx)
for i in range(n):
	if b[i] != k:
		print(a[i], end=' ')


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	nonlocal factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	nonlocal fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

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

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	nonlocal memory
	memory = dict()

def cached_fn(fn, *args):
	nonlocal memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = False
fac_warm_up_size = 10 ** 5 + 100
optimise_for_recursion = False

def main():
	n = get_int()
	li = get_list()
	sets = [set() for _ in range(70)]
	for i in li:
		c = 0
		k = i
		while i % 2 == 0:
			i = i // 2
			c += 1
		sets[c].add(k)
	max_i = 0
	for index in range(70):
		if len(sets[max_i]) < len(sets[index]):
			max_i = index
	uni = set()
	for (i, seti) in enumerate(sets):
		if i != max_i:
			uni = uni.union(seti)
	print(len(uni))
	display_list(list(uni))
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


def gns():
	return list(map(int, input().split()))
n = int(input())
ns = gns()
cnt = [0] * 100
ans = 0
for c in ns:
	for l in range(100):
		if c % (1 << l) == 0:
			continue
		else:
			break
	l -= 1
	cnt[l] += 1
m = max(cnt)
for i in range(100):
	if cnt[i] == m:
		m = i
		break
x = []
for c in ns:
	if c % (1 << m) == 0 and c % (1 << m + 1) != 0:
		continue
	x.append(c)
print(len(x))
print(' '.join(map(str, x)))


n = int(input())
a = {}
b = list(map(int, input().split()))
c = []
for d in b:
	m = 0
	while not d % 2:
		d //= 2
		m += 1
	a[m] = a.get(m, 0) + 1
	c.append(m)
m = max(a.values())
print(n - m)
for i in a.keys():
	if a[i] == m:
		x = i
for (i, d) in enumerate(c):
	if d != x:
		print(b[i], end=' ')


from collections import Counter
n = int(input())
bs = [int(x) for x in input().split()]
ls = [0] * n
for i in range(n):
	b = bs[i]
	while b % 2 == 0:
		ls[i] += 1
		b //= 2
c = Counter(ls)
mst = c.most_common(1)[0]
print(n - mst[1])
for i in range(n):
	if ls[i] != mst[0]:
		print(bs[i])


from sys import stdin
n = int(stdin.readline())
nums = [int(x) for x in stdin.readline().split()]
most = 0
most2 = []
nums2 = nums[:]
d = 2
while nums2:
	evens = []
	odds = []
	for x in nums2:
		if x % d == 0:
			evens.append(x)
		else:
			odds.append(x)
	if len(odds) > most:
		most = len(odds)
		most2 = odds
	nums2 = evens
	d *= 2
print(n - most)
most2 = set(most2)
outL = []
for x in nums:
	if not x in most2:
		outL.append(x)
print(' '.join([str(x) for x in outL]))


n = int(input())
a = list(map(int, input().split()))
b = [0] * 100
c = [0] * n
p = 0
for _ in range(n):
	i = 0
	j = a[_]
	while j % 2 == 0:
		i += 1
		j //= 2
	b[i] += 1
	c[_] = i
for _ in range(100):
	if b[_] > b[p]:
		p = _
print(n - b[p])
print(*[a[_] for _ in range(n) if c[_] != p])


n = int(input())
nums = list(map(int, input().split()))
a = [0] * 100
b = [0] * n
count = 0
for _ in range(n):
	x = 0
	y = nums[_]
	while y % 2 == 0:
		x += 1
		y //= 2
	a[x] += 1
	b[_] = x
for _ in range(100):
	if a[_] > a[count]:
		count = _
print(n - a[count])
print(*[nums[_] for _ in range(n) if b[_] != count])


n = int(input())
l = list(map(int, input().split()))
temp = []
for i in l:
	temp.append(len(bin(i & -i)[2:]))
f = [0] * 61
for i in temp:
	f[i] += 1
cmp = f.index(max(f))
ans = []
for i in range(n):
	if temp[i] != cmp:
		ans.append(l[i])
print(len(ans))
print(*ans)


import sys
input = sys.stdin.readline
n = int(input())
B = list(map(int, input().split()))
ANS = [0] * 65
BANS = [0] * n
for i in range(n):
	b = B[i]
	score = 0
	while b % 2 == 0:
		b //= 2
		score += 1
	ANS[score] += 1
	BANS[i] = score
k = max(ANS)
ind = ANS.index(k)
print(n - k)
T = [B[i] for i in range(n) if BANS[i] != ind]
print(*T)


n = int(input())
a = list(map(int, input().split()))
bit = [0] * 64
b = []
for i in a:
	k = i
	count = 0
	while not k % 2:
		k = k // 2
		count += 1
	b.append(count)
	bit[count] += 1
print(n - max(bit))
for i in range(n):
	if b[i] != bit.index(max(bit)):
		print(a[i], end=' ')
print()


import math
n = int(input())
v = [i for i in map(int, input().split(' '))]
odd = []
even = []
for i in v:
	if i % 2 == 1:
		odd.append(i)
	else:
		even.append(i)
d = {}
for i in even:
	k = i
	cnt = 0
	while k % 2 == 0:
		cnt += 1
		k //= 2
	if cnt not in d.keys():
		d[cnt] = []
	d[cnt].append(i)
mx = 0
ans = []
for i in d.keys():
	buf = d[i]
	if len(buf) > mx:
		mx = len(buf)
		ans = buf
if len(ans) < len(odd):
	ans = odd
s = set(ans)
print(n - len(ans))
for i in v:
	if i not in s:
		print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
max_ = 0
ind = -1
d = {0: 0}
mark = [0] * n
for (i, x) in enumerate(a):
	if x % 2 == 1:
		d[0] += 1
	else:
		cnt = 0
		while x % 2 == 0:
			cnt += 1
			x //= 2
		if cnt not in d:
			d[cnt] = 0
		d[cnt] += 1
		mark[i] = cnt
for (k, v) in d.items():
	if v > max_:
		max_ = v
		ind = k
remove = [a[i] for (i, x) in enumerate(mark) if x != ind]
print(len(remove))
print(' '.join([str(x) for x in remove]))