Pasha has two hamsters: Arthur and Alexander. Pasha put n apples in front of them. Pasha knows which apples Arthur likes. Similarly, Pasha knows which apples Alexander likes. Pasha doesn't want any conflict between the hamsters (as they may like the same apple), so he decided to distribute the apples between the hamsters on his own. He is going to give some apples to Arthur and some apples to Alexander. It doesn't matter how many apples each hamster gets but it is important that each hamster gets only the apples he likes. It is possible that somebody doesn't get any apples.

Help Pasha distribute all the apples between the hamsters. Note that Pasha wants to distribute all the apples, not just some of them.


-----Input-----

The first line contains integers n, a, b (1 ≤ n ≤ 100; 1 ≤ a, b ≤ n) — the number of apples Pasha has, the number of apples Arthur likes and the number of apples Alexander likes, correspondingly.

The next line contains a distinct integers — the numbers of the apples Arthur likes. The next line contains b distinct integers — the numbers of the apples Alexander likes.

Assume that the apples are numbered from 1 to n. The input is such that the answer exists.


-----Output-----

Print n characters, each of them equals either 1 or 2. If the i-h character equals 1, then the i-th apple should be given to Arthur, otherwise it should be given to Alexander. If there are multiple correct answers, you are allowed to print any of them.


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

Output
1 1 2 2

Input
5 5 2
3 4 1 2 5
2 3

Output
1 1 1 1 1

Source: codeforces | Difficulty: EASY
Tags: Implementation

Constructive algorithms


Solutions:
c = lambda : map(int, input().split())
(n, a, b) = c()
d = [2] * n
for i in c():
	d[i - 1] = 1
print(*d)


def homyaki(n, lst1, lst2):
	result = list()
	for i in range(1, n + 1):
		if i in lst1:
			result.append(1)
		else:
			result.append(2)
	return result
(N, a, b) = [int(j) for j in input().split()]
arthur = [int(x) for x in input().split()]
alex = [int(y) for y in input().split()]
print(*homyaki(N, arthur, alex))


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
(n, a, b) = q()
x = set(q())
y = set(q())
print(*[2 if i in y.difference(x) else 1 for i in range(1, n + 1)])


(n, a, b) = map(int, input().split())
la = list(map(int, input().split()))
lb = list(map(int, input().split()))
ans = []
for i in range(1, n + 1):
	if i in la:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
A = set(list(map(int, input().split())))
B = set(list(map(int, input().split())))
for i in range(1, n + 1):
	if i in A:
		print(1, end=' ')
	else:
		print(2, end=' ')


(x, y, z) = input().split()
x = int(x)
all_apples = [1] * x
l1 = list(map(int, input().rstrip().split(' ')))
l2 = list(map(int, input().rstrip().split(' ')))
for i in l2:
	if l2 not in l1:
		all_apples[i - 1] = 2
for i in all_apples:
	print(i, end=' ')


import sys
from collections import *
from math import *
import re

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
	c = 0
	for i in range(2, n):
		if prime[i]:
			c += 1
	return c

def iseven(n):
	return [False, True][0 if n % 2 else 1]

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

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

def lcm(a, b):
	return a * b / gcd(a, b)
max_int = sys.maxsize
mod = 10 ** 9 + 7
(n, a, b) = inp()
(arthur, alex) = (inp_arr(), inp_arr())
ans = [0] * n
for i in range(n):
	if i + 1 in arthur:
		ans[i] = 1
	else:
		ans[i] = 2
print(*ans)


(n, na, nx) = list(map(int, input().strip().split()))
l = list(map(int, input().strip().split()))
t = list(map(int, input().strip().split()))
for j in range(1, n + 1):
	if j in l:
		print('1', end=' ')
	elif j in t:
		print('2', end=' ')
print()


(n, a, b) = map(int, input().split())
la = [int(x) for x in input().split()]
lb = [int(y) for y in input().split()]
total = []
for i in range(1, n + 1):
	if i in la:
		total.append(1)
	else:
		total.append(2)
print(*total)


(n, a, b) = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]
K = []
for i in range(n):
	K.append(0)
for i in S:
	K[i - 1] = 1
for i in P:
	K[i - 1] = 2
for i in K:
	print(i, end=' ')


n = input().split()
arthur = input().split()
alexander = input().split()
a = []
for i in range(int(n[0])):
	a += [2]
for j in range(len(arthur)):
	a[int(arthur[j]) - 1] = 1
for k in a:
	print(k, end=' ')


(n, a, b) = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
used = [0] * n
for i in range(a):
	used[A[i] - 1] = 1
for i in range(b):
	if used[B[i] - 1] == 0:
		used[B[i] - 1] = 2
print(*used)


(n, a, b) = list(map(int, input().split()))
lar = list(map(int, input().split()))
lax = list(map(int, input().split()))
lar.sort()
lax.sort()
for i in range(1, n + 1):
	if i in lar:
		print('1', end=' ')
	else:
		print('2', end=' ')


(n, a, b) = [int(q) for q in input().split()]
a = set([int(q) for q in input().split()])
b = set([int(q) for q in input().split()])
for i in range(1, n + 1):
	if i in a:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in a1:
		print(1, end=' ')
	elif i in b1:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
art = [int(i) for i in input().split()]
ale = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if art.count(i) == 1:
		print(1, end=' ')
	else:
		print(2, end=' ')


def main():
	[n, a, b] = [int(_) for _ in input().split()]
	arthur = [int(_) for _ in input().split()]
	alex = [int(_) for _ in input().split()]
	apples = ['2'] * (n + 1)
	for apple in arthur:
		apples[apple] = '1'
	print(' '.join(apples[1:]))
main()


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	(n, a, b) = read_ints()
	A = read_ints()
	B = read_ints()
	C = [0 for _ in range(n)]
	for a in A:
		C[a - 1] = 1
	for b in B:
		if C[b - 1] == 0:
			C[b - 1] = 2
	print_nums(C)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
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')

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

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

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

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

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


(n, a, b) = map(lambda x: int(x), input().split(' '))
aa = list(map(lambda x: int(x), input().split(' ')))
bb = list(map(lambda x: int(x), input().split(' ')))
res = [0] * n
for i in aa:
	res[i - 1] = '1'
for i in bb:
	res[i - 1] = '2'
print(str.join(' ', res))


(n, a, b) = map(int, input().split())
x = set(map(int, input().split()))
y = set(map(int, input().split()))
y -= x
s = ''
for i in range(1, n + 1, 1):
	if i in x:
		s += str(1) + ' '
	else:
		s += str(2) + ' '
print(s)


(n, a, b) = map(int, input().split())
ar = list(map(int, input().split()))
ait = list(map(int, input().split()))
p = []
q = []
for k in range(1, n + 1):
	if k in ar:
		p.append(1)
	elif k not in ar:
		if k in ait:
			p.append(2)
print(*p)


(n, a, b) = map(int, input().split())
applesa = list(map(int, input().split()))
applesb = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in applesa:
		print(1, end=' ')
	else:
		print(2, end=' ')


(a, b, c) = map(int, input().split())
m = list(map(int, input().split()))
n = list(map(int, input().split()))
m.sort()
z = []
for i in range(1, a + 1):
	if i in m:
		z.append('1')
	else:
		z.append('2')
print(' '.join(z))


(n, a, b) = [int(x) for x in input().split()]
sa = list(map(int, input().split()))
sb = list(map(int, input().split()))
for i in range(n):
	if i + 1 in sa:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
if b <= a:
	l = [1] * n
	for i in l2:
		l[i - 1] = 2
else:
	l = [2] * n
	for i in l1:
		l[i - 1] = 1
print(*l, sep=' ')


(n, a, b) = map(int, input().split())
if 2 * a > n:
	t = ['1'] * n
	input()
	for i in map(int, input().split()):
		t[i - 1] = '2'
else:
	t = ['2'] * n
	for i in map(int, input().split()):
		t[i - 1] = '1'
print(' '.join(t))


read = lambda : map(int, input().split())
(n, a, b) = read()
p1 = list(read())
p2 = list(read())
ans = [0] * n
for x in p1:
	ans[x - 1] = 1
for x in p2:
	if ans[x - 1] == 0:
		ans[x - 1] = 2
print(' '.join(map(str, ans)))


(n, a, b) = map(int, input().split())
apples = list(range(1, n + 1))
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
for i in al:
	for j in range(n):
		if i == apples[j]:
			apples[j] = 0
			break
for i in range(n):
	if not apples[i]:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
arthur = set(map(int, input().split()))
alex = set(map(int, input().split()))
apples = {i for i in range(1, n + 1)}
ans = []
for item in apples:
	if item in arthur:
		ans.append(1)
	elif item in alex:
		ans.append(2)
for a in ans:
	print(a, end=' ')


(n, a, b) = [int(x) for x in input().split(' ')]
ax = [int(x) for x in input().split(' ')]
bx = [int(x) for x in input().split(' ')]
res = [0] * n
for i in range(a):
	res[ax[i] - 1] = 1
	if ax[i] in bx:
		bx.remove(ax[i])
for i in range(len(bx)):
	res[bx[i] - 1] = 2
for x in res:
	print(x, end=' ')


R = lambda : map(int, input().split())
(n, a, b) = R()
T = lambda : list(map(int, input().split()))
A = T()
B = T()
ans = [-1 for i in range(n + 1)]
for i in range(a):
	ans[A[i]] = 1
for i in range(1, n + 1):
	if ans[i] == -1:
		ans[i] = 2
for i in range(1, n + 1):
	print(ans[i], end=' ')


(n, a, b) = map(int, input().split())
a_likes = list(map(int, input().split()))
b_likes = list(map(int, input().split()))
end = ' '
for apple in range(1, n + 1):
	end = '' if apple == n else ' '
	if apple in a_likes:
		print(1, end=end)
	elif apple in b_likes:
		print(2, end=end)


(n, a, b) = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = []
x = 0
y = 0
for i in range(1, n + 1):
	if i in A and i in B:
		if x >= y:
			C.append(1)
			x += 1
		else:
			C.append(2)
			y += 1
		continue
	elif i in A:
		C.append(1)
		x += 1
		continue
	elif i in B:
		C.append(2)
		y += 1
		continue
print(*C, sep=' ')


(n, a, b) = map(int, input().split())
s = [int(i) for i in input().split()]
d = [int(i) for i in input().split()]
c = []
for i in range(1, n + 1):
	if i in s:
		c.append(1)
	elif i in d and i not in s:
		c.append(2)
print(*c)


(t, a, b) = map(int, input().split())
m = list(map(int, input().split()))
n = list(map(int, input().split()))
for x in range(1, t + 1):
	if x in m:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
c = list(map(int, input().split()))
d = list(map(int, input().split()))
e = []
f = ''
for x in range(1, n + 1):
	e.append(x)
for x in e:
	if x in c:
		f += '1 '
	else:
		f += '2 '
print(f)


(n, a, b) = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
l = []
for i in range(1, n + 1):
	if i in x:
		l.append(1)
	elif i in y:
		l.append(2)
print(*l)


(n, a, b) = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
for i in range(1, n + 1):
	if i in a:
		print(1, end=' ')
	else:
		print(2, end=' ')


string = input().split(' ')
n = int(string[0])
a = int(string[1])
b = int(string[2])
arthur = input().split(' ')
alex = input().split(' ')
string = ''
for i in range(1, n + 1):
	if str(i) in arthur:
		string += '1 '
	else:
		string += '2 '
print(string[:-1])


(n, a, b) = map(int, input().split())
A = list((int(x) for x in input().split()))
B = list((int(x) for x in input().split()))
(x, y) = (0, 0)
for i in range(1, n + 1):
	if i in A:
		print('1', end=' ')
	elif i in B:
		print('2', end=' ')


(n, a, b) = map(int, input().split())
l = list(map(int, input().split()))
l2 = list(map(int, input().split()))
k = []
for i in range(1, n + 1):
	if i in l and i not in l2:
		k.append(1)
	elif i in l2 and i not in l:
		k.append(2)
	else:
		k.append(1)
print(*k)


import sys
l = sys.stdin.readline().split()
n = int(l[0])
a = int(l[1])
b = int(l[2])
answer = ''
arthur = sorted(list(map(int, sys.stdin.readline().split())))
alexander = sorted(list(map(int, sys.stdin.readline().split())))
vector = [2 for i in range(n)]
for i in range(n):
	if i + 1 in arthur:
		vector[i] = 1
for e in vector:
	answer = answer + str(e) + ' '
print(answer)


(n, x, z) = [int(x) for x in input().split()]
ar = [int(x) for x in input().split()]
al = [int(x) for x in input().split()]
for i in range(1, n + 1):
	if i in ar:
		print(1, end=' ')
	else:
		print(2, end=' ')


naual = list(input().strip().split())
n = int(naual[0])
au = naual[1]
al = naual[2]
auther = list(map(int, input().strip().split()))
alex = list(map(int, input().strip().split()))
for i in range(1, n + 1):
	if au >= al:
		if i in auther:
			print('1', end=' ')
		elif i in alex:
			print('2', end=' ')
	elif al >= au:
		if i in alex:
			print('2', end=' ')
		elif i in auther:
			print('1', end=' ')


(n, a, b) = map(int, input().split())
a_likes = set(map(int, input().strip().split()))
b_likes = set(map(int, input().strip().split()))
common = []
if a_likes & b_likes:
	common = list(a_likes & b_likes)
for i in range(1, n + 1):
	if i in list(a_likes) or i in common:
		print('1', end=' ')
	else:
		print('2', end=' ')


def main():

	def inp():
		return list(map(int, input().split()))
	pasha_n = inp()[0]
	arthur_likes = inp()
	alexander_likes = inp()
	ans = []
	for i in range(1, pasha_n + 1):
		if i in arthur_likes:
			ans.append(1)
		else:
			ans.append(2)
	print(*ans)
main()


(a, b, c) = map(int, input().split())
j = list(map(int, input().split()))
k = list(map(int, input().split()))
p = []
if min(b, c) == b:
	for x in range(b):
		if j[x] in k:
			p.append(j[x])
			k.remove(j[x])
		else:
			p.append(j[x])
else:
	for x in range(c):
		if k[x] in j:
			p.append(k[x])
			j.remove(k[x])
		else:
			p.append(k[x])
for x in range(a):
	if min(b, c) == b:
		if x + 1 in p:
			print(1, end=' ')
		else:
			print(2, end=' ')
	elif x + 1 in p:
		print(2, end=' ')
	else:
		print(1, end=' ')


(N, A, B) = [int(num) for num in input().split()]
aa = [int(num) for num in input().split()]
bb = [int(num) for num in input().split()]
ans = [0 for n in range(N)]
for a in aa:
	ans[a - 1] = 1
for b in bb:
	ans[b - 1] = 2
print(' '.join([str(n) for n in ans]))


import math, itertools, fractions, heapq, collections, bisect, sys, 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 I():
	return int(sys.stdin.readline())

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

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

def S():
	return input()

def main():
	(n, a, b) = LI()
	la = LI()
	lb = LI()
	ans = [2] * n
	for x in la:
		ans[x - 1] = 1
	return ' '.join((str(x) for x in ans))
print(main())


from math import *
from collections import deque
from copy import deepcopy
import sys

def inp():
	return sys.stdin.readline().rstrip('\r\n')

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

def lis():
	return list(map(int, inp().split()))

def out(var):
	sys.stdout.write(str(var))

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

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, a, b) = multi()
ar = lis()
br = lis()
ans = []
for i in range(n):
	if i + 1 in ar:
		ans.append(1)
	elif i + 1 in br:
		ans.append(2)
printlist(ans)


(n, a, b) = list(map(int, input().split(' ')))
a = list(map(int, input().strip().split(' ')))[:n]
b = list(map(int, input().strip().split(' ')))[:n]
c = []
for i in range(1, n + 1):
	if i in a:
		c.append(1)
	elif i in b:
		c.append(2)
for j in c:
	print(j, end=' ')


(n, a, b) = map(int, input().split())
ar = list(map(int, input().split()))
al = list(map(int, input().split()))
l = [0] * n
for i in range(1, n + 1):
	if i in ar:
		l[i - 1] = 1
	else:
		l[i - 1] = 2
print(*l, sep=' ')


(n, a, b) = map(int, input().split())
ar = list(map(int, input().split()))
al = list(map(int, input().split()))
all = ar + al
all = list(set(all))
for x in range(0, len(ar)):
	all.remove(ar[x])
f = []
for x in range(0, n):
	if x + 1 in all:
		f.append(2)
	else:
		f.append(1)
print(' '.join([str(elem) for elem in f]))


(n, a, b) = map(int, input().split())
c = [int(i) for i in input().split()]
d = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if i in c:
		print(1, end=' ')
	elif i in d:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
arr1 = list(map(int, input().split()))
arr2 = list(map(int, input().split()))
ans = [2] * n
for i in range(a):
	ans[arr1[i] - 1] = 1
print(*ans)


(n, a, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l = [i for i in range(1, n + 1)]
for i in range(len(l1)):
	l[l1[i] - 1] = 'k'
for i in l:
	if i == 'k':
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split(' '))
aa = list(map(int, input().split(' ')))
bb = list(map(int, input().split(' ')))
for i in range(n):
	if i + 1 in aa:
		print(1, end=' ')
	else:
		print(2, end=' ')


l = [int(i) for i in input().split()]
n = l[0]
a = l[1]
b = l[2]
l1 = [int(i) for i in input().split()]
l2 = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if i in l1:
		print('1', end=' ')
	else:
		print('2', end=' ')


import sys

def solution(n_in, a, b, likes_a, likes_b):
	sorted_a = sorted(likes_a)
	sorted_b = sorted(likes_b)
	answer = []
	for i in range(n_in):
		if i + 1 in sorted_a:
			answer.append('1')
		else:
			answer.append('2')
	return ' '.join(answer)
n = sys.stdin.readline()
while n:
	(n_in, a, b) = n.split()
	likes_a = [int(a) for a in sys.stdin.readline().split()]
	likes_b = [int(a) for a in sys.stdin.readline().split()]
	print(solution(int(n_in), a, b, likes_a, likes_b))
	n = sys.stdin.readline()


(n, a, b) = input().split()
n = int(n)
a = int(a)
b = int(b)
a1 = input().split()
a2 = input().split()
a1 = [int(item) for item in a1]
a2 = [int(item) for item in a2]
for i in range(n):
	if i + 1 in a1:
		print(1, end=' ')
	else:
		print(2, end=' ')


n = list(map(int, input().split()))
n1 = list(map(int, input().split()))
n2 = list(map(int, input().split()))
lst = []
s = ''
for i in range(1, n[0] + 1):
	lst.append(i)
for j in range(n[0]):
	if lst[0] in n1:
		lst.remove(lst[0])
		s = s + '1' + ' '
	elif lst[0] in n2:
		lst.remove(lst[0])
		s = s + '2' + ' '
print(s)


(n, a, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in l1:
		print(1, '', end='')
	elif i in l2:
		print(2, '', end='')


(n, a, b) = map(int, input().split())
ar = list(map(int, input().split()))
br = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in ar:
		print(1, end=' ')
	elif i not in ar:
		print(2, end=' ')


N = list(map(int, input().split()))
L1 = list(map(int, input().split()))
L2 = list(map(int, input().split()))
for _ in range(N[0]):
	print(1 if _ + 1 in L1 else 2, end=' ')


(n, a, b) = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
nl = []
for i in range(1, n + 1):
	nl.append(i)
blm = []
for i in nl:
	if i not in al:
		blm.append(i)
for i in range(1, n + 1):
	if i in al:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = tuple(map(int, str.split(input())))
a_s = set(map(int, str.split(input())))
b_s = set(map(int, str.split(input())))

def yoba(n, a_s, b_s):
	for i in range(1, n + 1):
		yield (1 if i in a_s else 2)
print(str.join(' ', list(map(str, yoba(n, a_s, b_s)))))


import sys
(n, a, b) = sys.stdin.readline().split()
n = int(n)
a = int(a)
b = int(b)
lista = [int(i) for i in sys.stdin.readline().split()]
listb = [int(i) for i in sys.stdin.readline().split()]
applesa = set()
applesb = set()
for i in lista:
	applesa.add(i)
for j in listb:
	applesb.add(j)
output = []
for i in range(n):
	if i + 1 in applesa:
		output.append('1')
	else:
		output.append('2')
print(' '.join(output))


(n, a, b) = map(int, input().split())
abc = set()
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = n * [0]
for i in range(len(A)):
	ans[A[i] - 1] = 1
for j in range(n):
	if ans[j] == 0:
		ans[j] = 2
print(*ans)


ar = input().split(' ')
n = int(ar[0])
a = int(ar[1])
b = int(ar[2])
a1 = input().split(' ')
aa = []
for i in range(len(a1)):
	aa.append(int(a1[i]))
a2 = input().split(' ')
ab = []
for i in range(len(a2)):
	ab.append(int(a2[i]))
for i in range(n):
	if aa.count(i + 1) > 0:
		print('1')
		continue
	if ab.count(i + 1) > 0:
		print('2')
		continue


def main():
	(n, a, b) = [int(v) for v in input().split()]
	vals1 = [int(v) for v in input().split()]
	vals2 = [int(v) for v in input().split()]
	data = []
	for i in range(1, n + 1):
		if i in vals1:
			data.append('1')
		else:
			data.append('2')
	print(' '.join(data))
main()


(n, a, b) = list(map(int, input().split()))
h = list(map(int, input().split()))
x = list(map(int, input().split()))
c = ['0'] * (n + 1)
for i in h:
	if i not in c:
		c[i] = '1'
	else:
		c[i] = '2'
for i in x:
	if i not in c and c[i] == '0':
		c[i] = '2'
print(' '.join(c[1:]))


bot = True
(n, a, b) = map(int, input().split())
v = ['2'] * n
for x in input().split():
	v[int(x) - 1] = '1'
print(' '.join(v))


(n, a, b) = map(int, input().split())
ar = list(map(int, input().split()))
br = list(map(int, input().split()))
print(*[1 if i in ar else 2 for i in range(1, n + 1)])


(n, a, b) = [int(x) for x in input().split()]
arthur = [int(x) for x in input().split()]
alexander = [int(x) for x in input().split()]
apples = ''
for i in range(n):
	if i + 1 in arthur:
		apples += '1 '
	else:
		apples += '2 '
print(apples)


def solve(n, a, b):
	c = [0 for _ in range(n + 1)]
	for i in a:
		c[i] = 1
	for i in b:
		c[i] = 2
	return ' '.join(map(str, c[1:]))

def main():
	(n, x, y) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	print(solve(n, a, b))
main()


(n, a, b) = map(int, input().split())
arr = list(map(int, input().split(' ')[:a]))
ans = [False for i in range(n + 1)]
for i in range(a):
	temp = arr[i]
	ans[temp] = 1
for i in range(1, n + 1):
	if ans[i] == 1:
		print(1, end=' ')
	else:
		print(2, end=' ')


import sys
import os
t = sys.stdin.readline()
vals = t.split()
(n_apples, arthur_like, alexander_like) = (vals[0], vals[1], vals[2])
all_apples_dict = {i: 2 for i in range(1, int(n_apples) + 1)}
t = sys.stdin.readline()
vals = t.split()
arthur_apples = set()
for val in vals:
	arthur_apples.add(int(val))
for key in list(arthur_apples):
	all_apples_dict[key] = 1
print(*list(all_apples_dict.values()))


R = lambda : list(map(int, input().split()))
G = lambda : map(int, input().split())
(n, a, b) = G()
A = R()
B = R()
result = [-1 for i in range(n + 1)]
for i in range(a):
	result[A[i]] = 1
for i in range(1, n + 1):
	if result[i] == -1:
		result[i] = 2
for i in range(1, n + 1):
	print(result[i], end=' ')


R = lambda : map(int, input().split())
(n, a, b) = R()
c = [0] * n
for i in list(R()):
	c[i - 1] = 1
for i in list(R()):
	c[i - 1] = 2
print(' '.join(map(str, c)))


(n, a, b) = map(int, input().split())
Ar = [*map(int, input().split())]
Al = [*map(int, input().split())]
Ar.sort()
Al.sort()
(r, l) = (0, 0)
O = []
for i in range(1, n + 1):
	if r < len(Ar) and Ar[r] == i:
		O.append(1)
	elif l < len(Al) and Al[l] == i:
		O.append(2)
	while r < len(Ar) and Ar[r] <= i:
		r += 1
	while l < len(Al) and Al[l] <= i:
		l += 1
print(' '.join(map(str, O)))


(n, x, y) = map(int, input().split())
first = list(map(int, input().split()))
second = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in first:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = list(map(int, input().split()))
aa = list(map(int, input().split()))
ab = list(map(int, input().split()))
ans = [0] * n
for a in aa:
	ans[a - 1] = '1'
for a in ab:
	ans[a - 1] = '2'
print(' '.join(ans))


(n, a, b) = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
result = [0] * (n + 1)
for i in x:
	result[i] = 1
for j in y:
	if result[j] != 1:
		result[j] = 2
print(*result[1:])


import sys
import math
import os
from collections import Counter
l = []
(n, ar, al) = sys.stdin.readline().split()
n = int(n)
ar = int(ar)
al = int(al)
ar_app = sys.stdin.readline().split()
al_app = sys.stdin.readline().split()
dict_y = []
if ar == n:
	dict_y = [1] * n
elif al == n:
	dict_y = [2] * n
else:
	for i in range(n):
		if str(i + 1) in ar_app:
			dict_y.append(1)
		else:
			dict_y.append(2)
print(*dict_y)


class CodeforcesTask421ASolution:

	def __init__(self):
		self.result = ''
		self.n_a_b = []
		self.a = []
		self.b = []

	def read_input(self):
		self.n_a_b = [int(x) for x in input().split(' ')]
		self.a = [int(x) for x in input().split(' ')]
		self.b = [int(x) for x in input().split(' ')]

	def process_task(self):
		resulting = [1 if x + 1 in self.a else 2 for x in range(self.n_a_b[0])]
		self.result = ' '.join([str(x) for x in resulting])

	def get_result(self):
		return self.result
Solution = CodeforcesTask421ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(n, a, b) = list(map(int, input().split()))
answer = []
arthur = set(map(int, input().split()))
alex = set(map(int, input().split()))
for i in range(1, n + 1):
	if i in arthur:
		answer.append('1')
	else:
		answer.append('2')
print(' '.join(answer))


(n, a, b) = list(map(int, input().split()))
v = ['2'] * n
for x in input().split():
	v[int(x) - 1] = '1'
print(' '.join(v))


a = list(map(int, input().split()))[0]
b = list(map(int, input().split()))
c = list(map(int, input().split()))
for i in range(1, a + 1):
	if i in b:
		print(1, end=' ')
	else:
		print(2, end=' ')


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

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

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

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

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	(n, a, b) = mp()
	l = li()
	k = li()
	x = [1] * n
	for i in k:
		x[i - 1] = 2
	print(*x)
for _ in range(1):
	solve()


(n, a, b) = [int(x) for x in input().split()]
arthur = [int(x) for x in input().split()]
alex = [int(x) for x in input().split()]
res = []
for x in range(n):
	res.append(1)
for x in arthur:
	res[x - 1] = 1
for x in alex:
	res[x - 1] = 2
print(*res)


import sys
(n, a, b) = [int(x) for x in sys.stdin.readline().split()]
arthur = {int(x): 'notnone' for x in sys.stdin.readline().split()}
alex = {int(x): 'notnone' for x in sys.stdin.readline().split()}
ans = []
for i in range(1, n + 1):
	try:
		_ = arthur[i]
		ans.append(1)
	except:
		ans.append(2)
print(' '.join([str(i) for i in ans]))


(n, a, b) = [int(i) for i in input().split()]
lst1 = [int(i) for i in input().split()]
lst2 = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if i in lst1:
		print(1, end=' ')
	elif i in lst2:
		print(2, end=' ')


(n, a, b) = [int(i) for i in input().split()]
z = []
for i in range(n):
	z.append(0)
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
for i in x:
	z[i - 1] = 1
for i in y:
	z[i - 1] = 2
for i in z:
	print(i, end=' ')


(n, a, b) = map(int, input().split())
l = list(map(int, input().split()))
l1 = list(map(int, input().split()))
l2 = [0] * n
l3 = []
for i in l:
	l2[i - 1] = 1
	l3.append(i)
for i in l1:
	if i not in l3:
		l2[i - 1] = 2
for i in l2:
	print(i, end=' ')


(n, a, b) = map(int, input().split())
arther = list(map(int, input().split()))
alexander = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in arther:
		print('1', end=' ')
	elif i in alexander:
		print('2', end=' ')


(n, a, b) = list(map(int, input().split()))
a_list = input().split()
b_list = input().split()
ans = ['-1'] * n
for i in range(n):
	if a_list.count(str(i + 1)):
		ans[i] = '1'
	else:
		ans[i] = '2'
print(' '.join(ans))


param = list(map(int, input().split()))
arthur = list(map(int, input().split()))
alexander = list(map(int, input().split()))
answer = ''
for i in range(param[0]):
	if i + 1 in arthur:
		answer += '1'
	elif i + 1 in alexander:
		answer += '2'
	if i + 1 != param[0]:
		answer += ' '
print(answer)


a = input().split()
n = int(a[0])
b = [2] * n
a = input().split()
for i in a:
	b[int(i) - 1] = 1
for i in range(n):
	print(b[i], end=' ')


(n, a, b) = map(int, input().split())
arthur = list(map(int, input().split()))
alex = list(map(int, input().split()))
x = [0] * (n + 1)
for i in arthur:
	x[i] = 1
for i in alex:
	x[i] = 2
for i in range(1, n + 1):
	print(x[i], end=' ')


x = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = range(1, x[0] + 1)
v = []
for i in c:
	if i in a:
		print('1 ', end='')
	elif i in b:
		print('2 ', end='')


(n, a, b) = map(int, input().split())
h1 = set(map(int, input().split()))
ans = (1 if x + 1 in h1 else 2 for x in range(n))
print(*ans)


(n, a, b) = list(map(int, input().split()))
l = [0] * n
for i in input().split():
	l[int(i) - 1] = '1'
for i in input().split():
	l[int(i) - 1] = '2'
print(' '.join(l))


(n, a, b) = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in al:
		print(1, '', end='')
	elif i in bl:
		print(2, '', end='')


(n, a, b) = map(int, input().split())
x = [int(x) for x in input().split()]
y = [int(y) for y in input().split()]
l = [0] * n
for i in x:
	l[i - 1] = 1
for j in y:
	if j not in x:
		l[j - 1] = 2
for i in l:
	print(i, end=' ')


n = int(input().split()[0])
A = [int(s) - 1 for s in input().split()]
for i in range(n):
	print('1' if i in A else '2', end=' ' if i != n - 1 else '')
print('\n')


import math
import time
import random
start = time.time()
(n, a, b) = list(map(int, input().split()))
a_int = list(map(int, input().split()))
b_int = list(map(int, input().split()))
sample1 = list(range(1, n + 1))
ans = []
for i in range(0, len(sample1)):
	if sample1[i] in a_int:
		ans.append(1)
	else:
		ans.append(2)
print(*ans)
end = time.time()


(n, a, b) = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
xx = [0] * (n + 1)
for i in x:
	xx[i] = 1
for i in y:
	xx[i] = 2
for i in range(1, n + 1):
	print(xx[i], end=' ')


def main():
	t = input().split()
	(n, a, b) = (int(t[0]), int(t[1]), int(t[2]))
	s = [0 for i in range(n)]
	l = input().split()
	for ele in l:
		s[int(ele) - 1] = 1
	l = input().split()
	for ele in l:
		if s[int(ele) - 1] != 1:
			s[int(ele) - 1] = 2
	print(' '.join(map(str, s)))
main()


(a, b, c) = map(int, input().split())
l = list(map(int, input().split()))
li = list(map(int, input().split()))
for i in range(1, a + 1):
	if i in l:
		print(1, end=' ')
	elif i in li:
		print(2, end=' ')


import sys
n = sys.stdin.readline()
while n:
	arthur = [int(s) for s in sys.stdin.readline().split()]
	alexander = [int(s) for s in sys.stdin.readline().split()]
	res = []
	for i in range(1, int(n.split()[0]) + 1):
		if i in arthur:
			res.append('1')
		else:
			res.append('2')
	print(' '.join(res))
	n = sys.stdin.readline()


(n, a, b) = map(int, input().split())
ai = list(map(int, input().split()))
bi = list(map(int, input().split()))
ai.sort()
i = 1
j = 0
while i <= n and j < a:
	if i == ai[j]:
		print(1, end=' ')
		i = i + 1
		j = j + 1
	else:
		print(2, end=' ')
		i = i + 1
for j in range(i, n + 1):
	print(2, end=' ')


(N, a, b) = map(int, input().split())
L1 = list(map(int, input().split()))
L2 = list(map(int, input().split()))
for i in range(1, N + 1):
	FLAG = 0
	for j in L1:
		if j == i:
			print(1, end=' ')
			FLAG = 1
			break
	for k in L2:
		if k == i and FLAG != 1:
			print(2, end=' ')
			break


(apple, a, b) = map(int, input().split())
arthur = [int(i) for i in input().split()]
alexender = [int(i) for i in input().split()]
distributed = []
ans = []
for i in range(1, apple + 1):
	if i not in distributed:
		if i in arthur:
			distributed.append(i)
			ans.append(1)
		elif i in alexender:
			distributed.append(i)
			ans.append(2)
for i in ans:
	print(i, end=' ')


(n, a, b) = map(int, input().split())
owners = [0] * n
for v in map(int, input().split()):
	owners[v - 1] = '1'
for v in map(int, input().split()):
	owners[v - 1] = '2'
print(' '.join(owners))


def solution(l1, l2, n):
	i = 1
	c_out = ''
	while i <= n:
		if i in l1:
			c_out += '1'
		else:
			c_out += '2'
		if i != n:
			c_out += ' '
		i += 1
	return c_out

def answer():
	a = [int(x) for x in input().split()]
	n = a[0]
	l1 = [int(x) for x in input().split()]
	l2 = [int(x) for x in input().split()]
	print(solution(l1, l2, n))
answer()


(n, a, b) = [int(x) for x in input().split()]
ar = [int(x) for x in input().split()]
al = [int(x) for x in input().split()]
an = [2] * n
for i in range(a):
	an[ar[i] - 1] = 1
for i in an:
	print(i)


(n, a, b) = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
d = [int(i) for i in input().split()]
l = ['*'] * n
for i in range(0, len(c)):
	l[c[i] - 1] = 1
for i in range(0, len(d)):
	if l[d[i] - 1] == '*':
		l[d[i] - 1] = 2
print(*l)


(n, m, k) = map(int, input().split())
mat = set(input().split())
sat = input()
ans = list(range(1, n + 1))
ans = list(map(lambda x: 1 if str(x) in mat else 2, ans))
print(*ans)


(n, a, b) = map(int, input().split())
s = list(map(int, input().split()))
t = list(map(int, input().split()))
d = {}
for i in s:
	d[i] = 1
for i in range(1, n + 1):
	if i in d:
		print(1, end=' ')
	else:
		print(2, end=' ')


import sys

def main():
	inp = sys.stdin.read().strip().split('\n')
	d = dict()
	for i in range(1, 3):
		for j in map(int, inp[i].split()):
			d[j] = i
	return list(map(d.get, sorted(d)))
print(*main())


(n, a, b) = map(int, input().split())
arr = [2] * n
arthur = list(map(int, input().split()))
for e in arthur:
	arr[e - 1] = 1
list(map(int, input().split()))
print(*arr)


inp = input().split()
N = int(inp[0])
A = int(inp[1])
B = int(inp[2])
ans = [2 for i in range(N)]
x = input().split()
for i in x:
	ans[int(i) - 1] = 1
for i in ans:
	print(i)


(n, a, b) = [int(x) for x in str(input()).split(' ') if 1]
Apple_a = [int(x) for x in str(input()).split(' ') if 1]
Apple_b = [int(x) for x in str(input()).split(' ') if 1]
output = {}
i = 1
for i in range(1, n + 1):
	if i in Apple_a:
		output[i] = 1
	elif i in Apple_b:
		output[i] = 2
for x in output.values():
	print(x, end=' ')


(n, m, k) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = []
for i in range(1, n + 1):
	if i in a:
		ans.append(1)
	else:
		ans.append(2)
print(*ans)


import re
import inspect
from sys import argv, exit

def rstr():
	return input()

def rstrs(splitchar=' '):
	return [i for i in input().split(splitchar)]

def rint():
	return int(input())

def rints(splitchar=' '):
	return [int(i) for i in rstrs(splitchar)]

def varnames(obj, namespace=globals()):
	return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
	prnt(varnames(var), var)

def prnt(*args, override=False):
	if '-v' in argv or override:
		print(*args)
pq = []

def penq(s):
	if not isinstance(s, str):
		s = str(s)
	pq.append(s)

def pdump():
	s = '\n'.join(pq).encode()
	os.write(1, s)
(n, a, b) = rints()
A = rints()
B = rints()
ans = []
for i in range(1, n + 1):
	if i in A:
		ans.append('1')
	elif i in B:
		ans.append('2')
	else:
		raise Exception('Hated apple exception {}'.format(i))
print(' '.join(ans))


(n, a, b) = map(int, input().split())
As = list(map(int, input().split()))
Bs = list(map(int, input().split()))
ans = []
for i in range(1, n + 1):
	if i in As:
		ans.append('1')
	elif i in Bs:
		ans.append('2')
print(' '.join(ans))


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import CodeType, new_class
(n, a, b) = map(int, input().split())
d = [0] * (n + 1)
for x in input().split():
	d[int(x)] = 1
for x in input().split():
	if not d[int(x)]:
		d[int(x)] = 2
print(*d[1:n + 1])


(n, x, y) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0] * n
for i in range(len(a)):
	c[a[i] - 1] = 1
for j in range(len(b)):
	c[b[j] - 1] = 2
for i in c:
	print(i, end=' ')


(a, b, c) = map(int, input().split())
data = list(map(int, input().split()))
datb = list(map(int, input().split()))
res = []
for i in range(1, a + 1):
	if i in data:
		res.append('1')
	else:
		res.append('2')
print(' '.join(res))


(n, a, b) = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
Arth = {}
Alex = {}
for i in range(0, len(A)):
	if A[i] not in Arth.keys():
		Arth[A[i]] = True
for i in range(0, len(B)):
	if B[i] not in Alex.keys():
		Alex[B[i]] = True
st = ''
for i in range(1, n + 1):
	if i in Arth.keys():
		st += '1 '
	else:
		st += '2 '
print(st)


(n, a, b) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
b = list(map(int, input().split()))
i = 0
for j in range(n):
	if i < len(a):
		if j + 1 == a[i]:
			print(1, end=' ')
			i += 1
		else:
			print(2, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))
l = []
for i in range(1, n + 1):
	if i in a1:
		l.append(1)
	else:
		l.append(2)
print(*l)


n = int(input().split()[0])
a = [1] * n
input()
for x in map(int, input().split()):
	a[x - 1] = 2
print(*a)


(n, a, b) = input().split()
arth = list(map(int, input().split()))
alex = list(map(str, input().split()))
ans = ['2'] * int(n)
for i in arth:
	ans[i - 1] = '1'
print(' '.join(ans))


a = input().split()
b = input().split()
c = input().split()
arthur = set()
ales = set()
for y in b:
	arthur.add(int(y))
for x in c:
	ales.add(int(x))
for x in range(int(a[0]) + 1):
	if x != 0:
		if x in arthur:
			print(1, end=' ')
		else:
			print(2, end=' ')


I = lambda : map(int, input().split())
(n, _, _) = I()
A = set(I())
I()
print(*(2 - (i in A) for i in range(1, n + 1)))


(n, a, b) = map(int, input().split())
k = 0
arthurlikes = list(map(int, input().split()))[:a]
alexenderlikes = list(map(int, input().split()))[:b]
for i in range(1, n + 1):
	if i in arthurlikes:
		print('1', end=' ')
	else:
		print('2', end=' ')


from sys import stdin
__author__ = 'artyom'

def read_next_line():
	return list(map(int, stdin.readline().strip().split()))
(n, a, b) = read_next_line()
(p, q) = (read_next_line(), read_next_line())
ans = []
for i in range(1, n + 1):
	ans.append(1 if i in p else 2)
print(' '.join(map(str, ans)))


(n, a, b) = [int(i) for i in input().split(' ')]
apples_a = [int(i) for i in input().split(' ')]
apples_b = [int(i) for i in input().split(' ')]
out = []
for i in range(1, n + 1):
	if i in apples_a:
		out.append(1)
	elif i in apples_b:
		out.append(2)
print(*out)


def distribution(n, art, alex):
	ans = [0] * n
	for a in art:
		ans[a - 1] = 1
	for a in alex:
		if ans[a - 1] == 0:
			ans[a - 1] = 2
	return ans
(n, a, b) = map(int, input().split())
art = list(map(int, input().split()))
alex = list(map(int, input().split()))
print(*distribution(n, art, alex))


(n, a, b) = tuple(map(int, input().split()))
nr1 = list(map(int, input().split()))
nr2 = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in nr1:
		print('1', end=' ')
	else:
		print('2', end=' ')


(a, b, c) = map(int, input().split())
arr1 = sorted(map(int, input().split()))
arr2 = sorted(map(int, input().split()))
ans = []
for i in range(1, a + 1):
	if i in arr1:
		ans.append(1)
	else:
		ans.append(2)
print(*ans)


(a, b, c) = map(int, input().split())
d = list(map(int, input().split()))
e = list(map(int, input().split()))
x = int(1)
f = []
while x <= a:
	if x in d:
		f.append(1)
	else:
		f.append(2)
	x = x + 1
print(*f)


(n, a, b) = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
arr = [1] * (n + 1)
for i in B:
	if i not in A:
		arr[i] = 2
print(*arr[1:])


(n, a, b) = map(int, input().split())
al = list(map(int, input().split()))
axl = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in al:
		print('1', end=' ')
	else:
		print('2', end=' ')


(n, a, b) = map(int, input().split())
apples = [0] * n
for i in map(int, input().split()):
	apples[i - 1] = 1
for i in map(int, input().split()):
	apples[i - 1] = 2
print(*apples)


(a, b, c) = input().split()
(a, b, c) = (int(a), int(b), int(c))
v = input().split()
n = input().split()
d = {}
for i in range(b):
	if v[i] not in n:
		d[int(v[i])] = 1
for i in range(c):
	d[int(n[i])] = 2
for i in range(1, a + 1):
	print(d[i], end=' ')


(n, a, b) = map(int, input().split())
nums = [0] * n
aList = list(map(int, input().split()))
bList = list(map(int, input().split()))
for i in range(a):
	nums[aList[i] - 1] = 1
for i in range(b):
	if nums[bList[i] - 1] != 1:
		nums[bList[i] - 1] = 2
for i in range(n):
	print(nums[i], end=' ')
print()


(n, a, b) = map(int, input().split())
ali = list(map(int, input().split()))
bli = list(map(int, input().split()))
out = ''
for i in range(n):
	if i + 1 in ali:
		out += '1 '
	else:
		out += '2 '
print(out)


(n, m, o) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(1, n + 1):
	print(1 if i in a else 2, end=' ')


(n, a, b) = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
z = [2 for i in range(n)]
for j in x:
	z[j - 1] = 1
print(*z, sep=' ')


(n, a, b) = map(int, input().split())
ai = list(map(int, input().split()))
bi = list(map(int, input().split()))
ci = [0] * (n + 1)
for i in range(a):
	ci[ai[i]] = 1
for i in range(b):
	ci[bi[i]] = 2
for i in range(1, n + 1):
	print(ci[i], end=' ')


def ab():
	c = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a = list(map(int, input().split()))
	r = []
	t = 0
	g = 0
	for i in range(1, int(c[0]) + 1):
		if i in b:
			r.append(1)
		else:
			r.append(2)
	for j in r:
		print(j, end=' ')
	print()
ab()


(a, b, c) = map(int, input().split())
d = list(map(int, input().split()))
e = list(map(int, input().split()))
f = d + e
f = list(set(f))
for i in f:
	print('1 ' if i in d else '2 ', end='')


(n, a, b) = map(int, input().split())
x = set(map(int, input().split()))
y = set(map(int, input().split()))
x = x - y
o = []
for i in range(1, n + 1):
	if i in x:
		o.append('1')
	else:
		o.append('2')
print(' '.join(o))


(n, a, b) = map(int, input().split())
elegaba = ['2' for i in range(n)]
for x in input().split():
	elegaba[int(x) - 1] = '1'
print(' '.join(elegaba))


(n, a, b) = [int(s) for s in input().split(' ')]
p1 = [int(s) for s in input().split(' ')]
p2 = [int(s) for s in input().split(' ')]
c = []
for i in range(1, n + 1):
	c.append(2 - int(i in p1))
print(*c)


IL = lambda : list(map(int, input().split()))
(n, a, b) = IL()
A = IL()
B = IL()
print(*[1 if i + 1 in A else 2 for i in range(n)])


(n, a, b) = list(map(int, input().split()))
arthurs = list(map(int, input().split()))
alexanders = list(map(int, input().split()))
ans = []
for i in range(1, n + 1):
	if i in arthurs:
		ans.append('1')
	else:
		ans.append('2')
print(' '.join(ans))


(a, b, c) = map(int, input().split())
input()
tab = [1 for i in range(a)]
for i in map(int, input().split()):
	tab[i - 1] = 2
print(*tab)


(n, a, b) = map(int, input().split())
l = dict.fromkeys(list(map(int, input().split())))
l1 = dict.fromkeys(list(map(int, input().split())))
l2 = []
for i in range(1, n + 1):
	if i in l:
		l2.append(1)
	elif i in l1:
		l2.append(2)
print(*l2)


R = lambda : [int(x) for x in input().split()]
(n, a, b) = R()
x = [2] * n
for c in R():
	x[c - 1] = 1
print(*x)


import sys

def f(n_a_b, arthur, alex):
	n = n_a_b[0]
	a = n_a_b[1]
	b = n_a_b[2]
	sar = set(arthur)
	sal = set(alex)
	diff = sal - sar
	answer = [1] * n
	count_ar = 0
	check_ar = False
	for i in range(n):
		if i + 1 in diff or check_ar:
			answer[i] = 2
		if answer[i] == 1:
			count_ar += 1
			check_ar = count_ar == a
	return answer
for line in sys.stdin:
	n_a_b = [int(a) for a in line.split()]
	arthur = [int(a) for a in sys.stdin.readline().split()]
	alex = [int(a) for a in sys.stdin.readline().split()]
	answer = f(n_a_b, arthur, alex)
	answer = [str(a) for a in answer]
	print(' '.join(answer))


from sys import stdin
(n, a, b) = list(map(int, stdin.readline().split()))
apples1 = list(map(int, stdin.readline().split()))
apples2 = list(map(int, stdin.readline().split()))
for i in range(1, n + 1):
	if i in apples1:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, n1, n2) = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
l1 = list(map(int, input().split(' ')))
l2 = [0] * n
l2.append(0)
for i in l:
	l2[i] = 1
for i in range(1, n + 1):
	if l2[i] == 0:
		print('2', end=' ')
	else:
		print('1', end=' ')


(n, a, b) = map(int, input().split())
la = list(map(int, input().split()))
lb = list(map(int, input().split()))
s = sorted(list(set(la + lb)))
p = [0] * n
for i in range(n):
	if s[i] in la:
		p[i] = 1
	elif s[i] in lb:
		p[i] = 2
for i in p:
	print(i, end=' ')
print()


(n, a, b) = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))
i = 1
while i <= n:
	if i in a1:
		a1.remove(i)
		print('1', end=' ')
	else:
		b1.remove(i)
		print('2', end=' ')
	i += 1


(n, a, b) = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))
z = [i for i in range(1, n + 1)]
c = []
for i in range(len(z)):
	if z[i] in a1:
		c.append(1)
	elif z[i] in b1:
		c.append(2)
for i in range(len(c)):
	print(c[i], end=' ')


import math
(n, a, b) = input().split()
n = int(n)
a = int(a)
b = int(b)
ans = [1] * n
l1 = input().split()
l2 = input().split()
for i in range(b):
	ans[int(l2[i]) - 1] = 2
for i in ans:
	print(i, end=' ')


__author__ = 'Dilshod'
(n, a, b) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in a:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
Artur = a * 1
Alex = []
for i in range(len(b)):
	if a.count(b[i]) == 0:
		Alex.append(b[i])
for i in range(n):
	if Artur.count(i + 1) != 0:
		print(1, end=' ')
	else:
		print(2, end=' ')


__author__ = 'Lipen'

def main():
	(n, a, b) = map(int, input().split())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	s = ''
	for i in range(1, n + 1):
		if i in A:
			s += '1 '
		else:
			s += '2 '
	print(s[:-1])
main()


(n, a, b) = map(int, input().split())
q = {*map(int, input().split())} - {*map(int, input().split())}
ans = []
for i in range(1, n + 1):
	ans += [1] if i in q else [2]
print(*ans)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 10 ** 9 + 7

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

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

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

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 ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

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

def solve(case):
	(n, a, b) = sep()
	a = lis()
	b = lis()
	given = [0] * n
	for i in range(len(a)):
		given[a[i] - 1] = 1
	for i in range(len(b)):
		if given[b[i] - 1] == 0:
			given[b[i] - 1] = 2
	print(' '.join((str(given[i]) for i in range(n))))
testcase(1)


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')
from itertools import repeat
(n, a, b) = map(int, input().split())
ax = [*map(int, input().split())]
bx = [*map(int, input().split())]
ans = [*repeat(0, n)]
for i in ax:
	ans[i - 1] = 1
for i in bx:
	ans[i - 1] = 2
print(*ans)


import sys
import math
import bisect

def main():
	(n, na, nb) = map(int, input().split())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	ans = [1] * n
	for i in range(n):
		if i + 1 not in A:
			ans[i] = 2
	print(' '.join(list((str(a) for a in ans))))
main()


(a, b, c) = input().split()
Apples = [i for i in range(1, int(a) + 1)]
Arthur = list(map(int, input().split()))
Alexander = list(map(int, input().split()))
for i in Apples:
	if i in Arthur:
		print(1, end=' ')
		continue
	if i in Alexander:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
lia = list(map(int, input().split()))
lib = list(map(int, input().split()))
for i in lia:
	if i in lib:
		lib.remove(i)
for i in range(n):
	if i + 1 in lia:
		print(1, end=' ')
	else:
		print(2, end=' ')


def main_function():
	(n, a, b) = [int(i) for i in input().split(' ')]
	l_1 = [int(i) for i in input().split(' ')]
	l_2 = [int(i) for i in input().split(' ')]
	output_list = []
	for i in range(1, n + 1):
		found_in_first = False
		for j in range(len(l_1)):
			if i == l_1[j]:
				output_list.append('1')
				found_in_first = True
				break
		if not found_in_first:
			output_list.append('2')
	return ' '.join(output_list)
print(main_function())


(n, l1, l2) = input().split()
l1 = int(l1)
l2 = int(l2)
a = input().split()
b = input().split()
d1 = dict()
d2 = dict()
for i in range(len(a)):
	d1[i] = int(a[i])
for i in range(len(b)):
	d2[i] = int(b[i])
for i in range(1, int(n) + 1):
	if i in d1.values() and l1 > 0:
		print(1, end=' ')
		l1 -= 1
	elif i in d2.values() and l2:
		print(2, end=' ')
		l2 -= 1


(n, m, x) = list(map(int, input().split()))
m1 = list(map(int, input().split()))
x1 = list(map(int, input().split()))
l = []
for i in range(1, n + 1):
	if i in m1:
		l.append(1)
	elif i in x1:
		l.append(2)
print(*l)


import sys
(n, a, b) = sys.stdin.readline().split()
n = int(n)
a = int(a)
b = int(b)
arr_a = sys.stdin.readline().split()
arr_b = sys.stdin.readline().split()
arr_a = [int(x) for x in arr_a]
arr_b = [int(x) for x in arr_b]
res = []
for i in range(n):
	if i + 1 in arr_a:
		res.append(1)
	else:
		res.append(2)
print(' '.join([str(x) for x in res]))


(n, a, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l = [0 for i in range(n)]
for i in l1:
	if l[i - 1] == 0:
		l[i - 1] = 1
l2 = set(l2) - set(l1)
for i in l2:
	if l[i - 1] == 0:
		l[i - 1] = 2
l = [str(i) for i in l]
print(' '.join(l))


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


(n, a, b) = (int(x) for x in input().split())
arthur_apples = {int(x) for x in input().split()}
input()
if n == a:
	print(' '.join(('1' for i in range(n))))
else:
	ans = ['1' if i in arthur_apples else '2' for i in range(1, n + 1)]
	print(' '.join(ans))


(n, a, b) = map(int, input().split())
aa = list(map(int, input().split()))
ba = list(map(int, input().split()))
out = ''
for i in range(1, n + 1):
	if i in aa:
		out += '1 '
	elif i in ba:
		out += '2 '
print(out.strip())


import sys
a = sys.stdin.readline()
while a:
	(a, ar, al) = [int(val) for val in a.split()]
	res = []
	ar_app = [int(val) for val in sys.stdin.readline().split()]
	al_app = [int(val) for val in sys.stdin.readline().split()]
	for i in range(a):
		if i + 1 in ar_app:
			res.append('1')
		else:
			res.append('2')
	result = ' '.join(res)
	print(result)
	a = sys.stdin.readline()


(NApples, N1, N2) = map(int, input().split())
A1 = list(map(int, input().strip().split()))[:N1]
A2 = list(map(int, input().strip().split()))[:N2]
A1.sort()
A2.sort()
giveto = []
for i in range(1, NApples + 1):
	if i in A1:
		giveto.append(1)
	elif i in A2:
		giveto.append(2)
	else:
		giveto.append(0)
print(*giveto, sep=' ')


(a, b, c) = input().split()
li = list(map(int, input().split()))
test = list(map(int, input().split()))
ans = []
for i in range(1, int(a) + 1):
	if i in li:
		ans.append(1)
	else:
		ans.append(2)
for i in ans:
	print(i, end=' ')


(n, a, b) = map(int, input().split())
l = list(map(int, input().split()))
d = list(map(int, input().split()))
ll = []
for i in range(1, n + 1):
	if i in l:
		ll.append(1)
	else:
		ll.append(2)
print(*ll)


I = lambda : map(int, input().split())
(n, a, b) = I()
x = list(I())
y = list(I())
res = list()
for i in range(n):
	res.append(1 if i + 1 in x else 2)
print(*res)


(a, b, c) = input().split()
ar = input().split()
for i in range(1, int(a) + 1):
	if str(i) in ar:
		print(1, end=' ')
	else:
		print(2, end=' ')


(n, a, b) = map(int, input().split())
otv = [2] * 101
s1 = list(map(int, input().split()))
s2 = list(map(int, input().split()))
s1 = sorted(s1)
s2 = sorted(s2)
for i in range(a):
	otv[s1[i]] = 1
for i in range(1, n + 1):
	print(otv[i], end=' ')


(n, a, b) = map(int, input().split())
ar = []
ar = list(map(int, input().split()))
al = []
al = list(map(int, input().split()))
l = []
for i in range(1, n + 3):
	l.append(0)
for i in ar:
	l[i] = 1
for i in al:
	l[i] = 2
for i in range(1, len(l) - 1):
	print(l[i], end=' ')


(n, a, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
res = [0] * n
for i in range(1, n + 1):
	if i in l1:
		res[i - 1] = 1
	else:
		res[i - 1] = 2
print(*res)


N = input().split()[0]
a = []
for i in range(int(N)):
	a.append(0)
N = input().split()
for i in N:
	a[int(i) - 1] = '1'
N = input().split()
for i in N:
	a[int(i) - 1] = '2'
print(' '.join(a))


(n, a, b) = map(int, input().split())
ar = [int(x) for x in input().split()]
al = [int(y) for y in input().split()]
l = []
p = [0] * n
for i in range(1, n + 1):
	l.append(i)
for j in ar:
	c = l.index(j)
	p[c] = 1
for k in al:
	d = l.index(k)
	if p[d] != 1:
		p[d] = 2
print(*p)


inp = list(map(int, input().split()))
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
outp = []
for i in range(inp[0]):
	outp.append(1)
for j in range(inp[0]):
	flag = 0
	for i in al:
		if i == j + 1:
			flag = 1
			break
	if flag == 0:
		outp.pop(j)
		for k in bl:
			if k == j + 1:
				outp.insert(j, 2)
				break
print(*outp)


import sys
import math
(n, a, b) = [int(x) for x in sys.stdin.readline().split()]
ff = [''] * (n + 1)
for i in sys.stdin.readline().split():
	ff[int(i)] = '1'
for i in sys.stdin.readline().split():
	ff[int(i)] = '2'
print(' '.join(ff[1:]))


(n, _, _) = map(int, input().split())
a = map(int, input().split())
b = map(int, input().split())
r = [0] * n
for x in a:
	r[x - 1] = 1
for x in b:
	r[x - 1] = 2
print(*r, sep=' ')


(n, a, b) = [int(x) for x in input().split()]
l = [2] * n
for i in [int(x) - 1 for x in input().split()]:
	l[i] = 1
print(*l)


(n, a, b) = map(int, input().split())
aone = list(map(int, input().split()))
btwo = list(map(int, input().split()))
for i in range(1, n + 1):
	if i in aone:
		print('1', end=' ')
	else:
		print('2', end=' ')