Vasya has a multiset s consisting of n integer numbers. Vasya calls some number x nice if it appears in the multiset exactly once. For example, multiset \{1, 1, 2, 3, 3, 3, 4\} contains nice numbers 2 and 4.

Vasya wants to split multiset s into two multisets a and b (one of which may be empty) in such a way that the quantity of nice numbers in multiset a would be the same as the quantity of nice numbers in multiset b (the quantity of numbers to appear exactly once in multiset a and the quantity of numbers to appear exactly once in multiset b).

Input

The first line contains a single integer n~(2 ≤ n ≤ 100).

The second line contains n integers s_1, s_2, ... s_n~(1 ≤ s_i ≤ 100) — the multiset s.

Output

If there exists no split of s to satisfy the given requirements, then print "NO" in the first line.

Otherwise print "YES" in the first line.

The second line should contain a string, consisting of n characters. i-th character should be equal to 'A' if the i-th element of multiset s goes to multiset a and 'B' if if the i-th element of multiset s goes to multiset b. Elements are numbered from 1 to n in the order they are given in the input.

If there exist multiple solutions, then print any of them.

Examples

Input

4
3 5 7 1


Output

YES
BABA


Input

3
3 5 1


Output

NO

Difficulty: MEDIUM

Solutions:
num_numbers = int(input())
numbers = list(input().split())
appear_once = set()
appear_twice = set()
appear_multiple = set()
for number in numbers:
	if number not in appear_multiple:
		if number in appear_twice:
			appear_multiple.add(number)
			appear_twice.remove(number)
		elif number in appear_once:
			appear_twice.add(number)
			appear_once.remove(number)
		else:
			appear_once.add(number)
if len(appear_once) % 2 == 0 or len(appear_multiple) > 0:
	print('YES')
	nice_to_a = True
	solution = list()
	split_multiple = len(appear_once) % 2 == 1
	for number in numbers:
		if number in appear_once:
			if nice_to_a:
				solution.append('A')
			else:
				solution.append('B')
			nice_to_a = not nice_to_a
		elif split_multiple and number in appear_multiple:
			solution.append('B')
			split_multiple = False
		else:
			solution.append('A')
	print(''.join(solution))
else:
	print('NO')


n = int(input())
a = [int(i) for i in input().split()]
cnt = cnt3 = 0
B = False
kek = True
for i in a:
	if a.count(i) == 1:
		cnt += 1
	if a.count(i) >= 3:
		cnt3 += 1
if cnt % 2 == 0:
	print('YES')
	for i in a:
		if a.count(i) == 1:
			if B:
				print('B', end='')
			else:
				print('A', end='')
			B = not B
		else:
			print('A', end='')
elif cnt3 > 0:
	print('YES')
	for i in a:
		if a.count(i) == 1:
			if B:
				print('B', end='')
			else:
				print('A', end='')
			B = not B
		elif (a.count(i) >= 3) & kek:
			print('B', end='')
			kek = False
			continue
		else:
			print('A', end='')
else:
	print('NO')


n = int(input())
freq_dict = {}
a = list(map(int, input().split()))
for i in a:
	if i in freq_dict.keys():
		freq_dict[i] += 1
	else:
		freq_dict[i] = 1
freq_freq_dict = {1: 0, 2: 0, -1: 0}
for i in freq_dict.values():
	if i == 1:
		freq_freq_dict[1] += 1
	elif i == 2:
		freq_freq_dict[2] += 1
	else:
		freq_freq_dict[-1] += 1
if freq_freq_dict[1] != 0:
	if freq_freq_dict[1] % 2:
		if freq_freq_dict[-1] != 0:
			print('YES')
			flag = True
			other_letter = ''
			for i in a:
				if freq_dict[i] == 1:
					if flag:
						print('A', end='')
					else:
						print('B', end='')
					flag = not flag
				elif freq_dict[i] != 1 and freq_dict[i] != 2:
					if other_letter == '':
						other_letter = i
						print('B', end='')
					else:
						print('A', end='')
				else:
					print('A', end='')
		else:
			print('NO')
	else:
		print('YES')
		flag = True
		for i in a:
			if freq_dict[i] == 1:
				if flag:
					print('A', end='')
				else:
					print('B', end='')
				flag = not flag
			else:
				print('A', end='')
else:
	print('YES')
	print('A' * len(a))


n = int(input())
arr = list(map(int, input().split()))
count = [0] * 101
unique = 0
multiple = 0
answer = ''
for i in range(n):
	count[arr[i]] += 1
for i in range(1, len(count)):
	if count[i] == 1:
		unique += 1
	elif count[i] > 2:
		multiple += 1
if unique % 2 == 0:
	multi = 0
	for j in range(n):
		if count[arr[j]] == 1:
			if multi == 0:
				answer += 'A'
				multi = 1
			elif multi == 1:
				answer += 'B'
				multi = 0
		elif count[arr[j]] > 1:
			answer += 'A'
elif multiple == 0:
	answer = 'NO'
else:
	put = False
	multi = 0
	for j in range(n):
		if count[arr[j]] == 1:
			if multi == 0:
				answer += 'A'
				multi = 1
			elif multi == 1:
				answer += 'B'
				multi = 0
		elif count[arr[j]] == 2:
			answer += 'A'
		elif count[arr[j]] > 2:
			if not put:
				answer += 'B'
				put = True
			else:
				answer += 'A'
if answer == 'NO':
	print(answer)
else:
	print('YES')
	print(answer)


import collections
n = int(input())
a = [int(i) for i in input().split()][:n]
cnt = collections.Counter(a)
odd = 0
for i in a:
	if cnt[i] == 1:
		odd += 1
A = 0
ans = ''
if odd % 2 == 0:
	for i in a:
		if cnt[i] == 1:
			if A % 2 == 0:
				ans += 'A'
			else:
				ans += 'B'
			A += 1
		else:
			ans += 'A'
else:
	C = 0
	for i in a:
		if cnt[i] > 2 and C == 0:
			ans += 'B'
			C += 1
		elif cnt[i] == 1:
			if A % 2 == 0:
				ans += 'A'
			else:
				ans += 'B'
			A += 1
		else:
			ans += 'A'
yes = 0
for i in a:
	if cnt[i] > 2:
		yes += 1
if yes > 0 or odd % 2 == 0:
	print('YES\n' + ans)
else:
	print('NO')


n = int(input())
a = [int(x) for x in input().split()]
res = ['A'] * n
cnt = [0] * 101
for i in a:
	cnt[i] += 1
good_num = cnt.count(1)
bad_above_2 = False
for i in range(101):
	if cnt[i] > 2:
		bad_above_2 = True
		break
if good_num % 2 == 0 or bad_above_2 > 0:
	print('YES')
	to_b = False
	for i in range(n):
		if cnt[a[i]] == 1:
			if to_b:
				res[i] = 'B'
			to_b = not to_b
	if good_num % 2 != 0:
		for i in range(n):
			if cnt[a[i]] > 2:
				res[i] = 'B'
				break
	print(''.join(res))
else:
	print('NO')


from collections import Counter
n = list(map(int, input().split()))
t = list(map(int, input().split()))
c = Counter(t)
ones = [i for i in c if c[i] == 1]
twos = [i for i in c if c[i] == 2]
mores = [i for i in c if c[i] > 2]
if len(ones) % 2 == 0:
	print('YES')
	oc = 'A'
	for i in range(len(t)):
		if t[i] in ones:
			print(oc, end='')
			oc = 'B' if oc == 'A' else 'A'
		else:
			print('A', end='')
elif len(mores) == 0:
	print('NO')
else:
	print('YES')
	oc = 'A'
	volt = False
	for i in range(len(t)):
		if t[i] in ones:
			print(oc, end='')
			oc = 'B' if oc == 'A' else 'A'
		elif t[i] in mores and (not volt):
			print('B', end='')
			volt = True
		else:
			print('A', end='')


from collections import Counter
n = int(input())
a = [int(o) for o in input().split()]
d = dict(Counter(a))
j = 0
reserve = []
resul = [-1] * n
for i in range(n):
	if d[a[i]] == 1:
		if j % 2 == 0:
			resul[i] = 'A'
		else:
			resul[i] = 'B'
		j += 1
	elif d[a[i]] > 2:
		resul[i] = 'A'
		reserve.append(i)
	else:
		resul[i] = 'A'
if j % 2 == 0:
	print('YES')
	print(''.join(resul))
elif reserve:
	resul[reserve[0]] = 'B'
	print('YES')
	print(''.join(resul))
else:
	print('NO')


n = int(input())
s = list(map(int, input().split()))
num1 = 0
b = ['A'] * n
cnt = {}
fst = {}
for i in range(len(s)):
	if s[i] in cnt:
		cnt[s[i]] += 1
	else:
		cnt[s[i]] = 1
		fst[s[i]] = i
for i in range(len(s)):
	if cnt[s[i]] == 1:
		if num1 % 2 == 1:
			b[i] = 'B'
		num1 += 1
if num1 % 2 == 1:
	res = False
	for i in range(len(s)):
		if cnt[s[i]] > 2:
			b[i] = 'B'
			res = True
			break
else:
	res = True
if res:
	print('YES')
	s1 = ''
	for i in b:
		s1 += i
	print(s1)
else:
	print('NO')


import collections, atexit, math, sys, bisect
sys.setrecursionlimit(1000000)

def getIntList():
	return list(map(int, input().split()))
try:
	import numpy

	def dprint(*args, **kwargs):
		print(*args, **kwargs, file=sys.stderr)
	dprint('debug mode')
except Exception:

	def dprint(*args, **kwargs):
		pass
inId = 0
outId = 0
if inId > 0:
	dprint('use input', inId)
	sys.stdin = open('input' + str(inId) + '.txt', 'r')
if outId > 0:
	dprint('use output', outId)
	sys.stdout = open('stdout' + str(outId) + '.txt', 'w')
	atexit.register(lambda : sys.stdout.close())
(N,) = getIntList()
zs = getIntList()
tc = [0 for _ in range(110)]
for x in zs:
	tc[x] += 1
f = False
fn = 0
ac = 0
for i in range(110):
	if tc[i] > 2:
		f = True
		fn = i
	if tc[i] == 1:
		ac += 1
if ac % 2 == 1 and (not f):
	print('NO')
	sys.exit()
r = [0 for _ in range(N)]
x = 0
for i in range(N):
	if tc[zs[i]] == 1:
		r[i] = x
		x = 1 - x
	else:
		r[i] = 0
if ac % 2 == 1:
	for i in range(N):
		if tc[zs[i]] > 2:
			r[i] = 1
			break
print('YES')
for i in range(N):
	c = 'A'
	if r[i]:
		c = 'B'
	print(c, end='')


from collections import Counter
n = int(input())
l = list(map(int, input().split()))
x = {}
y = {}
for (k, v) in Counter(l).items():
	if v == 1:
		x[k] = v
	elif v > 2:
		y[k] = v
if len(x) % 2 == 0:
	print('YES')
	c = 'A'
	for i in range(n):
		if l[i] in x:
			print(c, end='')
			c = 'A' if c == 'B' else 'B'
		else:
			print('A', end='')
elif len(y):
	print('YES')
	c = 'A'
	d = next(iter(y))
	for i in range(n):
		if l[i] in x:
			print(c, end='')
			c = 'A' if c == 'B' else 'B'
		elif l[i] == d:
			d = -1
			print('B', end='')
		else:
			print('A', end='')
else:
	print('NO', end='')
print()


n = int(input())
a = [int(i) for i in input().split()]
cnt = 0
cnt1 = 0
q = list()
for i in a:
	if i not in q:
		q.append(i)
		if a.count(i) == 1:
			cnt += 1
		elif a.count(i) > 2:
			cnt1 += 1
if cnt % 2 == 1 and cnt1 == 0:
	print('NO')
else:
	nums = list()
	g = list()
	ans = ''
	f = True
	q = False
	for i in a:
		if a.count(i) == 1:
			if f:
				ans += 'A'
				f = False
			else:
				ans += 'B'
				f = True
		elif a.count(i) == 2:
			ans += 'A'
		elif cnt % 2 == 1:
			if not q:
				ans += 'B'
				q = True
			else:
				ans += 'A'
		else:
			ans += 'A'
	print('YES')
	print(ans)


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

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

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

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

def main():
	n = int(input())
	arr = get_array()
	d = {}
	for i in arr:
		d[i] = d.get(i, 0) + 1
	count = 0
	check = 0
	for i in d:
		if d[i] == 1:
			count += 1
		if d[i] > 2:
			check = 1
	if count % 2 == 0:
		ans = ['A'] * n
		flag = 0
		for i in range(n):
			if d[arr[i]] == 1:
				if flag == 1:
					ans[i] = 'B'
				flag = 1 - flag
		print('YES')
		print(*ans, sep='')
		return
	if count % 2 == 1 and check == 0:
		print('NO')
		return
	flag = 0
	check = 0
	ans = ['A'] * n
	for i in range(n):
		if d[arr[i]] == 1:
			if flag == 1:
				ans[i] = 'B'
			flag = 1 - flag
		if check == 0 and d[arr[i]] > 2:
			check = 1
			ans[i] = 'B'
	print('YES')
	print(*ans, sep='')
main()


from collections import Counter
input()
a = list(map(int, input().split()))
c = Counter(a)
rv = ['A'] * len(a)
flag = 'A'
for i in range(len(a)):
	if c[a[i]] == 1:
		rv[i] = flag
		if flag == 'A':
			flag = 'B'
		else:
			flag = 'A'
if flag == 'B':
	new_c = dict(filter(lambda it: it[1] > 2, list(c.items())))
	if new_c:
		key = list(new_c.keys())[0]
		for i in range(len(a)):
			if a[i] == key:
				rv[i] = 'B'
				break
	else:
		print('NO')
		exit(0)
print('YES')
print(''.join(rv))


import collections

def main():
	a = int(input())
	b = list(map(int, input().split()))
	Temp = collections.Counter(b)
	(num1, num2, num3) = (0, 0, 0)
	for c in Temp.values():
		if c == 1:
			num1 += 1
		elif c == 2:
			num2 += 1
		else:
			num3 += 1
	if num1 % 2 == 1 and num3 == 0:
		print('NO')
		exit()
	print('YES')
	(A, B, C) = (0, 0, 0)
	if num1 % 2 == 0:
		C += 1
	Str = []
	for d in b:
		if Temp[d] == 1:
			if A == B:
				Str.append('A')
				A += 1
			else:
				Str.append('B')
				B += 1
		elif Temp[d] >= 3 and C == 0:
			Str.append('B')
			C += 1
		else:
			Str.append('A')
	print(''.join(Str))
main()


from collections import Counter
N = int(input())
List = [int(x) for x in input().split()]
Dict = Counter(List)
Counts = list(Dict.values())
n = len(Counts)
One = Counts.count(1)
if One % 2 == 0:
	flip = 0
	print('YES')
	Ans = ''
	for i in range(N):
		if Dict[List[i]] == 1:
			Ans += chr(65 + flip)
			flip ^= 1
		else:
			Ans += 'A'
	print(Ans)
else:
	notDecided = -1
	flip = 0
	Ans = ''
	for i in range(N):
		if Dict[List[i]] == 1:
			Ans += chr(65 + flip)
			flip ^= 1
		elif Dict[List[i]] != 2 and notDecided == -1:
			notDecided = Dict[List[i]]
			Ans += 'B'
		elif Dict[List[i]] % 2 != 0 and Dict[List[i]] == notDecided:
			Ans += 'A'
		else:
			Ans += 'A'
	if notDecided == -1:
		print('NO')
	else:
		print('YES')
		print(Ans)


n = int(input())
multiset = list(map(int, input().split()))
A = 0
B = 0
rep = [0 for i in range(100)]
ans = ''
altern = 1
for i in multiset:
	rep[i - 1] += 1
suma = sum((1 for i in multiset if rep[i - 1] == 1))
triple = any((i >= 3 for i in rep))
if suma % 2 == 0 or (triple and suma % 2 != 0):
	print('YES')
	if suma % 2 == 0:
		for i in multiset:
			if rep[i - 1] == 1 and altern == 1:
				ans += 'A'
				altern *= -1
			elif rep[i - 1] == 1 and altern == -1:
				ans += 'B'
				altern *= -1
			else:
				ans += 'A'
		print(ans)
	else:
		for i in multiset:
			if rep[i - 1] == 1 and altern == 1:
				ans += 'A'
				altern *= -1
			elif rep[i - 1] == 1 and altern == -1:
				ans += 'B'
				altern *= -1
			elif rep[i - 1] > 2 and triple:
				ans += 'B'
				triple = False
			else:
				ans += 'A'
		print(ans)
else:
	print('NO')


from collections import Counter as C
n = int(input())
l = [*map(int, input().split())]
cnt = C(l)
a = 0
bad = set()
reserve = []
for (k, v) in cnt.items():
	if v == 1:
		if a == 0:
			a = 1
		else:
			a = 0
			bad.add(k)
	if v >= 3 and (not reserve):
		reserve = [k]
if a and reserve:
	bad.add(reserve[0])
	a = 0
if a:
	print('NO')
	exit()
print('YES')
res = ['A'] * n
for i in range(n):
	if l[i] in bad:
		res[i] = 'B'
		bad.remove(l[i])
print(''.join(res))


n = int(input())
a = [int(i) for i in input().split()]
da = {}
o = list('Z' * n)
for i in a:
	if i in da:
		da[i] += 1
	else:
		da[i] = 1
sc = 0
dc = 0
mc = 0
scl = []
dcl = []
mcl = []
for i in da:
	if da[i] == 1:
		sc += 1
		scl.append(i)
	elif da[i] == 2:
		dc += 1
		dcl.append(i)
	else:
		mc += 1
		mcl.append(i)
for i in dcl:
	x = 2
	for j in range(n):
		if a[j] == i:
			o[j] = 'A'
			x -= 1
		if x == 0:
			break
pc = 0
for i in scl:
	j = a.index(i)
	if pc % 2 == 0:
		o[j] = 'A'
	else:
		o[j] = 'B'
	pc += 1
f = 1
if sc == 0:
	for i in range(n):
		o[i] = 'A'
elif sc % 2 == 0:
	for i in mcl:
		x = da[i]
		for j in range(n):
			if a[j] == i:
				o[j] = 'A'
				x -= 1
			if x == 0:
				break
elif sc % 2 == 1:
	if len(mcl) == 0:
		f = 0
	else:
		pc = 0
		for i in mcl:
			x = da[i]
			for j in range(n):
				if a[j] == i:
					if pc == 0:
						o[j] = 'B'
						pc = 1
					else:
						o[j] = 'A'
					x -= 1
				if x == 0:
					break
if f == 0:
	print('NO')
else:
	print('YES')
	print(''.join(o))


def vasya_and_multisets(v):
	m = dict()
	for e in v:
		m[e] = m.get(e, 0) + 1
	ones = 0
	has_gt2 = False
	for e in m.values():
		if e == 1:
			ones += 1
		if e > 2:
			has_gt2 = True
	odd_ones = ones % 2 == 1
	if odd_ones and (not has_gt2):
		print('NO')
	else:
		print('YES')
		A = True
		ans = ''
		for e in v:
			if m[e] == 2:
				ans += 'A'
			elif m[e] == 1:
				if A:
					ans += 'A'
				else:
					ans += 'B'
				A = not A
			elif odd_ones:
				ans += 'B'
				odd_ones = False
			else:
				ans += 'A'
		print(ans)
n = int(input())
v = list(map(int, input().split()))
vasya_and_multisets(v)


n = int(input())
a = [int(x) for x in input().split()]
from collections import Counter
cnt = Counter(a)
solo = set()
big = set()
for (x, v) in cnt.items():
	if v == 1:
		solo.add(x)
	if v >= 3:
		big.add(x)
if len(solo) % 2 == 0:
	print('YES')
	cur = 0
	for x in a:
		if x in solo:
			print('AB'[cur], end='')
			cur ^= 1
		else:
			print('A', end='')
	print()
elif not big:
	print('NO')
else:
	print('YES')
	did_big = 0
	cur = 0
	for x in a:
		if x in solo:
			print('AB'[cur], end='')
			cur ^= 1
		elif x in big and (not did_big):
			print('B', end='')
			did_big = 1
		else:
			print('A', end='')
	print()


n = int(input())
l = list(map(int, input().split()))
freq = {}
for i in l:
	if i in freq:
		freq[i] += 1
	else:
		freq[i] = 1
(cnt1, cnt3) = (0, 0)
for i in freq:
	if freq[i] == 1:
		cnt1 += 1
	if freq[i] >= 3:
		cnt3 += 1
if cnt1 & 1 and cnt3 == 0:
	print('NO')
else:
	print('YES')
	flag = cnt1 & 1
	cnt = 1
	for i in l:
		if freq[i] == 1:
			if cnt:
				print('A', end='')
			else:
				print('B', end='')
			cnt = not cnt
		elif freq[i] == 2:
			print('A', end='')
		else:
			if flag:
				print('B', end='')
			else:
				print('A', end='')
			flag = 0


import sys

def main():
	_ = sys.stdin.readline()
	s = list(map(int, sys.stdin.readline().strip().split(' ')))
	freq = [0] * 101
	for i in s:
		freq[i] += 1
	ans = [0] * len(s)
	currMulti = 0
	for (i, v) in enumerate(s):
		if freq[v] == 1:
			ans[i] = currMulti
			currMulti ^= 1
	if currMulti == 1:
		ok = False
		for (i, v) in enumerate(s):
			if freq[v] > 2:
				ans[i] = currMulti
				ok = True
				break
		if ok is not True:
			print('NO')
			return
	print('YES')
	print(''.join(['A' if x == 0 else 'B' for x in ans]))
main()


n = int(input())
data = input().split()
z = {}
ans = ['A'] * n
for x in data:
	z[x] = z.get(x, 0) + 1
a = 0
b = 0
for (i, j) in enumerate(data):
	if z[j] == 1:
		if a > b:
			ans[i] = 'B'
			b += 1
		else:
			a += 1
if a > b:
	for (i, j) in enumerate(data):
		if z[j] > 2:
			ans[i] = 'B'
			b += 1
			break
if a == b:
	print('YES')
	for i in ans:
		print(i, end='')
else:
	print('NO')


USE_STDIO = False
import collections
if not USE_STDIO:
	try:
		import mypc
	except:
		pass

def main():
	(n,) = map(int, input().split(' '))
	s = list(map(int, input().split(' ')))
	cnts = collections.Counter(s)
	(num1, num2, num3) = (0, 0, 0)
	for c in cnts.values():
		if c == 1:
			num1 += 1
		elif c == 2:
			num2 += 1
		else:
			num3 += 1
	if num1 % 2 == 1 and num3 == 0:
		print('NO')
		return
	print('YES')
	ans = []
	(A, B, C) = (0, 0, 0)
	if num1 % 2 == 0:
		C += 1
	for x in s:
		if cnts[x] == 1:
			if A == B:
				ans.append('A')
				A += 1
			else:
				ans.append('B')
				B += 1
		elif cnts[x] >= 3 and C == 0:
			ans.append('B')
			C += 1
		else:
			ans.append('A')
	print(''.join(ans))
main()


from collections import Counter
n = int(input())
a = tuple(map(int, input().split(' ')))
c = Counter(a)
ones = 0
twos = 0
more = 0
for i in c.items():
	if i[1] == 1:
		ones += 1
	elif i[1] == 2:
		twos += 1
	else:
		more += 1
if ones % 2 == 1 and more == 0:
	print('NO')
else:
	counter = 0
	flag = ones % 2 == 1
	print('YES')
	for i in a:
		if c[i] == 2:
			print('A', end='')
		elif c[i] == 1:
			print(('A', 'B')[counter % 2], end='')
			counter += 1
		elif flag:
			print('B', end='')
			flag = False
		else:
			print('A', end='')


n = int(input())
l = list(map(int, input().split()))
d = {}
for i in l:
	try:
		d[i] += 1
	except:
		d[i] = 1
x = list(d.values())
if x.count(1) % 2 == 0:
	print('YES')
	c = 0
	ans = [''] * n
	for i in range(n):
		if d[l[i]] == 1:
			if c:
				ans[i] = 'B'
			else:
				ans[i] = 'A'
			c = c ^ 1
		else:
			ans[i] = 'A'
	print(''.join(ans))
elif x.count(1) + x.count(2) < len(x):
	print('YES')
	flag = 1
	c = 0
	ans = [''] * n
	for i in range(n):
		if d[l[i]] == 1:
			if c:
				ans[i] = 'B'
			else:
				ans[i] = 'A'
			c = c ^ 1
		elif d[l[i]] == 2:
			ans[i] = 'A'
		elif flag:
			ans[i] = 'B'
			flag = 0
		else:
			ans[i] = 'A'
	print(''.join(ans))
else:
	print('NO')


n = int(input())
a = list(map(int, input().split()))
z = ['A'] * len(a)
d = {}
for i in a:
	if i in d.keys():
		d[i] += 1
	else:
		d[i] = 1
(ka, kb) = (0, 0)
for (i, x) in enumerate(a):
	if d[x] == 1:
		if ka > kb:
			z[i] = 'B'
			kb += 1
		else:
			z[i] = 'A'
			ka += 1
if ka > kb:
	for (i, x) in enumerate(a):
		if d[x] > 2:
			z[i] = 'B'
			kb += 1
			break
if ka == kb:
	print('YES')
	print(''.join(z))
else:
	print('NO')


n = int(input())
s = [int(el) for el in input().split()]
x = []
y = []
z = []
for i in range(n):
	if s[i] in x:
		y[x.index(s[i])] += 1
		z[x.index(s[i])].append(i)
	else:
		x.append(s[i])
		y.append(1)
		z.append([])
		z[len(z) - 1].append(i)
k = y.count(1)
l = n - k - y.count(2) * 2
if l <= 0 and k >= 1 and (k % 2 == 1):
	print('NO')
	raise SystemExit
s1 = 0
s2 = 0
out = 'A' * n
for i in range(n):
	if y[x.index(s[i])] == 2:
		for j in z[x.index(s[i])]:
			out = out[:j] + 'A' + out[j + 1:]
	if y[x.index(s[i])] == 1:
		if s1 > s2:
			out = out[:i] + 'B' + out[i + 1:]
			s2 += 1
		else:
			out = out[:i] + 'A' + out[i + 1:]
			s1 += 1
	if y[x.index(s[i])] >= 3:
		continue
	y[x.index(s[i])] = 0
if y.count(0) == len(y):
	print('YES')
	print(out)
	raise SystemExit
if s1 == s2:
	for i in range(n):
		k = x.index(s[i])
		if y[k] != 0:
			for j in z[k]:
				out = out[:j] + 'A' + out[j + 1:]
else:
	pos = 0
	for i in range(n):
		k = x.index(s[i])
		if y[k] != 0 and pos == 0:
			for j in z[k]:
				out = out[:j] + 'A' + out[j + 1:]
			j = z[k][0]
			out = out[:j] + 'B' + out[j + 1:]
			pos = 1
			y[k] = 0
		elif y[k] != 0 and pos == 1:
			for j in z[k]:
				out = out[:j] + 'A' + out[j + 1:]
			y[k] = 0
print('YES')
print(out)


n = int(input())
a = input().split()
z = {}
ans = ['A'] * n
for x in a:
	if x in z.keys():
		z[x] += 1
	else:
		z[x] = 1
(kb, ka) = (0, 0)
for (i, x) in enumerate(a):
	if z[x] == 1:
		if ka > kb:
			kb += 1
			ans[i] = 'B'
		else:
			ka += 1
			ans[i] = 'A'
if ka > kb:
	for (i, x) in enumerate(a):
		if z[x] > 2:
			ans[i] = 'B'
			kb += 1
			break
if ka == kb:
	print('YES')
	print(''.join(ans))
else:
	print('NO')


n = int(input())
data = input().split()
z = {}
ans = ['A'] * n
for x in data:
	z[x] = z.get(x, 0) + 1
(ca, cb) = (0, 0)
for (i, x) in enumerate(data):
	if z[x] == 1:
		if ca > cb:
			ans[i] = 'B'
			cb += 1
		else:
			ca += 1
			ans[i] = 'A'
if ca > cb:
	for (i, x) in enumerate(data):
		if z[x] > 2:
			cb += 1
			ans[i] = 'B'
			break
if ca == cb:
	print('YES')
	print(''.join(ans))
else:
	print('NO')


n = int(input())
from collections import *
c = defaultdict(list)
for (i, a) in enumerate(input().split()):
	c[a].append(i)
c = c.items
c1 = [v[0] for (k, v) in c() if len(v) == 1]
c3 = [v[0] for (k, v) in c() if len(v) > 2]
if len(c1) % 2 and (not c3):
	print('NO')
else:
	if len(c1) % 2:
		c1.append(c3[0])
	r = ['A'] * n
	for v in c1[1::2]:
		r[v] = 'B'
	print('YES\n' + ''.join(r))


n = int(input())
a = list(map(int, input().split()))
m = {}
s = [[], []]
for i in a:
	if i in m:
		m[i] += 1
	else:
		m[i] = 1
pos = 0
for p in m:
	if m[p] == 1:
		s[pos].append(p)
		pos = 1 - pos
if len(s[0]) == len(s[1]):
	res = ''
	for i in range(n):
		if a[i] in s[1]:
			res += 'B'
		else:
			res += 'A'
	print('YES')
	print(res)
else:
	res = ''
	idd = -1
	for p in m:
		if m[p] >= 3:
			idd = p
			break
	if idd == -1:
		print('NO')
		exit(0)
	flag = False
	for i in range(n):
		if a[i] in s[1]:
			res += 'B'
		elif a[i] == idd and flag == False:
			res += 'B'
			flag = True
		else:
			res += 'A'
	print('YES')
	print(res)


n = int(input())
s = [0] * 200
l = list(map(int, input().split()))
for i in l:
	s[i] += 1
(cnt, cnt1, cnt2) = (0, 0, 0)
for i in range(len(s)):
	if s[i] == 1:
		cnt1 += 1
	elif s[i] > 2:
		cnt += 1
if cnt1 % 2:
	if cnt == 0:
		print('NO')
	else:
		print('YES')
		f = 1
		f1 = 1
		for i in l:
			if f and s[i] == 1:
				print('A', end='')
				f = 0
			elif not f and s[i] == 1:
				print('B', end='')
				f = 1
			elif f1 and s[i] > 2:
				print('B', end='')
				f1 = 0
			else:
				print('A', end='')
else:
	print('YES')
	f = 1
	for i in l:
		if f and s[i] == 1:
			print('A', end='')
			f = 0
		elif not f and s[i] == 1:
			print('B', end='')
			f = 1
		else:
			print('A', end='')


from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, datetime
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
mod = 10 ** 9 + 7

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

def inpls():
	return list(input().split())
N = int(input())
aa = inpl()
cnt = [0] * 110
nums = [0] * 110
nums[0] = N
for a in aa:
	nums[cnt[a]] -= 1
	cnt[a] += 1
	nums[cnt[a]] += 1
if nums[1] % 2 == 1:
	if sum(nums[3:]) == 0:
		print('NO')
	else:
		print('YES')
		ans = []
		abflag = True
		First = True
		for a in aa:
			if cnt[a] == 1:
				if abflag:
					ans.append('A')
				else:
					ans.append('B')
				abflag = not abflag
			elif cnt[a] == 2:
				ans.append('A')
			elif First:
				ans.append('B')
				First = False
			else:
				ans.append('A')
		print(''.join(ans))
elif nums[1] % 2 == 0:
	print('YES')
	ans = []
	abflag = True
	First = True
	for a in aa:
		if cnt[a] == 1:
			if abflag:
				ans.append('A')
			else:
				ans.append('B')
			abflag = not abflag
		else:
			ans.append('A')
	print(''.join(ans))


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
import time
start_time = time.time()
import collections as col
import math, string
from functools import reduce

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = getInts()
	ops = ['A', 'B']
	ans = [''] * N
	curr = 0
	counts = col.defaultdict(int)
	for a in A:
		counts[a] += 1
	for (i, a) in enumerate(A):
		if counts[a] == 1:
			ans[i] = ops[curr]
			curr ^= 1
		elif counts[a] == 2:
			ans[i] = 'A'
	if curr == 0:
		for i in range(N):
			if ans[i] == '':
				ans[i] = 'A'
		print('YES')
		print(*ans, sep='')
		return
	flag = False
	for key in counts:
		if counts[key] > 2:
			flag = True
			break
	if not flag:
		print('NO')
		return
	for (i, a) in enumerate(A):
		if ans[i] == '':
			if a == key and flag:
				ans[i] = 'B'
				flag = False
			else:
				ans[i] = 'A'
	print('YES')
	print(*ans, sep='')
	return
solve()


from collections import defaultdict

def main():
	(r, d, f) = (['A'] * int(input()), defaultdict(list), False)
	for (i, s) in enumerate(input().split()):
		d[s].append(i)
	for (s, l) in d.items():
		if len(l) == 1:
			r[l.pop()] = 'AB'[f]
			f = not f
	if f:
		for (s, l) in d.items():
			if len(l) > 2:
				r[l[0]] = 'B'
				break
		else:
			print('NO')
			return
	print('YES')
	print(''.join(r))
main()


import collections
n = int(input())
a = [int(i) for i in input().split()]
d = collections.Counter(a)
c = 0
m = 0
for i in a:
	if d[i] == 1:
		c += 1
	elif d[i] >= 3:
		m += 1
if c % 2 != 0 and m == 0:
	print('NO')
else:
	print('YES')
	l = 0
	ans = []
	for i in range(0, n):
		if d[a[i]] == 1 and l % 2 == 0:
			ans.append('A')
			l += 1
		elif d[a[i]] == 1 and l % 2 == 1:
			l += 1
			ans.append('B')
		else:
			ans.append('A')
	if c % 2 == 1:
		for i in range(0, n):
			if d[a[i]] >= 3:
				ans[i] = 'B'
				break
	print(*ans, sep='')


n = int(input())
arr = list(map(int, input().split()))
num = [0 for i in range(101)]
for i in arr:
	num[i] += 1
od = set()
dv = set()
mn = set()
o = 0
d = 0
m = 0
for i in range(101):
	if num[i] == 1:
		o += 1
		od.add(i)
	elif num[i] == 2:
		dv.add(i)
		d += 1
	elif num[i] > 2:
		mn.add(i)
		m += 1
if o % 2 == 1 and m == 0:
	print('NO')
else:
	print('YES')
	dob = o % 2
	s = ''
	h = 'A'
	for i in arr:
		if i in od:
			s += h
			if h == 'A':
				h = 'B'
			else:
				h = 'A'
		elif dob > 0 and i in mn:
			s += 'B'
			dob -= 1
		else:
			s += 'A'
	print(s)


n = int(input())
l = list(map(int, input().split()))
from collections import Counter, defaultdict
c = Counter(l)
l1 = []
for i in c:
	if c[i] == 1:
		l1.append(i)
a = 0
d = defaultdict(int)
for i in l1:
	if a == 0:
		d[i] = 'A'
		a = 1
	else:
		d[i] = 'B'
		a = 0
if len(l1) % 2 == 0:
	ans = ''
	for i in l:
		if c[i] > 1:
			d[i] = 'A'
	for i in l:
		ans += d[i]
	print('YES')
	print(ans)
else:
	s = ''
	ans = ''
	for i in l:
		if c[i] > 2:
			s = i
			break
	if s != '':
		x = 0
		for i in l:
			if c[i] > 1:
				if i == s and x == 0:
					ans += 'B'
					x += 1
				else:
					ans += 'A'
			else:
				ans += d[i]
		print('YES')
		print(ans)
	else:
		print('NO')


n = int(input())
s = list(map(int, input().split()))
c = [0] * 101
for i in range(n):
	c[s[i]] += 1
cnt = 0
cc = 0
for i in range(n):
	if c[s[i]] == 1:
		cnt += 1
	elif c[s[i]] >= 3:
		cc += 1
if cnt % 2 == 1 and cc == 0:
	print('NO')
else:
	ans = [''] * n
	al = ['A', 'B']
	if cnt % 2 == 0 and cc == 0:
		d = 0
		for i in range(n):
			if c[s[i]] == 1:
				ans[i] = al[d]
				d = 1 - d
			else:
				ans[i] = 'A'
	elif cnt % 2 == 1 and cc >= 1:
		d = 0
		e = -1
		for i in range(n):
			if c[s[i]] >= 3:
				e = s[i]
				break
		flag = 1
		for i in range(n):
			if c[s[i]] == 1:
				ans[i] = al[d]
				d = 1 - d
			elif flag and s[i] == e:
				ans[i] = 'B'
				flag = 0
			else:
				ans[i] = 'A'
	else:
		d = 0
		for i in range(n):
			if c[s[i]] == 1:
				ans[i] = al[d]
				d = 1 - d
			else:
				ans[i] = 'A'
	print('YES')
	print(''.join(ans))


n = int(input())
a = [int(i) for i in input().split()]
t = 0
c = 0
B = False
k = True
for i in a:
	if a.count(i) == 1:
		t += 1
	if a.count(i) >= 3:
		c += 1
if t % 2 == 0:
	print('YES')
	for i in a:
		if a.count(i) == 1:
			if B:
				print('B', end='')
			else:
				print('A', end='')
			B = not B
		else:
			print('A', end='')
elif c > 0:
	print('YES')
	for i in a:
		if a.count(i) == 1:
			if B:
				print('B', end='')
			else:
				print('A', end='')
			B = not B
		elif a.count(i) >= 3 and k:
			print('B', end='')
			k = False
			continue
		else:
			print('A', end='')
else:
	print('NO')


import sys

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

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

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

def main():
	n = int(input())
	arr = get_array()
	from collections import Counter
	d = Counter(arr)
	ans = ['A'] * n
	f = 0
	cnt = 0
	check = 0
	for i in d:
		if d[i] > 2:
			check = 1
		elif d[i] == 1:
			cnt += 1
	if cnt % 2 == 0:
		for i in range(n):
			if d[arr[i]] == 1:
				if f == 0:
					ans[i] == 'A'
				else:
					ans[i] = 'B'
				f = 1 - f
		print('YES')
		print(*ans, sep='')
		return
	if cnt % 2 == 1 and check == 0:
		print('NO')
		return
	for i in range(n):
		if d[arr[i]] == 1:
			if f == 0:
				ans[i] = 'A'
			else:
				ans[i] = 'B'
			f = 1 - f
		if check == 1 and d[arr[i]] > 2:
			ans[i] = 'B'
			check = 0
	print('YES')
	print(*ans, sep='')
main()


import sys
from collections import Counter
sys.setrecursionlimit(int(10000000.0))

def main():
	while 1:
		try:
			n = int(input())
		except EOFError:
			break
		arr = [int(x) for x in input().split()]
		s = Counter(arr)
		a = len([x for (x, y) in s.items() if y == 1])
		c = len([x for (x, y) in s.items() if y > 2])
		if a % 2 == 1 and c == 0:
			print('NO')
			continue
		aux = 0
		ans = []
		for x in arr:
			if s[x] == 1:
				y = 'AB'[aux]
				aux = 1 - aux
			elif s[x] == 2:
				y = 'A'
			elif a % 2 == 1 and c > 0:
				y = 'B'
				c = 0
			else:
				y = 'A'
			ans.append(y)
		print('YES')
		print(''.join(ans))
main()


import sys

def main():
	n = int(input())
	s = list(map(int, input().split()))
	cnt = {i: s.count(i) for i in s}
	if list(cnt.values()).count(1) == 0:
		print('YES')
		print('A' * len(s))
		return
	if list(cnt.values()).count(1) & 1:
		c3 = len(cnt) - list(cnt.values()).count(1) - list(cnt.values()).count(2)
		if c3 == 0:
			print('NO')
			return
		else:
			print('YES')
			ok = False
			f = 0
			for i in s:
				if not ok and cnt[i] >= 3:
					print('B', end='')
					ok = True
				elif cnt[i] == 1:
					print(['A', 'B'][f], end='')
					f ^= 1
				else:
					print('A', end='')
			print()
	else:
		print('YES')
		f = 0
		for i in s:
			if cnt[i] == 1:
				print(['A', 'B'][f], end='')
				f ^= 1
			else:
				print('A', end='')
		print()
main()


n = int(input())
a = list(map(int, input().split()))
ans = ['A'] * n
bal = 0
for i in range(n):
	if a.count(a[i]) != 1:
		continue
	if bal < 0:
		ans[i] = 'B'
		bal += 1
	else:
		bal -= 1
if bal < 0:
	for i in range(n):
		if a.count(a[i]) <= 2:
			continue
		ans[i] = 'B'
		bal = 0
		break
if bal == 0:
	print('YES')
	print(*ans, sep='')
else:
	print('NO')


n = int(input())
s = list(map(int, input().split()))
non_good_numbers = []
raw_numbers = []
for i in s:
	count = s.count(i)
	if count == 1:
		raw_numbers.append(i)
	elif count > 2:
		non_good_numbers.append(i)
if len(raw_numbers) % 2 == 1 and len(non_good_numbers) == 0:
	print('NO')
else:
	if len(raw_numbers) % 2 == 1:
		use_non_good_number = non_good_numbers[0]
	else:
		use_non_good_number = None
	is_non_good_used = False
	res = []
	number_flag = 'A'
	for i in s:
		if i == use_non_good_number:
			if not is_non_good_used:
				res.append('B')
				is_non_good_used = True
			else:
				res.append('A')
		elif i in raw_numbers:
			res.append(number_flag)
			number_flag = 'B' if number_flag == 'A' else 'A'
		else:
			res.append('A')
	print('YES')
	print(''.join(res))


n = int(input())
xs = [int(x) for x in input().split()]
from collections import Counter
c = Counter(xs)
nice = []
pair = []
other = []
for i in c:
	if c[i] == 1:
		nice.append(i)
	elif c[i] == 2:
		pair.append(i)
	else:
		other.append(i)
bs = set()
for i in range(len(nice)):
	if i % 2 == 1:
		bs.add(nice[i])
if len(nice) % 2 != 0:
	if len(other) == 0:
		print('NO')
		exit()
	else:
		bs.add(other[0])
print('YES')
l = []
for i in xs:
	if i in bs:
		l.append('B')
		bs.remove(i)
	else:
		l.append('A')
print(''.join(l))


n = int(input())
a = [int(s) for s in input().split()]
d = dict()
for i in a:
	if i in d.keys():
		d[i] += 1
	else:
		d[i] = 1
k = 0
for i in d:
	if d[i] == 1:
		k += 1
s = ''
(c1, c2) = (0, 0)
r = ['A'] * n
for (ind, e) in enumerate(a):
	if d[e] == 1:
		if c1 > c2:
			r[ind] = 'B'
			c2 += 1
		else:
			r[ind] = 'A'
			c1 += 1
if c2 < c1:
	for (ind, e) in enumerate(a):
		if d[e] > 2:
			r[ind] = 'B'
			c2 += 1
			break
if c2 < c1:
	print('NO')
else:
	print('YES')
	print(''.join(r))


from collections import *
n = int(input())
a = list(map(int, input().split()))
ans = ['A'] * n
num = 0
for i in range(n):
	if a.count(a[i]) > 1:
		continue
	if num < 0:
		num += 1
		ans[i] = 'B'
	else:
		num -= 1
if num < 0:
	for i in range(n):
		if a.count(a[i]) <= 2:
			continue
		ans[i] = 'B'
		num = 0
		break
if num == 0:
	print('YES')
	print(*ans, sep='')
else:
	print('NO')