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

Source: codeforces | Difficulty: MEDIUM
Tags: Implementation

Greedy algorithms

Complete search

Dynamic programming

Mathematics


Solutions:
n = int(input())
s = list(map(int, input().split()))
d = {}
mt = False
mti = -1
for i in range(len(s)):
	if s[i] not in d:
		d[s[i]] = 1
	else:
		d[s[i]] += 1
		if d[s[i]] > 2:
			mt = True
			mti = i
good = []
for i in d.keys():
	if d[i] == 1:
		good.append(i)
if len(good) % 2 == 0:
	print('YES')
	good1 = good[:len(good) // 2]
	for i in s:
		if i in good1:
			print('A', end='')
		else:
			print('B', end='')
elif mt:
	print('YES')
	good1 = good[:len(good) // 2]
	u = False
	for i in s:
		if i in good1 or (not u and i == s[mti]):
			print('A', end='')
			if i == s[mti]:
				u = True
		else:
			print('B', end='')
else:
	print('NO')


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


gi = lambda : list(map(int, input().split()))
(n,) = gi()
l = gi()
occ = [0] * 101
for e in l:
	occ[e] += 1
(niceable, niceable2) = (0, 0)
for k in range(1, 101):
	if occ[k] in (1, 2):
		niceable += occ[k]
	elif occ[k] > 0:
		niceable2 += 1
if niceable2 == 0 and niceable % 2:
	print('NO')
	exit()
print('YES')
(cur1, cur2, index) = (0, 0, 0)
if (niceable2 + niceable) % 2:
	for e in l:
		if occ[e] > 2:
			occ[e] = -2
			index = e
			break
A = []
B = []
for k in range(1, 101):
	if occ[k] == 1:
		if cur1 % 2:
			A.append(k)
		else:
			B.append(k)
		cur1 += 1
	elif occ[k] == 2:
		A.append(k)
		B.append(k)
if len(A) > len(B):
	cur = 1
else:
	cur = 0
for k in range(1, 101):
	if occ[k] > 2:
		if cur % 2 == 0:
			A.append(k)
			B += [k] * (occ[k] - 1)
		else:
			B.append(k)
			A += [k] * (occ[k] - 1)
		cur += 1
A += [index] * l.count(index)
for k in range(n):
	if l[k] in A:
		print('A', end='')
		A.remove(l[k])
	else:
		print('B', end='')
		B.remove(l[k])


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
n = int(input())
a = list(map(int, input().split()))
l = [[] for i in range(105)]
for i in range(n):
	l[a[i]].append(i)
ans = [0 for i in range(n)]
ct = 0
f = 'A'
for i in range(105):
	if len(l[i]) == 1:
		ans[l[i][0]] = f
		if f == 'A':
			f = 'B'
			ct += 1
		else:
			f = 'A'
			ct -= 1
flag = 0
if ct == 1:
	for i in range(105):
		if len(l[i]) > 2:
			ans[l[i][0]] = f
			break
	else:
		flag = 1
if flag == 1:
	print('NO')
else:
	print('YES')
	for i in range(n):
		if ans[i] == 0:
			ans[i] = 'A'
	print(''.join(ans[:n]))


from collections import Counter

def foo():
	input()
	l = []
	for a in input().split(' '):
		l.append(a)
	c = Counter(l)
	has3 = False
	ones = 0
	for key in c:
		if c[key] == 1:
			ones += 1
		elif c[key] > 2:
			has3 = True
	if ones % 2 == 1 and has3 == False:
		print('NO')
		return
	print('YES')
	put3 = ones % 2 == 1
	putted = False
	put = ''
	a = True
	output = ''
	for num in l:
		if c[num] == 1:
			if a:
				output += 'A'
			else:
				output += 'B'
			a = not a
		elif num == put:
			output += putted
		elif c[num] > 2 and put3:
			if a:
				output += 'A'
				putted = 'B'
			else:
				output += 'B'
				putted = 'A'
			a = not a
			put3 = False
			put = num
		else:
			output += 'A'
	print(output)
foo()


n = int(input())
s = list(map(int, input().split()))
ct = {}
a = [0] * 101
for i in range(n):
	ct[s[i]] = ct.get(s[i], 0) + 1
for i in ct:
	a[ct[i]] += 1
if a[1] % 2 == 0:
	c = 'A'
	print('YES')
	ans = ''
	for i in range(n):
		if ct[s[i]] == 1:
			ans = ans + c
			c = 'A' if c == 'B' else 'B'
		else:
			ans = ans + 'A'
	print(ans)
else:
	f = 0
	for i in range(3, 101):
		if a[i] > 0:
			f = i
			break
	if f:
		p = 0
		c = 'A'
		ans = ''
		print('YES')
		for i in range(n):
			if ct[s[i]] == 1:
				ans = ans + c
				c = 'A' if c == 'B' else 'B'
			elif ct[s[i]] == f and p == 0:
				ans = ans + 'B'
				p = 1
			else:
				ans = ans + 'A'
		print(ans)
	else:
		print('NO')


from collections import Counter
n = int(input())
s = list(map(int, input().split()))
c = Counter(s)
t = 0
for x in c:
	if c[x] == 1:
		t += 1
if t % 2 == 1 and t == n:
	print('NO')
	exit()
ans = ''
if t % 2 == 1:
	flag = 1
else:
	flag = 0
no = 0
for x in s:
	if c[x] == 1:
		if no < (t + 1) // 2:
			ans += 'A'
			no += 1
		else:
			ans += 'B'
	elif c[x] > 2 and flag == 1:
		ans += 'B'
		flag = 0
	else:
		ans += 'A'
if flag:
	print('NO')
	exit()
else:
	print('YES')
	print(ans)


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())
s = list(map(int, input().split()))
d = dict()
for i in s:
	if i in d:
		d[i] += 1
	else:
		d.update({i: 1})
c = 0
for i in d:
	if d[i] == 1:
		c += 1
ans = ''
if c % 2 == 0:
	t = True
	for i in s:
		if d[i] == 1:
			if t:
				ans += 'A'
			else:
				ans += 'B'
			t = not t
		else:
			ans += 'A'
	print('YES')
	print(ans)
else:
	can = False
	for i in d:
		if d[i] > 2:
			can = True
			x = i
	if can:
		t = True
		t1 = False
		t3 = True
		for i in s:
			if d[i] == 1 or (i == x and t1 == False):
				if i == x and t1 == False:
					t1 = True
					if t:
						ans += 'A'
						t3 = True
					else:
						ans += 'B'
						t3 = False
					t = not t
				else:
					if t:
						ans += 'A'
					else:
						ans += 'B'
					t = not t
			elif i == x:
				if t3:
					ans += 'B'
				else:
					ans += 'A'
			else:
				ans += 'A'
		print('YES')
		print(ans)
	else:
		print('NO')


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)


n = int(input())
a = list(map(int, input().split()))
rec = [0] * 1000
one = 0
for i in range(n):
	rec[a[i]] += 1
for i in range(1000):
	if rec[i] == 1:
		one += 1
if one % 2 != 0 and max(rec) <= 2:
	print('NO')
elif one % 2 != 0:
	print('YES')
	t = ''
	k = 0
	flag = True
	for i in range(n):
		if rec[a[i]] == 1 and k < one // 2:
			t += 'A'
			k += 1
		elif rec[a[i]] == 1:
			t += 'B'
		elif rec[a[i]] >= 3 and flag:
			t += 'A'
			flag = False
		else:
			t += 'B'
	print(t)
else:
	print('YES')
	t = ''
	k = 0
	for i in range(n):
		if rec[a[i]] == 1 and k < one // 2:
			t += 'A'
			k += 1
		elif rec[a[i]] == 1:
			t += 'B'
		else:
			t += 'A'
	print(t)


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


input()
i = input().split()
for a in range(len(i)):
	i[a] = int(i[a])
counts = {}
nice = []
not_nice = []
for a in i:
	if a in not_nice:
		counts[a] += 1
	elif a in nice:
		counts[a] += 1
		del nice[nice.index(a)]
		not_nice.append(a)
	else:
		counts[a] = 1
		nice.append(a)
if len(nice) % 2 == 0:
	n = 0
	output = ''
	for a in i:
		if n < len(nice) / 2 and a in nice:
			output += 'A'
		else:
			output += 'B'
		if a in nice:
			n += 1
	print('YES')
	print(output)
else:
	move = None
	for a in counts:
		if counts[a] > 2:
			move = a
			break
	if move is None:
		print('NO')
	else:
		output = ''
		n = 0
		moved = 0
		for a in i:
			if a == move:
				if moved == 0:
					output += 'A'
					moved += 1
				else:
					output += 'B'
			elif n < len(nice) // 2:
				output += 'A'
			else:
				output += 'B'
			if a in nice:
				n += 1
		print('YES')
		print(output)


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


import sys
from array import array
from collections import Counter

def readline() -> str:
	return sys.stdin.buffer.readline().decode('utf-8')
n = int(readline())
a = list(map(int, readline().split()))
cnt = Counter(a)
ans = ['A'] * n
(nice_a, nice_b) = (0, 0)
dic = dict()
for (i, x) in enumerate(a):
	if cnt[x] == 1:
		if nice_a == nice_b:
			nice_a += 1
			ans[i] = 'A'
		else:
			nice_b += 1
			ans[i] = 'B'
	elif cnt[x] > 2:
		if x not in dic:
			dic[x] = []
		dic[x].append(i)
for (i, x) in enumerate(a):
	if cnt[x] == 2:
		cnt[x] = -2
	elif cnt[x] == -2:
		ans[i] = 'B'
for (i, key) in zip(range(len(dic.keys()) - 1, -1, -1), dic.keys()):
	if i == 0 and nice_a == nice_b:
		break
	if nice_a == nice_b:
		for j in dic[key][1:]:
			ans[j] = 'B'
		nice_a += 1
	else:
		ans[dic[key][0]] = 'B'
		nice_b += 1
if nice_a != nice_b:
	print('NO')
else:
	print('YES')
	print(*ans, sep='')


n = int(input())
ar = list(map(int, input().split()))
goodi = set()
has_more = -1
for (i, x) in enumerate(ar):
	if ar.count(x) == 1:
		goodi.add(i)
	elif ar.count(x) > 2:
		has_more = i
mask = [True for i in range(n)]
if len(goodi) % 2 == 0:
	print('YES')
	for i in list(goodi)[:len(goodi) // 2]:
		mask[i] = False
	for c in mask:
		print({True: 'A', False: 'B'}[c], end='')
	print()
elif has_more != -1:
	print('YES')
	for i in list(goodi)[:len(goodi) // 2]:
		mask[i] = False
	mask[has_more] = False
	for c in mask:
		print({True: 'A', False: 'B'}[c], end='')
	print()
else:
	print('NO')


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

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

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

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

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		n = ri()
		a = ria()
		d = Counter(a)
		na = list(set(a))
		t = 0
		nc = 0
		(A, B) = ({}, {})
		for i in na:
			if d[i] == 1:
				nc = 1
				if t == 0:
					A[i] = 1
				else:
					B[i] = 1
				t = 1 - t
		if nc == 0:
			print('YES')
			print('A' * n)
		elif len(A) == len(B):
			ans = ''
			for i in a:
				if i in B:
					ans += 'B'
				else:
					ans += 'A'
			print('YES')
			print(ans)
		else:
			m = -1
			for i in d:
				if d[i] >= 3:
					m = i
			if m == -1:
				print('NO')
			else:
				ans = ''
				u = 0
				for i in a:
					if i == m and u == 0:
						ans += 'B'
						u = 1
						continue
					if i in B:
						ans += 'B'
					else:
						ans += 'A'
				print('YES')
				print(ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


a = int(input())
ans = [0 for i in range(101)]
z = list(map(int, input().split()))
for i in range(len(z)):
	ans[z[i]] += 1
if ans.count(1) % 2 == 1:
	s = ''
	if len(z) - ans.count(1) - 2 * ans.count(2) == 0:
		print('NO')
	else:
		print('YES')
		flag = 0
		tra = 0
		for i in range(len(ans)):
			if ans[i] >= 3:
				break
		tra = i
		count = ans[tra]
		c1 = 0
		for i in range(len(z)):
			if ans[z[i]] == 1:
				if flag == 0:
					s += 'A'
					flag = 1
				else:
					s += 'B'
					flag = 0
			elif z[i] == tra:
				if c1 == count - 1:
					s += 'B'
				else:
					s += 'A'
				c1 += 1
			else:
				s += 'A'
		print(s)
else:
	print('YES')
	flag = 0
	s = ''
	for i in range(len(z)):
		if ans[z[i]] > 1:
			s += 'A'
		elif flag == 0:
			s += 'A'
			flag = 1
		else:
			s += 'B'
			flag = 0
	print(s)


n = int(input())
a = list(map(int, input().split()))
b = dict()
for x in a:
	b[x] = b.get(x, 0) + 1
A = dict()
B = dict()
cnta = 0
cntb = 0
for (k, v) in b.items():
	if v == 1:
		if cnta > cntb:
			cntb += 1
			B[k] = 1
		else:
			cnta += 1
			A[k] = 1
for (k, v) in b.items():
	if v == 2:
		A[k] = 2
	elif v > 1:
		if cnta > cntb:
			A[k] = v - 1
			B[k] = 1
			cntb += 1
		else:
			A[k] = v
if cnta == cntb:
	print('YES')
	for i in a:
		if A.get(i, 0) > 0:
			A[i] = A.get(i, 0) - 1
			print('A', end='')
		else:
			B[i] = B.get(i, 0) - 1
			print('B', end='')
else:
	print('NO')


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


cnt = [0 for i in range(101)]
n = int(input())
s = input().split()
l = [int(s[i]) for i in range(n)]
for i in l:
	cnt[i] += 1
small = 0
large = 0
for i in range(1, 101):
	if cnt[i] == 1:
		small += 1
	elif cnt[i] > 2:
		large += 1
		largenum = i
if small % 2 == 1 and large == 0:
	print('NO')
elif small % 2 == 1:
	print('YES')
	counter = 0
	flag = True
	for i in l:
		if cnt[i] == 1:
			print('AB'[counter % 2], end='')
			counter += 1
		elif i == largenum and flag:
			print('B', end='')
			flag = False
		else:
			print('A', end='')
	print('')
else:
	print('YES')
	counter = 0
	for i in l:
		if cnt[i] == 1:
			print('AB'[counter % 2], end='')
			counter += 1
		else:
			print('A', end='')
	print('')


n = int(input())
s = [int(i) for i in input().split(' ')]
from collections import Counter

def find_goods(s):
	c = Counter(s)
	good = set()
	for n in c:
		if c[n] == 1:
			good.add(n)
	return (good, c)
(goods, counter) = find_goods(s)

def has_cris(counter):
	for n in counter:
		if counter[n] > 2:
			return n
	return -1
if len(goods) % 2 == 1:
	chris = has_cris(counter)
	if chris == -1:
		print('NO')
	else:
		print('YES')
		chet = True
		res = []
		for n in s:
			if n in goods:
				if chet:
					res.append('A')
				else:
					res.append('B')
				chet = not chet
			elif n == chris:
				res.append('B')
				chris = -1.1
			else:
				res.append('A')
		print(''.join(res))
else:
	print('YES')
	chet = True
	res = []
	for n in s:
		if n in goods:
			if chet:
				res.append('A')
			else:
				res.append('B')
			chet = not chet
		else:
			res.append('B')
	print(''.join(res))


n = int(input())
a = list(map(int, input().split()))
cnt = [0] * 101
ans = []
x = 0
z = -1
for i in a:
	cnt[i] += 1
for i in range(101):
	if cnt[i] == 1:
		x += 1
	elif cnt[i] > 2:
		z = i
if x % 2 == 0:
	y = 1
	for i in range(n):
		if cnt[a[i]] == 1:
			if y <= x / 2:
				ans.append('A')
				y += 1
			else:
				ans.append('B')
		else:
			ans.append('A')
elif z == -1:
	exit(print('NO'))
else:
	y = 1
	mxcnt = 0
	for i in range(n):
		if cnt[a[i]] == 1:
			if y <= x // 2:
				ans.append('A')
				y += 1
			else:
				ans.append('B')
		elif a[i] == z:
			if mxcnt == 0:
				ans.append('A')
				mxcnt += 1
			else:
				ans.append('B')
		else:
			ans.append('B')
print('YES')
print(*ans, sep='')


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 sys import stdin, stdout
from bisect import bisect_left, bisect_right
from collections import defaultdict
import math
from fractions import Fraction as frac
from random import random
cin = stdin.readline

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

def var(type=int):
	return type(stdin.readline())

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

def readlist(type=int):
	return list(map(type, stdin.readline().split()))

def sorted_indexes(arr):
	return sorted(range(len(arr)), key=arr.__getitem__)

def printr(arr):
	[stdout.write(str(x) + ' ') for x in arr]
	cout('')

def find_lt(a, x):
	i = bisect_left(a, x)
	if i:
		return a[i - 1]
	raise ValueError

def find_gt(a, x):
	i = bisect_right(a, x)
	if i != len(a):
		return a[i]
	raise ValueError

def dist(x, y):
	return math.sqrt(x * x + y * y)

def binary_search(arr, x):
	i = bisect_left(arr, x)
	if i == len(arr) or arr[i] != x:
		return -1
	return i
MOD2 = 998244353
n = var()
arr = readlist()
mp = {}
for el in arr:
	if el in mp:
		mp[el] += 1
	else:
		mp[el] = 1
count = 0
oddcount = 0
for (key, val) in mp.items():
	if val == 1:
		count += 1
	elif val > 2:
		oddcount = key
color = {}
if count % 2 == 0:
	k = 0
	for (el, freq) in mp.items():
		if freq > 1:
			color[el] = 'A'
		else:
			if k + k < count:
				color[el] = 'A'
			else:
				color[el] = 'B'
			k += 1
	print('YES')
	for i in arr:
		print(color[i], end='')
elif count % 2 == 1 and oddcount > 0:
	k = 0
	xx = count // 2 + 1
	for (el, freq) in mp.items():
		if freq > 1:
			color[el] = 'A'
		else:
			if k < xx:
				color[el] = 'A'
			else:
				color[el] = 'B'
			k += 1
	print('YES')
	for i in arr:
		if i == oddcount:
			print('B', end='')
			oddcount = 0
		else:
			print(color[i], end='')
else:
	print('NO')


n = int(input())
numbers = list(map(int, input().split(' ')))
odd = 0
count = [0] * 101
three = 0
assign = ['A'] * (n + 1)
for number in numbers:
	count[number] += 1
	if count[number] == 1:
		odd += 1
	elif count[number] == 2:
		odd -= 1
	elif count[number] == 3 and (not three):
		three = number
assignToB = False
index = 1
if odd % 2 == 0:
	for number in numbers:
		if count[number] == 1:
			if assignToB:
				assign[index] = 'B'
			assignToB = not assignToB
		index += 1
elif three:
	assign[numbers.index(three) + 1] = 'B'
	for number in numbers:
		if count[number] == 1:
			if assignToB:
				assign[index] = 'B'
			assignToB = not assignToB
		index += 1
if odd & 1 and (not three):
	print('NO')
else:
	print('YES')
	print(''.join(assign[1:]))


from collections import Counter
n = int(input())
s = list(map(int, input().split()))
count = Counter(s)
count_1 = 0
count_2 = 0
for i in range(n):
	if count[s[i]] == 1:
		count_1 += 1
	if count[s[i]] == 2:
		count_2 += 1
if count_1 % 2 == 1 and count_1 + count_2 == n:
	print('NO')
else:
	print('YES')
	res = []
	cls = ['A', 'B']
	cur = 0
	if count_1 % 2 == 0:
		for i in range(n):
			if count[s[i]] == 1:
				res.append(cls[cur % 2])
				cur += 1
			else:
				res.append('B')
	else:
		need = True
		for i in range(n):
			if count[s[i]] == 1:
				res.append(cls[cur % 2])
				cur += 1
			elif need and count[s[i]] > 2:
				res.append('B')
				need = False
			else:
				res.append('A')
	print(''.join(res))


n = int(input())
s = list(map(int, input().split()))
str = [0 for i in range(n)]
count_ = [s.count(i) for i in s]
One_occur_index = [i for i in range(n) if s.count(s[i]) == 1]
Two_occur_index = [i for i in range(n) if s.count(s[i]) == 2]
many_occur_index = [i for i in range(n) if s.count(s[i]) >= 3]
if len(One_occur_index) % 2 and len(many_occur_index) == 0:
	print('NO')
else:
	for i in Two_occur_index:
		str[i] = 0
	for i in One_occur_index[0:len(One_occur_index) // 2]:
		str[i] = 1
	if len(One_occur_index) % 2:
		str[many_occur_index[0]] = 1
	output = ['A' if str[i] else 'B' for i in range(n)]
	print('YES')
	print(''.join(output))


n = int(input())
A = list(map(int, input().split()))
D = dict(((A[i], A.count(A[i])) for i in range(n)))
S = [''] * n
q = True
if list(D.values()).count(1) % 2:
	q = False
else:
	q = True
p = True
for k in D:
	if D[k] == 1:
		if p:
			S[A.index(k)] = 'A'
		else:
			S[A.index(k)] = 'B'
		p = not p
	if D[k] == 2:
		j = A.index(k)
		S[j] = 'A'
		j += 1
		j = j + A[j:].index(k)
		S[j] = 'B'
if not q:
	for k in D:
		if D[k] > 2:
			j = A.index(k)
			S[j] = 'B'
			for i in range(j + 1, n):
				if A[i] == k:
					S[i] = 'A'
			q = q = True
			break
if not q:
	print('NO')
	exit()
for i in range(n):
	if S[i] == '':
		S[i] = 'A'
print('YES')
print(''.join(S))


from sys import stdin, stdout

class Solve:

	def __init__(self):
		R = stdin.readline
		W = stdout.write
		n = int(input())
		a = [int(x) for x in R().split()]
		ans = ['A' for i in range(n)]
		check = {}
		auniq = buniq = 0
		for i in range(n):
			if a[i] not in check:
				check[a[i]] = 0
			check[a[i]] += 1
			if check[a[i]] == 1:
				auniq += 1
			elif check[a[i]] == 2:
				auniq -= 1
		for i in range(n):
			if auniq == buniq:
				W('YES\n')
				W(''.join(ans))
				return
			if check[a[i]] == 1 and auniq > buniq + 1:
				check[a[i]] = 0
				ans[i] = 'B'
				auniq -= 1
				buniq += 1
		for i in range(n):
			if auniq == buniq:
				W('YES\n')
				W(''.join(ans))
				return
			if check[a[i]] > 2:
				check[a[i]] = 2
				ans[i] = 'B'
				buniq += 1
		W('NO\n')

def main():
	s = Solve()
main()


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)


n = input()
a = list(map(int, input().split()))
d = {i: 0 for i in range(1, 101)}
for i in a:
	d[i] += 1
g = []
g2 = []
mg = []
for i in range(1, 101):
	if d[i] == 1:
		g.append(i)
	elif d[i] == 2:
		g2.append(i)
	elif d[i] > 2:
		mg.append(i)
if len(g) % 2:
	if len(mg):
		print('YES')
		flag1 = True
		flag2 = False
		for i in a:
			if i in g:
				if flag1:
					print('A', end='')
					flag1 = False
				else:
					print('B', end='')
					flag1 = True
			elif i in mg:
				if flag2:
					print('A', end='')
				else:
					print('B', end='')
					flag2 = True
			else:
				print('A', end='')
	else:
		print('NO')
else:
	print('YES')
	flag = False
	for i in a:
		if i in g:
			if flag:
				print('A', end='')
				flag = False
			else:
				print('B', end='')
				flag = True
		else:
			print('A', end='')


from sys import stdin
from collections import Counter
input = stdin.readline
n = int(input())
a = [int(x) for x in input().split()]
c = Counter(a)
single = []
multiple_value = -1
multiple_count = -1
for (value, count) in c.items():
	if count == 1:
		single.append(value)
	elif count >= 3 and multiple_value == -1:
		multiple_value = value
		multiple_count = count
if len(single) % 2 == 0:
	group_a = set(single[:len(single) // 2])
	ans = []
	for i in range(n):
		if a[i] in group_a:
			ans.append('A')
		else:
			ans.append('B')
	print('YES')
	print(*ans, sep='')
elif multiple_value != -1:
	group_a = set(single[:len(single) // 2])
	ans = []
	for i in range(n):
		if a[i] == multiple_value:
			if multiple_count == 1:
				ans.append('A')
			else:
				ans.append('B')
			multiple_count -= 1
		elif a[i] in group_a:
			ans.append('A')
		else:
			ans.append('B')
	print('YES')
	print(*ans, sep='')
else:
	print('NO')


n = int(input())
arr = list(map(int, input().split()))
d = {}
ans = ['A'] * n
for i in range(n):
	if arr[i] in d:
		d[arr[i]].append(i)
	else:
		d[arr[i]] = [i]
flag = False
s = 'A'
cnt = 0
sec_arr = []
for i in d.keys():
	if len(d[i]) == 1:
		cnt += 1
		a = d[i]
		if s == 'A':
			s = 'B'
			continue
		else:
			ans[a[0]] = s
			s = 'A'
	elif len(d[i]) > 2:
		sec_arr = d[i]
if cnt % 2 == 0:
	print('YES')
	print(''.join(ans))
elif cnt % 2 == 1 and len(sec_arr) > 0:
	print('YES')
	ans[sec_arr[0]] = 'B'
	print(''.join(ans))
else:
	print('NO')


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


import itertools
n = int(input())
s = list(map(int, input().split()))
if s == [s[0]] * n:
	print('YES')
	print('A' * n)
	exit()
three = 0
check = 0
for (k, v) in itertools.groupby(sorted(s)):
	vv = len(list(v))
	if vv == 1:
		check += 1
	elif vv >= 3:
		three += 1
if check % 2 == 1 and three == 0:
	print('NO')
	exit()
res = ''
flag = {}
index = 1
for (k, v) in itertools.groupby(sorted(s)):
	if len(list(v)) == 1:
		if index * 2 <= check:
			flag[k] = -1
		else:
			flag[k] = 1
		index += 1
for (k, v) in itertools.groupby(sorted(s)):
	if len(list(v)) >= 3:
		if check % 2 == 1:
			flag[k] = -1
			check += 1
		else:
			flag[k] = 2
for num in s:
	for (k, v) in itertools.groupby(sorted(s)):
		if k == num and len(list(v)) not in (0, 2):
			if flag[k] == -1:
				flag[k] = -2
				res += 'A'
			elif flag[k] == 1:
				flag[k] = 2
				res += 'B'
			elif flag[k] == -2:
				res += 'B'
			else:
				res += 'A'
			break
	else:
		res += 'A'
print('YES')
print(res)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().two()
mod = 1000000007
n = ii1()
arr = iia()
d = {}
for i in arr:
	d.setdefault(i, [0])[0] += 1
(one, other) = (set(), set())
for i in d:
	if d[i][0] == 1:
		one.add(i)
	elif d[i][0] > 2:
		other.add(i)
if len(one) % 2 and (not len(other)):
	print('NO')
else:
	if len(one) % 2:
		num = other.pop()
	flip = flag = False
	res = ''
	for i in arr:
		if i in one:
			if flip:
				flip = False
				res += 'B'
			else:
				flip = True
				res += 'A'
		elif len(one) % 2 and i == num:
			if not flag:
				res += 'B'
				flag = True
			else:
				res += 'A'
		else:
			res += 'A'
	print('YES')
	print(res)


n = int(input())
l = list(map(int, input().split()))
d = {}
for x in l:
	d[x] = d.get(x, 0) + 1
k = 0
k1 = 0
for x in d:
	if d[x] == 1:
		k += 1
	elif d[x] > 2:
		k1 += 1
if k % 2 != 0 and k1 == 0:
	print('NO')
	exit()
print('YES')
s = ''
p = False
if k % 2 != 0:
	p = True
for x in l:
	if d[x] == 1:
		if k % 2 == 0:
			s += 'A'
		else:
			s += 'B'
		k -= 1
	elif p and d[x] > 2:
		p = False
		s += 'A'
	else:
		s += 'B'
print(s)


from collections import Counter
from sys import stdin
n = int(input())
a = [int(x) for x in stdin.readline().split(' ')]
p = dict(Counter(a))
b = [x for (x, y) in p.items() if y == 1]
magic = -1
if len(b) % 2 != 0:
	c = [x for (x, y) in p.items() if y > 2]
	if not len(c):
		print('NO')
		exit(0)
	else:
		magic = c[0]
print('YES')
b = b[:len(b) // 2]
for x in a:
	if x in b or x == magic:
		if x == magic:
			magic = -1
		print('B', end='')
	else:
		print('A', end='')


from collections import Counter
c = Counter()
N = int(input())
s = list(map(int, input().split()))
one = 0
more = 0
for x in s:
	c[x] += 1
for x in c:
	if c[x] == 1:
		one += 1
	if c[x] > 2:
		more += 1
if one % 2 == 1 and more == 0:
	print('NO')
	exit(0)
now = 'A'
ans = ''
if one % 2 == 0:
	more = -1
ch = ''
sel = -1
for x in s:
	if c[x] == 1:
		ans = ans + now
		now = 'A' if now == 'B' else 'B'
	elif x == sel:
		ans = ans + ch
	elif c[x] > 2 and more > 0:
		more = -1
		sel = x
		ans = ans + now
		now = 'A' if now == 'B' else 'B'
		ch = now
	else:
		ans = ans + 'A'
print('YES')
print(ans)


from sys import stdin, stdout, exit

def sin():
	return stdin.readline().rstrip()

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

def printBS(li):
	if not li:
		return
	for i in range(len(li) - 1):
		stdout.write('%d ' % li[i])
	stdout.write('%d\n' % li[-1])
n = int(sin())
li = listInput()
dic = {}
for i in li:
	if i not in dic:
		dic[i] = 1
	else:
		dic[i] += 1
nice = [i for i in dic if dic[i] == 1]
if len(nice) % 2 == 1:
	alt = -1
	for i in dic:
		if dic[i] > 2:
			alt = i
			break
	if alt == -1:
		print('NO')
	else:
		(a, b) = (nice[:len(nice) // 2 + 1], nice[len(nice) // 2 + 1:])
		a = set(a)
		b = set(b)
		alt_done = False
		ans = ''
		for i in li:
			if i in a:
				ans += 'A'
			elif i in b:
				ans += 'B'
			elif i == alt and (not alt_done):
				ans += 'B'
				alt_done = True
			else:
				ans += 'A'
		print('YES')
		print(ans)
else:
	(a, b) = (nice[:len(nice) // 2], nice[len(nice) // 2:])
	a = set(a)
	b = set(b)
	ans = ''
	for i in li:
		if i in a:
			ans += 'A'
		else:
			ans += 'B'
	print('YES')
	print(ans)


s = input()
s = input()
s1 = s.split()
l = [int(i) for i in s1]
d = {}
for i in l:
	if i not in d:
		d[i] = 1
	else:
		d[i] = d[i] + 1
cnt = 0
for i in d:
	if d[i] == 1:
		cnt = cnt + 1
if cnt % 2 == 1:
	flag = 0
	for i in d:
		if d[i] >= 3:
			flag = 1
			break
	if flag == 0:
		print('NO')
	else:
		s = ''
		state = 0
		flag = 0
		for i in l:
			if d[i] >= 3 and flag == 0:
				s = s + 'B'
				flag = 1
			elif d[i] > 1:
				s = s + 'A'
			else:
				if state == 0:
					s = s + 'A'
				else:
					s = s + 'B'
				state = 1 - state
		print('YES')
		print(s)
else:
	print('YES')
	s = ''
	state = 0
	for i in l:
		if d[i] != 1:
			s = s + 'A'
		else:
			if state == 1:
				s = s + 'A'
			else:
				s = s + 'B'
			state = 1 - state
	print(s)


n = int(input())
a = [int(i) for i in input().split()]
freq = {}
for i in a:
	freq[i] = freq.get(i, 0) + 1
if sum((1 for i in freq if freq[i] == 1)) % 2 == 0:
	print('YES')
	counter = 0
	for i in a:
		if freq[i] == 1:
			print('A' if counter % 2 else 'B', end='', flush=False)
			counter += 1
		else:
			print('B', end='', flush=False)
	print()
elif any((freq[i] > 2 for i in freq)):
	print('YES')
	counter = 0
	single = 0
	for i in a:
		if freq[i] == 1:
			print('A' if counter % 2 else 'B', end='', flush=False)
			counter += 1
		elif freq[i] > 2 and (not single):
			print('A', end='', flush=False)
			single = True
		else:
			print('B', end='', flush=False)
	print()
else:
	print('NO')


n = int(input())
a = [int(s) for s in input().split()]
goodElems = 0
Scope = [0] * 101
Bscope = [False] * 101
for i in range(n):
	Scope[a[i]] += 1
for elem in Scope:
	if elem == 1:
		goodElems += 1
if goodElems == 0:
	print('YES')
	for i in range(n):
		print('A', end='')
elif goodElems % 2 == 0:
	print('YES')
	goodElems = goodElems // 2
	for i in range(n):
		if Scope[a[i]] == 1 and goodElems > 0:
			print('B', end='')
			goodElems -= 1
		else:
			print('A', end='')
else:
	s = ['A'] * n
	goodElemsAll = (goodElems + 1) // 2
	goodElemsA = 0
	goodElemsB = 0
	for i in range(len(a)):
		if Scope[a[i]] == 1 and goodElemsA != goodElemsAll:
			Scope[a[i]] -= 1
			s[i] = 'A'
			goodElemsA += 1
		elif Scope[a[i]] == 1 and goodElemsB != goodElemsAll:
			Scope[a[i]] -= 1
			s[i] = 'B'
			goodElemsB += 1
	for i in range(n):
		if Scope[a[i]] > 2:
			goodElemsB += 1
			s[i] = 'B'
			break
	if goodElemsA == goodElemsB:
		print('YES')
		print(''.join(s))
	else:
		print('NO')


n = int(input())
S = list(map(int, input().split()))
D = set(S)
nice = 0
dp = [0 for i in range(102)]
for i in D:
	if S.count(i) == 1:
		nice += 1
	dp[i] = S.count(i)
if nice % 2 == 0:
	d = 0
	s = ''
	for i in S:
		if dp[i] == 1 and d < nice // 2:
			s = s + 'A'
			d += 1
		elif dp[i] == 1 and d >= nice // 2:
			s = s + 'B'
		else:
			s = s + 'A'
	print('YES')
	print(s)
elif nice % 2 != 0 and len(S) > nice:
	d = 0
	flag = 0
	s = ''
	for i in S:
		if dp[i] == 1 and d < nice // 2:
			d += 1
			s = s + 'A'
		elif dp[i] == 1 and d >= nice // 2:
			d += 1
			s = s + 'B'
		elif dp[i] > 2 and flag == 0:
			s = s + 'A'
			flag = 1
		else:
			s = s + 'B'
	if flag == 0:
		print('NO')
	else:
		print('YES')
		print(s)
elif nice % 2 != 0 and len(S) == nice:
	print('NO')


from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = {}
b = defaultdict(list)
c = 0
ms = ['A', 'B']
w = [''] * n
k = l = A = B = 0
x = -1
for i in range(n):
	if a[i] in d:
		d[a[i]] += 1
	else:
		d[a[i]] = 1
	b[a[i]].append(i)
for i in d.keys():
	if d[i] == 1:
		c += 1
	elif d[i] > 2:
		x = i
if c % 2 == 0:
	print('YES')
	for i in d.keys():
		if d[i] > 1:
			for j in b[i]:
				w[j] = ms[k % 2]
			k += 1
		else:
			w[b[i][0]] = ms[l % 2]
			l += 1
	print(''.join(w))
elif x >= 0:
	print('YES')
	for i in d.keys():
		if d[i] > 1:
			if i == x:
				pass
			else:
				for j in b[i]:
					w[j] = ms[k % 2]
			k += 1
		else:
			w[b[i][0]] = ms[l % 2]
			if ms[l % 2] == 'A':
				A += 1
			else:
				B += 1
			l += 1
	for i in range(len(b[x]) - 1):
		if A > B:
			w[b[x][i]] = ms[0]
		else:
			w[b[x][i]] = ms[1]
	if A > B:
		w[b[x][-1]] = ms[1]
	else:
		w[b[x][-1]] = ms[0]
	print(''.join(w))
else:
	print('NO')


n = int(input())
a = list(map(int, input().split()))
b = [0] * 101
for i in a:
	b[i] += 1
k = 0
l = 0
for i in b:
	if i == 1:
		k += 1
	if i > 2:
		l += 1
t = False
s = ''
if k % 2 == 0 or (k % 2 == 1 and l > 0):
	t = True
if t:
	print('YES')
	if k % 2 == 0:
		k1 = 0
		for i in a:
			if b[i] == 1 and k1 < k // 2:
				s += 'A'
				k1 += 1
			else:
				s += 'B'
		print(s)
	else:
		k1 = 0
		flag = False
		for i in a:
			if b[i] == 1 and k1 < k // 2:
				s += 'A'
				k1 += 1
			elif b[i] > 2 and flag == False:
				s += 'A'
				flag = True
			else:
				s += 'B'
		print(s)
else:
	print('NO')


from collections import Counter

def read():
	return [int(v) for v in input().split()]

def main():
	n = read()[0]
	a = read()
	c = Counter(a)
	d = [[], []]
	k = 0
	for (i, v) in enumerate(a):
		if c[v] == 1:
			d[k].append(i)
			k = 1 - k
	if len(d[0]) != len(d[1]):
		m = c.most_common(1)[0]
		if m[1] > 2:
			l = a.index(m[0])
			d[k].append(a.index(m[0]))
			for i in range(m[1] - 1):
				l = a.index(m[0], l + 1)
				d[1 - k].append(l)
		else:
			print('NO')
			return
	print('YES')
	for i in range(n):
		if i in d[0] or not i in d[1]:
			c = 'A'
		else:
			c = 'B'
		print(c, end='')
main()


a = int(input())
b = list(map(int, input().split()))
c = [0] * 101
for i in b:
	c[i] += 1
k = 0
kk = 0
for j in range(1, 101):
	if c[j] == 1:
		k += 1
	if c[j] > 2:
		kk += 1
if k % 2 == 0:
	print('YES')
	l = 0
	for j in b:
		if c[j] == 1:
			if l < k // 2:
				print('A', end='')
				l += 1
			else:
				print('B', end='')
		else:
			print('B', end='')
elif kk == 0:
	print('NO')
else:
	print('YES')
	l = 0
	p = 0
	for j in b:
		if c[j] == 1:
			if l < k // 2:
				print('A', end='')
				l += 1
			else:
				print('B', end='')
		elif c[j] > 2:
			if p == 0:
				print('A', end='')
				p = 1
			else:
				print('B', end='')
		else:
			print('B', end='')


from collections import *
from sys import *

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

def flip(x):
	if x == 'A':
		return 'B'
	else:
		return 'A'
(n, a) = (int(input()), arr_inp())
c = Counter(a)
(ones, l, c_sort) = (list(c.values()).count(1), len(c), OrderedDict(reversed(c.most_common())))
if ones % 2 == 0:
	flag = 'A'
	print('YES')
	for i in a:
		if c[i] > 1:
			print('A', end='')
		else:
			print(flag, end='')
			flag = flip(flag)
elif l > ones and max(c.values()) > 2:
	(flag, flag2) = ('A', 0)
	for (i, j) in c_sort.items():
		if c_sort[i] == 1:
			c_sort[i] = flag
			flag = flip(flag)
		elif c_sort[i] == 2:
			c_sort[i] = flag
		elif c_sort[i] >= 3:
			if flag2:
				c_sort[i] = flag
			else:
				(flag2, c_sort[i]) = (1, [flag, flip(flag)])
				flag = flip(flag)
	flag = 0
	print('YES')
	for i in a:
		if c_sort[i] in ['A', 'B']:
			print(c_sort[i], end='')
		elif flag:
			print(c_sort[i][1], end='')
		else:
			flag = 1
			print(c_sort[i][0], end='')
else:
	print('NO')


def is_unique(a):
	global multi
	return True if multi.count(a) == 1 else False

def is_semiunique(a):
	global multi
	return True if multi.count(a) > 2 else False
n = int(input())
multi = list(map(int, input().split()))
uniques = []
semi_uniques = []
for i in range(n):
	if is_unique(multi[i]):
		uniques.append(i)
	elif is_semiunique(multi[i]):
		semi_uniques.append(i)
multi_ = ['B'] * len(multi)
x = len(uniques)
if x % 2 == 0:
	for i in uniques[:x // 2]:
		multi_[i] = 'A'
	print('YES')
	print(''.join(multi_))
elif not semi_uniques:
	print('NO')
else:
	for i in uniques[:x // 2]:
		multi_[i] = 'A'
	multi_[semi_uniques[0]] = 'A'
	print('YES')
	print(''.join(multi_))


n = int(input())
arr = [[0] * 2 for i in range(101)]
st = str(input()).split()
st = [int(i) for i in st]
for i in st:
	arr[int(i) - 1][0] += 1
one = 0
two = 0
more = 0
x = 0
y = 0
for i in range(101):
	if arr[i][0] == 1:
		one += 1
	elif arr[i][0] == 2:
		two += 1
		y += arr[i][0]
	elif arr[i][0] > 2:
		more += 1
		x += arr[i][0]
yes = 0
ll = 0
no = 0
odd = 0
even = 0
lp = 0
if one > 0:
	if one % 2 == 1:
		odd = 1
	else:
		even = 1
elif more >= 1 and two >= 0 and (one == 0):
	yes = 1
	ll = 1
	print('YES')
	aaa = x + y
	print('A' * aaa)
	lp = 1
yes = 0
no = 0
m = 0
mm = 0
t = 0
if even == 1:
	yes = 1
elif odd == 1:
	if more >= 1:
		yes = 1
		m = 1
elif more >= 2:
	yes = 1
	mm = 1
elif two >= 1:
	yes = 1
	t = 1
else:
	no = 1
f = 1
sa = ''
if yes == 1:
	if m == 0 and mm == 0 and (t == 0):
		f = 1
		for i in st:
			if arr[i - 1][0] == 1:
				if f == 1:
					sa += 'A'
					f = f % 2 + 1
				else:
					sa += 'B'
					f = f % 2 + 1
			elif arr[i - 1][0] >= 2:
				sa += 'A'
	elif m == 1:
		f = 1
		ff = 1
		for i in st:
			if arr[i - 1][0] == 1:
				if f == 1:
					sa += 'A'
					f = f % 2 + 1
				else:
					sa += 'B'
					f = f % 2 + 1
			elif arr[i - 1][0] > 2:
				if f == 1 and ff == 1:
					sa += 'B'
					ff = 2
				elif ff == 1:
					sa += 'B'
					ff = 3
				else:
					sa += 'A'
			elif arr[i - 1][0] == 2:
				sa += 'A'
	elif mm == 1:
		f = 1
		ff = 0
		for i in st:
			sa += 'A'
	elif t == 1:
		sa += 'AB' * two
if yes == 1 and lp == 0:
	print('YES')
	print(sa)
elif ll == 0:
	print('NO')


import math
import sys
from bisect import bisect_right, bisect_left, insort_right
from collections import Counter, defaultdict
from heapq import heappop, heappush
from itertools import accumulate
from sys import stdout
R = lambda : map(int, input().split())
n = int(input())
acc = [0] * 105
arr = list(R())
for i in arr:
	acc[i] += 1
(a, b, ac, bc) = ([0] * 105, [0] * 105, 0, 0)
for (i, x) in enumerate(acc):
	if x == 1:
		if ac > bc:
			b[i] += 1
			bc += 1
		else:
			a[i] += 1
			ac += 1
for (i, x) in enumerate(acc):
	if x > 1:
		if ac > bc:
			b[i] += 1
			a[i] += x - 1
			bc += 1
			ac += 1 if x == 2 else 0
		elif ac < bc:
			a[i] += 1
			b[i] += x - 1
			ac += 1
			bc += 1 if x == 2 else 0
		else:
			a[i] += x
if ac != bc:
	print('NO')
else:
	print('YES')
	for x in arr:
		if a[x]:
			print('A', end='')
			a[x] -= 1
		else:
			print('B', end='')
			b[x] -= 1


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


a = int(input())
l = list(map(int, input().split()))
g = 0
b = 0
m = [0 for i in range(max(l) + 1)]
for i in l:
	m[i] += 1
for i in m:
	if i == 1:
		g += 1
	elif i > 2:
		b += 1
if g % 2 != 0 and b == 0:
	print('NO')
else:
	print('YES')
	if g % 2 == 0:
		c = g / 2
		for i in range(len(l)):
			if m[l[i]] == 1 and c > 0:
				c -= 1
				print('A', end='')
			else:
				print('B', end='')
	else:
		c = g // 2
		f = True
		for i in range(len(l)):
			if m[l[i]] == 1 and c > 0:
				c -= 1
				print('A', end='')
			elif m[l[i]] >= 3 and f:
				f = not f
				print('A', end='')
			else:
				print('B', end='')


n = int(input())
v = list(map(int, input().split()))
f = [0 for x in range(1, 105)]
for x in v:
	f[x] = f[x] + 1
d = {}
next = 0
for i in range(1, 101):
	if f[i] == 1:
		if next == 0:
			d[i] = 0
		else:
			d[i] = 1
		next = next ^ 1
	elif f[i] == 2:
		d[i] = 1
if next == 1:
	for i in range(1, 101):
		if f[i] >= 3:
			d[i] = 2
			next = next ^ 1
			break
	if next != 0:
		print('NO')
		exit(0)
for i in range(1, 101):
	if i not in d:
		d[i] = 0
print('YES')
sol = []
for x in v:
	if d[x] == 0:
		sol.append('A')
	elif d[x] == 1:
		sol.append('B')
	else:
		sol.append('B')
		d[x] = 0
print(''.join(sol))


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())
y = list(map(int, input().split()))
y1 = []
d = {}
for i in y:
	if i not in d:
		d[i] = 1
	else:
		d[i] += 1
d1 = sorted(d.items(), key=lambda kv: kv[1])
count = f = 0
for i in d1:
	if i[1] == 1:
		count += 1
	elif i[1] >= 3 and f == 0:
		x1 = i[0]
		f = 1
if count % 2 != 0:
	if f == 0:
		print('NO')
	else:
		c = count
		for j in y:
			if d[j] == 1 and c % 2 == 0:
				y1.append('A')
				c -= 1
			elif d[j] == 1 and c % 2 != 0:
				y1.append('B')
				c -= 1
			elif j == x1 and f == 1:
				y1.append('A')
				f = 2
			else:
				y1.append('B')
		print('YES')
		for i in y1:
			print(i, end='')
else:
	c = count
	for j in y:
		if d[j] == 1 and c % 2 == 0:
			y1.append('A')
			c -= 1
		elif d[j] == 1 and c % 2 != 0:
			y1.append('B')
			c -= 1
		else:
			y1.append('A')
	print('YES')
	for i in y1:
		print(i, end='')


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


n = int(input())
l = list(map(int, input().split()))
ans = [0] * n
check = [0] * 101
for i in range(n):
	check[l[i]] += 1
once = 0
for i in range(101):
	if check[i] == 1:
		once += 1
keep = 1
if once % 2 == 0:
	print('YES')
	for i in range(n):
		if check[l[i]] == 1 and keep <= once // 2:
			ans[i] = 'A'
			keep += 1
		else:
			ans[i] = 'B'
	print(''.join(ans))
elif max(check) <= 2:
	print('NO')
else:
	keep = 1
	print('YES')
	convert = 0
	for i in range(1, 101):
		if check[i] > 2:
			convert = i
			break
	flag = 0
	for i in range(n):
		if check[l[i]] == 1 and keep <= once // 2:
			ans[i] = 'A'
			keep += 1
		elif l[i] == convert and flag == 0:
			ans[i] = 'A'
			flag = 1
		else:
			ans[i] = 'B'
	print(''.join(ans))


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


import sys
inf = float('inf')
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

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

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

def input():
	return sys.stdin.readline().strip()
n = int(input())
Arr = get_array()
mydict = dict()
for i in Arr:
	mydict[i] = mydict.get(i, 0) + 1
count_1 = 0
count_2 = 0
count_3 = 0
Arr1 = []
Arr2 = []
Arr3 = []
for i in mydict:
	if mydict[i] == 1:
		count_1 += 1
		Arr1.append(i)
	elif mydict[i] == 2:
		count_2 += 1
		Arr2.append(i)
	elif mydict[i] >= 3:
		count_3 += 1
		Arr3.append(i)
if count_1 & 1 and count_3 == 0:
	print('NO')
	exit(0)
if not count_1 & 1:
	result = []
	Arr_new = Arr1[:len(Arr1) // 2]
	Arr_new2 = Arr1[len(Arr1) // 2:]
	for i in Arr:
		if i in Arr_new:
			result.append('A')
		else:
			result.append('B')
elif count_1 & 1 and count_3 > 0:
	result = []
	Arr_new = Arr1[:len(Arr1) // 2]
	Arr_new2 = Arr1[len(Arr1) // 2:]
	Arr_new3 = Arr3[:1]
	for i in Arr:
		if i in Arr_new:
			result.append('A')
		elif i in Arr_new3:
			result.append('A')
			Arr_new3.remove(i)
		else:
			result.append('B')
print('YES')
print(''.join(result))


from collections import Counter, defaultdict
n = int(input())
s = list(map(int, input().split()))
counter = Counter(s)
strict = [i for (i, cnt) in counter.items() if cnt == 1]
stupid = [i for (i, cnt) in counter.items() if cnt == 2]
flex = [i for (i, cnt) in counter.items() if cnt > 2]
if len(strict) % 2 != 0 and (not flex):
	print('NO')
	exit(0)
print('YES')
dest = defaultdict(list)
for num in stupid:
	dest[num] = ['A'] * counter[num]
for num in flex:
	dest[num] = ['A'] * counter[num]
for (i, num) in enumerate(strict):
	dest[num] = ['A' if i % 2 else 'B']
if len(strict) % 2 != 0:
	dest[flex[0]] = ['A'] + ['B'] * (counter[flex[0]] - 1)
for num in s:
	print(dest[num].pop(), end='')
print()


n = int(input())
a = [int(x) for x in input().split()]
INDEX = {}
for k in set(a):
	INDEX[k] = []
for i in range(n):
	INDEX[a[i]].append(i)
add = 0
IS = True
pAns = [None] * n
one = 0
ONE1 = {True: [], False: []}
Over2 = {True: [], False: []}
for j in INDEX.values():
	t = len(j)
	if t > 2:
		add += 1
		Over2[IS].append(j)
	elif t == 1:
		add += 1
		one += 1
		ONE1[IS].append(j)
	pAns[j[0]] = IS
	IS = not IS if t != 2 else IS
	for l in range(1, t):
		pAns[j[l]] = IS
if add % 2 == 0:
	STRING = ''
	for x in pAns:
		if x:
			STRING += 'A'
		else:
			STRING += 'B'
	print('YES')
	print(STRING)
elif one == add:
	print('NO')
elif Over2[True] != []:
	pAns[Over2[True][0][0]] = False
	STRING = ''
	for x in pAns:
		if x:
			STRING += 'A'
		else:
			STRING += 'B'
	print('YES')
	print(STRING)
elif Over2[False] != [] and ONE1[True]:
	pAns[Over2[False][0][0]] = True
	pAns[ONE1[True][0][0]] = False
	STRING = ''
	for x in pAns:
		if x:
			STRING += 'A'
		else:
			STRING += 'B'
	print('YES')
	print(STRING)
else:
	print('NO')


N = int(input())
ls = list(map(int, input().split()))
nice = []
count = {}
for i in ls:
	if i in count:
		count[i] += 1
	else:
		count[i] = 1
for i in range(len(ls)):
	if count[ls[i]] == 1:
		nice.append(ls[i])
candidate = 0
for i in range(len(ls)):
	if count[ls[i]] > 2:
		candidate = ls[i]
if len(nice) % 2 and candidate == 0:
	print('NO')
elif len(nice) % 2:
	print('YES')
	result = []
	turn = 'A'
	for i in ls:
		if candidate == i:
			result.append('B')
		elif i in nice:
			if turn == 'A':
				turn = 'B'
			else:
				turn = 'A'
			result.append(turn)
		else:
			result.append('B')
	for i in range(len(ls)):
		if candidate == ls[i]:
			result[i] = 'A'
			break
	for i in result:
		print(i, end='')
	print()
else:
	print('YES')
	turn = 'A'
	for i in ls:
		if i in nice:
			if turn == 'A':
				turn = 'B'
			else:
				turn = 'A'
			print(turn, end='')
		else:
			print('B', end='')
	print()


def OutputforEven(timesDic, indexDic, goodKey, numOfsingles):
	list1 = []
	list2 = []
	singles = 0
	for (key, times) in timesDic.items():
		if times == 1:
			if singles < numOfsingles / 2:
				list1.extend(indexDic[key])
				singles += 1
			else:
				list2.extend(indexDic[key])
		else:
			list1.extend(indexDic[key])
	a = 'A'
	b = 'B'
	dict1 = {}
	dict2 = {}
	for elem in list1:
		dict1[elem] = a
	for elem in list2:
		dict2[elem] = b
	dict1.update(dict2)
	list1.extend(list2)
	listall = []
	for index in sorted(list1):
		listall.append(dict1[index])
	print(''.join(listall))
	return

def OutputforOdd(timesDic, indexDic, goodKey, numOfsingles):
	list1 = []
	list2 = []
	singles = 0
	for (key, times) in timesDic.items():
		if times == 1:
			if singles < numOfsingles // 2 + 1:
				list1.extend(indexDic[key])
				singles += 1
			else:
				list2.extend(indexDic[key])
		elif key == goodKey:
			list1.extend(indexDic[goodKey])
			last = list1.pop()
			list2.append(last)
		else:
			list1.extend(indexDic[key])
	a = 'A'
	b = 'B'
	dict1 = {}
	dict2 = {}
	for elem in list1:
		dict1[elem] = a
	for elem in list2:
		dict2[elem] = b
	dict1.update(dict2)
	list1.extend(list2)
	listall = []
	for index in sorted(list1):
		listall.append(dict1[index])
	print(''.join(listall))
	return
n = int(input())
arr = input().split()
timesDic = {}
indexDic = {}
for i in range(len(arr)):
	if arr[i] in timesDic:
		timesDic[arr[i]] += 1
		indexDic[arr[i]].append(i)
	else:
		timesDic[arr[i]] = 1
		indexDic[arr[i]] = [i]
numOfsingles = 0
goodKey = 0.5
for (key, times) in timesDic.items():
	if times == 1:
		numOfsingles += 1
	if times > 2 and goodKey == 0.5:
		goodKey = key
if numOfsingles & 1:
	if goodKey == 0.5:
		print('NO')
	else:
		print('YES')
		OutputforOdd(timesDic, indexDic, goodKey, numOfsingles)
else:
	print('YES')
	OutputforEven(timesDic, indexDic, goodKey, numOfsingles)


n = int(input())
l = list(map(int, input().strip().split()))
l1 = [0 for i in range(101)]
for i in l:
	l1[i] = l1[i] + 1
ans = ''
l2 = []
v = 0
for i in range(1, 101):
	if l1[i] == 1:
		l2.append(i)
	if l1[i] >= 3:
		v = i
if v != 0:
	if len(l2) % 2 == 1:
		l2.insert(0, v)
if len(l2) % 2 == 1:
	print('NO')
	exit(0)
d1 = {}
for i in range(1, 101):
	d1[i] = 'A'
d = 'A'
for i in l:
	if i in l2:
		ans = ans + d
		if l1[i] >= 3:
			if d == 'A':
				d1[i] = 'B'
			else:
				d1[i] = 'A'
		l2.remove(i)
		if d == 'A':
			d = 'B'
		else:
			d = 'A'
	else:
		ans = ans + d1[i]
print('YES')
print(ans)


n = int(input())
Set = list(map(int, input().split()))
Stat = [0] * 101
A = 0
B = 0
(a, b, c) = (0, 0, 0)
ans = ''
ch = False
for el in Set:
	Stat[el] += 1
for i in range(1, 101):
	if Stat[i] == 1:
		a += 1
	elif Stat[i] > 2:
		c += 1
elem = -1
if a % 2 == 0:
	print('YES')
	count = 1
	for el in Set:
		if Stat[el] == 1:
			if count <= a // 2:
				ans += 'A'
				count += 1
			else:
				ans += 'B'
		else:
			ans += 'B'
	print(ans)
elif c > 0:
	count = 1
	print('YES')
	for el in Set:
		if Stat[el] == 1:
			if count <= a // 2 + 1:
				ans += 'A'
				count += 1
			else:
				ans += 'B'
		elif Stat[el] > 2 and elem < 0:
			ans += 'B'
			elem = el
		elif el == elem:
			ans += 'A'
		else:
			ans += 'B'
	print(ans)
else:
	print('NO')


from collections import Counter

def solution(S):
	dict = Counter(S)
	distinct_nums = []
	extra_idx = []
	idx_nums = []
	for i in range(len(S)):
		if dict[S[i]] == 1:
			distinct_nums.append(S[i])
			idx_nums.append(i)
	if len(distinct_nums) % 2 == 1:
		sol = ['A'] * len(S)
		found = False
		for (k, v) in dict.items():
			if v > 2:
				extra_idx = [i for (i, x) in enumerate(S) if x == k]
				idx_nums.append(extra_idx[0])
				idx_nums.sort()
				found = True
				break
		if not found:
			return (False, None)
	sol = [''] * len(S)
	for i in range(len(S)):
		if i in idx_nums:
			if idx_nums.index(i) < len(idx_nums) / 2:
				sol[i] = 'B'
				if extra_idx:
					if i == extra_idx[0]:
						for y in range(len(extra_idx)):
							if y > 0:
								sol[extra_idx[y]] = 'A'
			else:
				sol[i] = 'A'
				if extra_idx:
					if i == extra_idx[0]:
						for y in range(len(extra_idx)):
							if y > 0:
								sol[extra_idx[y]] = 'B'
		elif i not in extra_idx:
			sol[i] = 'A'
	return (True, sol)
N = int(input())
S = [int(x) for x in input().split()]
if N == len(S):
	(solved, solution) = solution(S)
	if not solved:
		print('NO')
	else:
		print('YES')
		print(''.join((str(i) for i in solution)))
else:
	print('NO')


from collections import Counter
n = int(input())
a = [*map(int, input().split())]
b = Counter(a)
c = dict()
for (i, j) in b.items():
	c.setdefault(j, i)
d = list(b.values()).count(1)
t = d // 2
ans = str()
if not d & 1:
	print('YES')
	for i in a:
		if b[i] == 1 and t > 0:
			ans += 'A'
			t -= 1
		else:
			ans += 'B'
	print(ans)
else:
	if max(c.keys()) < 3:
		print('NO')
		exit(0)
	print('YES')
	tt = list(filter(lambda x: x >= 3, c))[0]
	done = True
	for i in a:
		if b[i] == 1 and t > 0:
			ans += 'A'
			t -= 1
		elif b[i] >= 3 and i == c[tt] and done:
			ans += 'A'
			done = False
		else:
			ans += 'B'
	print(ans)


n = int(input())
a = list(map(int, input().split()))
d = {}
m = 10000000000
count1 = 0
p = 0
t = 0
for i in a:
	d[i] = d.get(i, 0) + 1
	if d[i] < m:
		m = d[i]
if m >= 2:
	print('YES')
	print('A' * n)
else:
	s = 'A' * n
	for i in range(n):
		if d[a[i]] == 1 and count1 % 2 == 0:
			s = s[:i] + 'B' + s[i + 1:]
			count1 += 1
		elif d[a[i]] == 1:
			count1 += 1
	if count1 % 2 == 0:
		print('YES')
		print(s)
	else:
		for i in range(n):
			if d[a[i]] > 2:
				k = a[i]
				s = s[:i] + 'A' + s[i + 1:]
				t = 1
				break
		if t == 1:
			for p in range(i + 1, n):
				if a[p] == k:
					s = s[:p] + 'B' + s[p + 1:]
			print('YES')
			print(s)
		if t == 0:
			print('NO')


n = int(input())
y = list(map(int, input().split()))
arr = [0] * (100 + 1)
y1 = y.copy()
y1 = sorted(y1)
for i in y1:
	arr[i] += 1
x = count1 = 0
for i in arr:
	if i == 1:
		count1 += 1
	elif i > 2:
		x += 1
if count1 % 2 == 0:
	ans = []
	i = 0
	k = 0
	while i < n:
		if arr[y[i]] == 1:
			if k % 2 == 0:
				ans.append('A')
			else:
				ans.append('B')
			k += 1
		else:
			ans.append('A')
		i += 1
	print('YES')
	for i in ans:
		print(i, end='')
elif x > 0:
	last = 0
	last1 = 'A'
	ans = []
	i = 0
	k = 0
	flag = 0
	while i < n:
		if arr[y[i]] == 1:
			if k % 2 == 0:
				ans.append('A')
			else:
				ans.append('B')
			k += 1
		elif arr[y[i]] > 2 and flag == 0:
			if k % 2 == 0:
				ans.append('A')
			else:
				ans.append('B')
			k += 1
			flag = 1
			last = y[i]
			last1 = ans[-1]
		elif last == y[i]:
			if last1 == 'A':
				ans.append('B')
			else:
				ans.append('A')
		else:
			ans.append('A')
		i += 1
	print('YES')
	for i in ans:
		print(i, end='')
else:
	print('NO')


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 N():
	print('NO')

def Y():
	print('YES')
n = int(input())
a = list(map(int, input().split()))
memo = {}
for i in range(n):
	if a[i] not in memo:
		memo[a[i]] = 1
	else:
		memo[a[i]] += 1
if len(memo) == 1:
	for key in memo:
		if memo[key] == 1:
			N()
		elif memo[key] == 2:
			Y()
			print('AB')
		else:
			Y()
			print('A' * memo[key])
else:
	c1 = 0
	alter = 1
	found = 1
	for (key, value) in memo.items():
		if value == 1:
			if alter:
				memo[key] = ['A']
				alter = 0
			else:
				alter = 1
				memo[key] = ['B']
			c1 += 1
	if c1 % 2 == 1:
		found = 0
		for (key, value) in memo.items():
			if type(value) == int and value >= 3:
				found = 1
				memo[key] = ['A'] * value
				memo[key][0] = 'B'
				break
	if not found:
		N()
		exit(0)
	Y()
	for i in range(n):
		if type(memo[a[i]]) == int:
			print('A', end='')
		else:
			print(memo[a[i]][-1], end='')
			memo[a[i]].pop()


from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
c = 0
l = []
d = {}
d = Counter(a)
for i in d:
	if d[i] == 1:
		c = c + 1
		l.append(a.index(i))
if c % 2 != 0:
	f = 0
	for i in d:
		if d[i] > 2:
			y = a.index(i)
			f = 1
			break
	if f == 0:
		print('NO')
	else:
		print('YES')
		r = ['0'] * n
		x = int(len(l) / 2)
		for i in range(x):
			r[l[i]] = 'A'
		r[y] = 'A'
		for i in range(len(r)):
			if r[i] == '0':
				r[i] = 'B'
		print(''.join(r))
elif c == 0:
	print('YES')
	s = ''
	while len(s) < n:
		s = s + 'A'
	print(s)
else:
	print('YES')
	r = ['0'] * n
	x = int(len(l) / 2)
	for i in range(x):
		r[l[i]] = 'A'
	for i in range(len(r)):
		if r[i] == '0':
			r[i] = 'B'
	print(''.join(r))


import math as mt
import sys, string
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
n = I()
x = L()
d = defaultdict(int)
v = defaultdict(int)
ans = ['0'] * n
c = 0
y = []
w = 0
l = []
for i in x:
	l.append((i, w))
	w += 1
	d[i] += 1
	if d[i] >= 3 and v[i] == 0:
		v[i] = 1
		y.append(i)
l.sort(key=lambda x: x[0])
p = 0
a = []
b = []
for i in l:
	if v[i[0]] == 0 and p == 0:
		ans[i[1]] = 'A'
		p = 1
	elif v[i[0]] == 0 and p == 1:
		ans[i[1]] = 'B'
		p = 0
if p == 0:
	for i in range(n):
		if ans[i] == '0':
			ans[i] = 'A'
	print('YES')
	for i in ans:
		print(i, end='')
else:
	q = 1
	for i in range(n):
		if ans[i] == '0' and y[0] == x[i] and (q == 1):
			ans[i] = 'B'
			q = 0
		elif ans[i] == '0':
			ans[i] = 'A'
	if q:
		print('NO')
	else:
		print('YES')
		for i in ans:
			print(i, end='')
v.clear()
d.clear()


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())
s = list(map(int, input().split()))

def getstr(a):
	ans = ''
	for i in a:
		ans += i
	return ans
count = [0] * 101
ans = []
for i in range(n):
	count[s[i]] += 1
a = 0
b = 0
for i in range(101):
	if count[i] > 0:
		if count[i] == 1:
			a += 1
		elif count[i] > 2:
			b += 1
if a % 2 == 0:
	idx = 0
	for i in range(n):
		if count[s[i]] == 1:
			if idx == 1:
				ans.append('A')
			else:
				ans.append('B')
			idx = 1 - idx
		else:
			ans.append('A')
	print('YES')
	print(getstr(ans))
elif a % 2 == 1 and b > 0:
	ele = -1
	for i in range(n):
		if count[s[i]] > 2:
			ele = s[i]
			break
	done = False
	idx = 0
	for i in range(n):
		if count[s[i]] == 1:
			if idx == 1:
				ans.append('A')
			else:
				ans.append('B')
			idx = 1 - idx
		elif s[i] == ele:
			if not done:
				ans.append('A')
				done = True
			else:
				ans.append('B')
		else:
			ans.append('A')
	print('YES')
	print(getstr(ans))
else:
	print('NO')


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
int1 = lambda x: int(x) - 1
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
ilelec = lambda : map(int1, input().split())
alelec = lambda : list(map(int1, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
N = int(input())
A = alele()
mark = {}
C = Counter(A)
extra = -1
a = 0
b = 0
for i in range(N):
	if C[A[i]] == 1:
		if a <= b:
			a += 1
			mark[i] = 'A'
		else:
			b += 1
			mark[i] = 'B'
	elif C[A[i]] > 2:
		extra = A[i]
if a == b:
	Y(1)
	for i in range(N):
		print(mark.get(i, 'A'), end='')
elif extra == -1:
	Y(0)
else:
	ind = A.index(extra)
	mark[ind] = 'B'
	Y(1)
	for i in range(N):
		print(mark.get(i, 'A'), end='')


def main():
	n = int(input())
	s = list(map(int, input().split()))
	(cnt, flg) = ([0] * 101, [0] * 101)
	for i in s:
		cnt[i] += 1
	(nice, nice2) = ([], [])
	for i in range(101):
		if cnt[i] == 1:
			nice.append(i)
		elif 3 <= cnt[i]:
			nice2.append(i)
	if len(nice) % 2 and (not nice2):
		print('NO')
		exit()
	ans = ['A'] * n
	for i in range(len(nice) // 2):
		flg[nice[i]] = 1
	if len(nice) % 2:
		for i in range(n):
			if s[i] == nice2[0]:
				ans[i] = 'B'
				break
	for i in range(n):
		if flg[s[i]]:
			ans[i] = 'B'
	print('YES')
	print(''.join(ans))
main()


n = int(input())
a = list(map(int, input().split()))
counts = {}
for number in a:
	if number not in counts:
		counts[number] = 0
	counts[number] += 1
left = 0
right = 0
tags = ['A'] * n
for count in counts:
	if counts[count] == 1:
		left += 1
i = 0
for number in a:
	if counts[number] == 1 and left > right + 1:
		left -= 1
		right += 1
		tags[i] = 'B'
	i += 1
i = 0
for number in a:
	if counts[number] >= 3 and left > right:
		tags[i] = 'B'
		right += 1
		break
	i += 1
if left == right:
	print('YES')
	print(''.join(tags))
else:
	print('NO')


import sys

def rint():
	return map(int, sys.stdin.readline().split())
n = int(input())
s = list(rint())
set_type = []
type_num = 0
found_candi = 0
candi_index = -1
for i in range(n):
	if s.count(s[i]) == 1:
		type_num += 1
		set_type.append(1)
	elif found_candi == 0 and s.count(s[i]) >= 3:
		found_candi = 1
		candi_index = i
		set_type.append(2)
	else:
		set_type.append(0)
ans = []
type_cnt = 0
if type_num % 2 and found_candi == 0:
	print('NO')
else:
	print('YES')
	if type_num % 2:
		type_num += 1
	else:
		found_candi = 0
	for i in range(n):
		if found_candi:
			if i == candi_index:
				type_cnt += 1
				if type_cnt <= type_num // 2:
					ans.append('A')
				else:
					ans.append('B')
				continue
			elif s[i] == s[candi_index]:
				if ans[candi_index] == 'A':
					ans.append('B')
				else:
					ans.append('A')
				continue
		if set_type[i] == 0 or (found_candi == 0 and set_type[i] == 2):
			ans.append('A')
		elif set_type[i] == 1:
			type_cnt += 1
			if type_cnt <= type_num // 2:
				ans.append('A')
			else:
				ans.append('B')
	print(''.join(ans))


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())
a = list(map(int, input().split()))
count = [0 for _ in range(101)]
multisetA = [0 for _ in range(101)]
multiset = [[], []]
ans = ['YES', 'NO']
one = []
two = []
more = []
idex = 0
for v in a:
	count[v] += 1
for i in range(1, 101):
	if count[i] == 1:
		one.append(i)
	elif count[i] == 2:
		two.append(i)
	elif count[i] > 2:
		more.append(i)
l = len(one) + len(more)
lenOne = len(one)
if lenOne == 0:
	print(ans[0])
	for i in range(n):
		print('A', end='')
elif len(more) > 0 or lenOne % 2 == 0:
	if l % 2 == 1:
		more.pop(-1)
		l -= 1
	amount = l // 2
	if amount > lenOne:
		for num in one:
			multisetA[num] = 1
		need = amount - lenOne
		for i in range(need):
			multisetA[more.pop(0)] = 1
		for v in more:
			need = count[v] - 1
			multisetA[v] = need
	else:
		for v in one[:amount]:
			multisetA[v] = 1
		for v in more:
			need = count[v] - 1
			multisetA[v] = need
	for v in two:
		multisetA[v] = 1
	print(ans[0])
	for v in a:
		if multisetA[v]:
			multisetA[v] -= 1
			print('A', end='')
		else:
			print('B', end='')
else:
	print(ans[1])


def printf(strs):
	print(strs, end='')

def get_data(ls):
	power = 0
	data = {}
	more_than_two = False
	for i in ls:
		if i not in data:
			data[i] = 1
			power += 1
		else:
			if data[i] < 2:
				power -= 1
			data[i] += 1
			if data[i] > 2:
				more_than_two = True
	return {'power': power, 'data': data, 'more_than_two': more_than_two}
n = int(input())
lst = list(map(int, input().split()))
prev_group = 'A'
prev_inc = 'A'
power = get_data(lst)['power']
data = get_data(lst)['data']
if power % 2 == 1 and (not get_data(lst)['more_than_two']):
	print('NO')
else:
	print('YES')
	for i in range(n):
		if data[lst[i]] == 1:
			if prev_inc == 'A':
				prev_inc = 'B'
			else:
				prev_inc = 'A'
			printf(prev_inc)
		elif data[lst[i]] > 2 and power % 2 == 1:
			prev_group = prev_inc
			if prev_inc == 'A':
				prev_inc = 'B'
			else:
				prev_inc = 'A'
			printf(prev_inc)
			power += 1
			continue
		else:
			printf(prev_group)


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


import math as ma
import sys
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

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

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x

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

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = nu()
a = li()
s = [0] * 101
qq = [[] for y in range(101)]
for i in range(n):
	s[a[i]] += 1
	qq[a[i]].append(i)
c = 0
x = 0
o = 0
e = 0
for i in range(101):
	if s[i] == 0:
		continue
	if s[i] == 1:
		c += 1
	if s[i] > 1:
		x += 1
	if s[i] % 2 == 1:
		o += 1
	if s[i] % 2 == 0 and s[i] > 2:
		e += 1
o = o - c
if c == 0 and x > 0:
	print('YES')
	cc = 0
	ap = [0] * n
	for i in range(101):
		if s[i] == 0:
			continue
		if cc == 0:
			for j in range(len(qq[i])):
				ap[qq[i][j]] = 'A'
			cc = 1
		else:
			for j in range(len(qq[i])):
				ap[qq[i][j]] = 'A'
			cc = 0
	print(*ap, sep='')
elif c > 0 and x == 0:
	if c % 2 == 1:
		print('NO')
	else:
		print('YES')
		cc = 0
		ap = [0] * n
		for i in range(101):
			if s[i] == 0:
				continue
			if cc == 0:
				ap[qq[i][0]] = 'A'
				cc = 1
			else:
				ap[qq[i][0]] = 'B'
				cc = 0
		print(*ap, sep='')
elif c % 2 == 0:
	print('YES')
	cc = 0
	ap = [0] * n
	for i in range(101):
		if s[i] == 0:
			continue
		if s[i] > 1:
			for j in range(len(qq[i])):
				ap[qq[i][j]] = 'A'
		elif cc == 0:
			ap[qq[i][0]] = 'A'
			cc = 1
		else:
			ap[qq[i][0]] = 'B'
			cc = 0
	print(*ap, sep='')
elif o > 0 or e > 0:
	print('YES')
	cc = 0
	ap = [0] * n
	aq = 0
	if o > 0:
		aq = 1
	else:
		aq = 0
	kk = 0
	for i in range(101):
		if s[i] > 2 and s[i] % 2 == aq:
			kk = i
			ap[qq[i][0]] = 'B'
			for j in range(1, len(qq[i])):
				ap[qq[i][j]] = 'A'
			break
	for i in range(101):
		if s[i] == 0 or i == kk:
			continue
		if s[i] > 1:
			for j in range(len(qq[i])):
				ap[qq[i][j]] = 'A'
		elif cc == 0:
			ap[qq[i][0]] = 'A'
			cc = 1
		else:
			ap[qq[i][0]] = 'B'
			cc = 0
	print(*ap, sep='')
else:
	print('NO')


n = int(input())
lis = [int(x) for x in input().split()]
result = [-1 for _ in range(n)]
count = {}
for (j, i) in enumerate(lis):
	if i not in count:
		count[i] = []
	count[i].append(j)
turn = 1
isEven = True
for key in count.keys():
	li = count[key]
	le = len(li)
	if le == 1:
		result[li[0]] = turn
		turn = 1 if turn == 0 else 0
		isEven = False if isEven else True
	elif le == 2:
		for i in li:
			result[i] = 1
for key in count.keys():
	li = count[key]
	le = len(li)
	if le > 2:
		if isEven:
			for i in li:
				result[i] = 1
		else:
			result[li[0]] = turn
			turn = 1 if turn == 0 else 0
			isEven = True
			for i in li[1:]:
				result[i] = turn
if isEven:
	print('YES')
	for i in result:
		if i == 0:
			print('A', end='')
		else:
			print('B', 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='')


from collections import Counter, OrderedDict
from itertools import permutations as perm
from fractions import Fraction
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(n,) = gil()
a = gil()
idx = {}
one = 0
maxFreqVal = a[0]
for i in range(n):
	v = a[i]
	if v in idx:
		idx[v].append(i)
	else:
		idx[v] = [i]
for v in idx:
	if len(idx[v]) == 1:
		one += 1
	maxFreqVal = max(maxFreqVal, v, key=lambda x: len(idx[x]))
if one & 1 and len(idx[maxFreqVal]) <= 2:
	print('NO')
else:
	ans = ['A'] * n
	if one & 1:
		ans[idx[maxFreqVal].pop()] = 'B'
	print('YES')
	ch = 'A'
	for v in idx:
		if len(idx[v]) == 1:
			ans[idx[v][0]] = ch
			ch = 'B' if ch == 'A' else 'A'
	print(''.join(ans))


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


from collections import Counter

def main():
	_ = int(input())
	multiset = [int(c) for c in input().split()]
	cnt = Counter(multiset)
	appear_once = [k for (k, v) in cnt.items() if v == 1]
	appear_twice = [k for (k, v) in cnt.items() if v == 2]
	appear_morethan2 = [k for (k, v) in cnt.items() if v > 2]
	res_a = []
	res_b = []
	if len(appear_once) % 2 == 0:
		res_a += appear_once[:len(appear_once) // 2]
		res_b += appear_once[len(appear_once) // 2:]
		for e in appear_twice:
			res_a += [e for _ in range(cnt[e])]
		for e in appear_morethan2:
			res_a += [e for _ in range(cnt[e])]
	else:
		if not appear_morethan2:
			print('NO')
			return
		res_a += appear_once[:len(appear_once) // 2 + 1]
		res_b += appear_once[len(appear_once) // 2 + 1:]
		for e in appear_twice:
			res_a += [e for _ in range(cnt[e])]
		res_b.append(appear_morethan2[0])
		cnt[appear_morethan2[0]] -= 1
		for e in appear_morethan2:
			res_a += [e for _ in range(cnt[e])]
	res = []
	for e in multiset:
		if e in res_a:
			res.append('A')
			res_a.remove(e)
		else:
			res.append('B')
			res_b.remove(e)
	print('YES')
	print(''.join(res))
main()


import sys
import math
n = int(input())
l = list(map(int, input().split()))
d = dict()
for i in range(n):
	d[l[i]] = 0
for i in range(n):
	d[l[i]] += 1
p = 0
t = 0
for i in range(n):
	if d[l[i]] == 1:
		p += 1
	elif d[l[i]] > 2:
		t += 1
if p % 2 != 0 and t == 0:
	print('NO')
	sys.exit()
print('YES')
s = ''
c = 0
t1 = 0
for i in range(n):
	if d[l[i]] == 1 and c >= p // 2:
		s = s + 'A'
		c += 1
	elif d[l[i]] == 1 and c < p // 2:
		s = s + 'B'
		c += 1
	elif p % 2 != 0 and d[l[i]] > 2 and (t1 == 0):
		s = s + 'B'
		t1 = 1
	else:
		s = s + 'A'
print(s)


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())
arr = [int(x) for x in input().split()]
cnt = [0 for i in range(102)]
for x in arr:
	cnt[x] += 1
dp = [[[-1 for i in range(102)] for j in range(102)] for k in range(102)]
jawab = [-1 for i in range(102)]

def kucing(pos, nA, nB):
	global dp
	if dp[pos][nA][nB] == -1:
		if pos > 100:
			return nA == nB
		if cnt[pos] == 0:
			dp[pos][nA][nB] = kucing(pos + 1, nA, nB)
			return dp[pos][nA][nB]
		if cnt[pos] == 1 or cnt[pos] > 2:
			if cnt[pos] > 2 and kucing(pos + 1, nA, nB):
				jawab[pos] = 0
				dp[pos][nA][nB] = True
				return True
			elif kucing(pos + 1, nA + 1, nB):
				jawab[pos] = 1
				dp[pos][nA][nB] = True
				return True
			elif kucing(pos + 1, nA, nB + 1):
				jawab[pos] = 2
				dp[pos][nA][nB] = True
				return True
			else:
				dp[pos][nA][nB] = False
				return False
		elif kucing(pos + 1, nA, nB):
			jawab[pos] = 0
			dp[pos][nA][nB] = True
			return True
		elif kucing(pos + 1, nA + 1, nB + 1):
			jawab[pos] = 3
			dp[pos][nA][nB] = True
			return True
		else:
			dp[pos][nA][nB] = False
			return False
	else:
		return dp[pos][nA][nB]
if kucing(0, 0, 0):
	print('YES')
	for i in range(N):
		if jawab[arr[i]] == 0:
			print('A', end='')
		elif jawab[arr[i]] == 4:
			print('B', end='')
		elif jawab[arr[i]] == 1:
			print('A', end='')
			jawab[arr[i]] = 4
		elif jawab[arr[i]] == 2:
			print('B', end='')
			jawab[arr[i]] = 0
		elif jawab[arr[i]] == 3:
			print('B', end='')
			jawab[arr[i]] = 1
else:
	print('NO')


n = int(input())
s = [int(i) for i in input().split()]
k = [0 for i in range(101)]
flag = False
for i in s:
	k[i] += 1
	if k[i] > 2:
		flag = True
b = k.count(1) // 2
a = k.count(1) - b
if a == b:
	print('YES')
	for i in s:
		if k[i] == 1 and a != 0:
			print('A', end='')
			a -= 1
			k[i] -= 1
		elif k[i] == 1:
			print('B', end='')
			k[i] -= 1
		else:
			print('A', end='')
elif flag:
	print('YES')
	for i in s:
		if k[i] == 1 and a != 0:
			print('A', end='')
			a -= 1
			k[i] -= 1
		elif k[i] == 1:
			print('B', end='')
			k[i] -= 1
		elif k[i] > 2 and flag:
			print('B', end='')
			flag = False
		else:
			print('A', end='')
else:
	print('NO')


n = int(input())
a = [int(x) for x in input().split()]
d = {}
for x in a:
	if x in d:
		d[x] += 1
	else:
		d[x] = 1
kol = 0
kol1 = 0
for key in d:
	if d[key] == 1:
		kol += 1
	if d[key] > 2:
		kol1 += 1
if kol % 2 == 1 and kol1 == 0:
	print('NO')
	exit(0)
print('YES')
if kol % 2 == 0:
	ind = 0
	ind1 = 0
	for i in range(n):
		if d[a[i]] == 1:
			if ind == ind1:
				print('A', end='')
				ind += 1
			else:
				print('B', end='')
				ind1 += 1
		else:
			print('A', end='')
else:
	ind = 0
	ind1 = 0
	f = True
	res = -1
	pic = ''
	for i in range(n):
		if d[a[i]] == 1:
			if ind == ind1:
				print('A', end='')
				ind += 1
			else:
				print('B', end='')
				ind1 += 1
		elif d[a[i]] > 2 and f:
			f = False
			res = a[i]
			if ind == ind1:
				print('A', end='')
				ind += 1
				pic = 'B'
			else:
				print('B', end='')
				ind1 += 1
				pic = 'A'
		elif a[i] == res:
			print(pic, end='')
		else:
			print('A', end='')


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 = [int(_) for _ in input().split()]
cnt = {}
for x in set(a):
	cnt[x] = len([y for y in a if y == x])
one = []
more = []
for (x, c) in cnt.items():
	if c == 1:
		one.append(x)
	elif c >= 3:
		more.append(x)
oneset = set(one)
last = 'B'
first = True
ans = []
if more or len(one) % 2 == 0:
	print('YES')
	for x in a:
		if x in oneset:
			last = 'A' if last == 'B' else 'B'
			ans.append(last)
		elif more and x == more[0]:
			if first:
				if len(one) % 2 == 0:
					ans.append('A')
				else:
					ans.append('B')
				first = False
			else:
				ans.append('A')
		else:
			ans.append('A')
	print(''.join(ans))
else:
	print('NO')


n = int(input())
coun = {}
a = list(map(int, input().split()))
odin = 0
dva = 0
tre = 0
for ii in range(n):
	i = a[ii]
	if i not in coun:
		coun[i] = [ii]
		odin += 1
	elif len(coun[i]) == 1:
		coun[i].append(ii)
		odin -= 1
		dva += 1
	elif len(coun[i]) == 2:
		coun[i].append(ii)
		dva -= 1
		tre += 1
	else:
		coun[i].append(ii)
first = 0
second = 0
if odin == 0:
	print('YES')
	print('A' * n)
elif odin % 2 != 0 and tre == 0:
	print('NO')
else:
	print('YES')
	if odin % 2 == 0 and tre == 0:
		mode = 1
	elif odin % 2 == 0 and tre > 0:
		mode = 2
	elif odin % 2 == 1 and tre > 0:
		first_tre = False
		mode = 3
	for i in range(len(a)):
		if len(coun[a[i]]) == 2:
			a[i] = 'A'
		elif mode == 1:
			if first > second:
				second += 1
				a[i] = 'B'
			else:
				first += 1
				a[i] = 'A'
		elif mode == 2:
			if len(coun[a[i]]) >= 3:
				a[i] = 'A'
			elif first > second:
				second += 1
				a[i] = 'B'
			else:
				first += 1
				a[i] = 'A'
		elif len(coun[a[i]]) >= 3:
			if first_tre == False:
				first_tre = True
				if first < second:
					a[i] = 'A'
					last = 'B'
					first += 1
				else:
					a[i] = 'B'
					last = 'A'
					second += 1
			else:
				a[i] = last
		elif first > second:
			second += 1
			a[i] = 'B'
		else:
			first += 1
			a[i] = 'A'
	print(''.join(a))
if first != second:
	int('kill me')


n = int(input())
s = list(map(int, input().split()))
unik = []
dui = []
tinbeshi = []
for i in range(n):
	if s.count(s[i]) == 1:
		unik.append(s[i])
	elif s.count(s[i]) == 2:
		dui.append(s[i])
	else:
		tinbeshi.append(s[i])
dui = set(dui)
tin = list(set(tinbeshi))
if len(unik) % 2 == 1 and len(tin) == 0:
	print('NO')
elif len(unik) == 0:
	print('YES')
	for i in range(n):
		print('A', sep='', end='')
else:
	print('YES')
	if len(unik) % 2 == 0:
		flg = True
		cnt = 0
		for i in range(n):
			if s[i] in unik and flg:
				print('A', sep='', end='')
				cnt += 1
				if cnt == len(unik) / 2:
					flg = False
			else:
				print('B', sep='', end='')
	else:
		index = []
		for i in range(int((len(unik) + 1) / 2 - 1)):
			index.append(s.index(unik[i]))
		index.append(s.index(tin[0]))
		for i in range(n):
			if i in index:
				print('A', sep='', end='')
			else:
				print('B', sep='', end='')


n = int(input())
l = list(map(int, input().split()))
d = {}
for i in l:
	try:
		d[i] += 1
	except KeyError:
		d[i] = 1
nice = 0
gt2elem = -1
for i in d.keys():
	if d[i] == 1:
		nice += 1
	elif d[i] > 2:
		gt2elem = i
if nice % 2 == 0 or gt2elem != -1:
	x = 0
	ans = []
	for i in l:
		if d[i] == 1:
			ans.append('AB'[x])
			x = 1 - x
		elif nice % 2 == 1 and i == gt2elem:
			ans.append('B')
			gt2elem = -1
		else:
			ans.append('A')
	print('YES')
	print(''.join(ans))
else:
	print('NO')


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().strip())
a = [int(x) for x in input().strip().split(' ')]
d = {}
cng = 0
for i in range(n):
	if a[i] in d:
		d[a[i]] += 1
		if d[a[i]] > 2:
			cng = i
	else:
		d[a[i]] = 1
cnt1 = 0
cnt2 = 0
for i in d:
	if d[i] == 1:
		cnt1 += 1
	elif d[i] > 2:
		cnt2 += 1
if cnt1 % 2 == 0:
	dd = {}
	for i in d:
		if d[i] == 1:
			if cnt1 % 2 == 0:
				dd[i] = 'A'
			else:
				dd[i] = 'B'
			cnt1 -= 1
		else:
			dd[i] = 'A'
	print('YES')
	for i in range(n):
		print(dd[a[i]], end='')
elif cnt2 > 0:
	dd = {}
	d[a[cng]] -= 1
	a[cng] = 101
	d[101] = 1
	cnt1 += 1
	for i in d:
		if d[i] == 1:
			if cnt1 % 2 == 0:
				dd[i] = 'A'
			else:
				dd[i] = 'B'
			cnt1 -= 1
		else:
			dd[i] = 'A'
	print('YES')
	for i in range(n):
		print(dd[a[i]], end='')
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())
s1 = 0
s2 = 0
s = ['A'] * 101
dic = {}
lis = list(map(int, input().split()))
length = len(lis)
count = 0
flag = 0
backup = -1
for i in lis:
	dic[i] = dic.get(i, 0) + 1
for i in dic:
	if dic[i] == 1:
		count += 1
	if dic[i] > 2:
		flag = 1
		backup = i
if count % 2 == 1:
	if flag == 0:
		print('NO')
		exit()
lis2 = []
if count % 2 == 0:
	backup = -1
for i in dic:
	if dic[i] == 1:
		lis2.append(i)
if backup != -1:
	lis2.append(backup)
for i in lis2:
	if s1 == 0 or s1 == s2:
		s[i] = 'A'
		s1 += 1
		continue
	if s2 + 1 == s1:
		s[i] = 'B'
		s2 += 1
		continue
print('YES')
flag2 = 0
for i in lis:
	if i == backup and flag2 == 0:
		print(s[i], end='')
		flag2 = 1
		if s[i] == 'A':
			s[i] = 'B'
		else:
			s[i] = 'A'
		continue
	print(s[i], end='')


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


def solve():
	from collections import Counter as C
	n = int(input())
	s = list(map(int, input().split()))
	c = C(s)
	a = s[:]
	s = list(set(s))
	once = []
	fl = 0
	for i in s:
		if c[i] == 1:
			once.append(i)
		if c[i] > 2:
			fl = i
	if len(once) % 2 == 0:
		d = {}
		for i in once[:len(once) // 2]:
			d[i] = 'A'
		for i in once[len(once) // 2:]:
			d[i] = 'B'
		st = ''
		for i in a:
			st += d.get(i, 'A')
		print('YES')
		print(st)
	elif fl == 0:
		print('NO')
	else:
		d = {}
		for i in once[:len(once) // 2]:
			d[i] = 'A'
		for i in once[len(once) // 2:]:
			d[i] = 'B'
		st = ''
		for i in a:
			if fl == i:
				st += 'A'
				fl = 0
			else:
				st += d.get(i, 'B')
		print('YES')
		print(st)

def main():
	t = 1
	for _ in range(t):
		solve()
main()


n = map(int, input())
values = list(map(int, input().split()))
freq = {}
for v in values:
	if v not in freq:
		freq[v] = 0
	freq[v] += 1
single_ids = []
for v in freq:
	if freq[v] == 1:
		single_ids.append(v)
key_greater_than_2 = False
key = None
for v in freq:
	if freq[v] > 2:
		key_greater_than_2 = True
		key = v
		break
if len(single_ids) == len(values) and len(single_ids) % 2 == 1 or (len(single_ids) % 2 == 1 and (not key_greater_than_2)):
	print('NO')
else:
	print('YES')
	mapping = {}
	unique_count = 1
	for v in freq:
		if freq[v] == 1:
			mapping[v] = 'A' if unique_count <= len(single_ids) / 2 else 'B'
			unique_count += 1
		else:
			mapping[v] = 'A'
	answers = []
	filled = False
	for v in values:
		if v == key and len(single_ids) % 2 == 1:
			if not filled:
				answers.append('A')
				filled = True
			else:
				answers.append('B')
		else:
			answers.append(mapping[v])
	print(''.join(answers))


n = int(input())
arr = list(map(int, input().strip().split()))[:n]
from collections import Counter, defaultdict
store = Counter(arr)
mark = defaultdict(int)
rem = 0
sattire = -1
for (a, b) in store.items():
	if store[a] == 1:
		rem += b
	elif store[a] == 2:
		mark[a] = True
	else:
		sattire = a
if rem % 2 == 1 and sattire == -1:
	print('NO')
	exit(0)
if rem % 2 == 0:
	sattire = -1
print('YES')
flag = 0
ans = [''] * n
for i in range(n):
	if mark[arr[i]] == True:
		if store[arr[i]] % 2 == 0:
			ans[i] = 'A'
		else:
			ans[i] = 'B'
		store[arr[i]] -= 1
	elif store[arr[i]] == 1:
		if flag == 0:
			ans[i] = 'A'
		else:
			ans[i] = 'B'
		flag = flag ^ 1
	elif arr[i] == sattire:
		ans[i] = 'B'
		sattire = -1
	else:
		ans[i] = 'A'
	print(ans[i], end='')
print()


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 sys
n = int(sys.stdin.readline())
s = list(map(int, sys.stdin.readline().split()))
s1 = {}
print = sys.stdout.write
for i in range(n):
	if s[i] in s1:
		s1[s[i]].append(i)
	else:
		s1[s[i]] = [i]
s2 = [i for i in s1 if len(s1[i]) == 1]
ls2 = len(s2)
if ls2 % 2 == 1 and ls2 == n:
	print('NO\n')
else:
	ec = 0
	oc = 0
	v = -1
	if ls2 % 2 == 0:
		print('YES\n')
		ec = 1
	else:
		f = 0
		for i in s1:
			if len(s1[i]) > 2:
				v = i
				f = 1
				break
		if f == 0:
			print('NO\n')
		else:
			print('YES\n')
			oc = 1
	if ec == 1:
		s = ['A'] * n
		mid = ls2 // 2
		for i in s2[mid:]:
			s[s1[i][0]] = 'B'
		print(''.join(s) + '\n')
	elif oc == 1:
		s = ['A'] * n
		mid = ls2 // 2
		for i in s2[mid:]:
			s[s1[i][0]] = 'B'
		for i in s1[v][1:]:
			s[i] = 'B'
		print(''.join(s) + '\n')


import collections
n = int(input())
s = list(map(int, input().split()))
cn = collections.Counter(s)
ones = set()
triple = set()
for key in cn.keys():
	if cn[key] == 1:
		ones.add(key)
	if cn[key] >= 3:
		triple.add(key)
l_1 = len(ones)
l_3 = len(triple)
if l_1 % 2 != 0 and l_3 == 0:
	print('NO')
else:
	print('YES')
	st = ''
	for x in s:
		if x in ones and len(ones) > l_1 // 2 + l_1 % 2:
			st += 'B'
			ones.remove(x)
		elif l_1 % 2 != 0 and x in triple:
			st += 'B'
			triple.clear()
		else:
			st += 'A'
	print(st)


from collections import deque
n = int(input())
arr = list(map(int, input().split(' ')))
dic = {}
for i in arr:
	if i in dic:
		dic[i] += 1
	else:
		dic[i] = 1
seta = set()
setb = set()
a = 0
b = 0
dic_ans = {}
ones = set()
twos = set()
more = set()
for i in dic:
	if dic[i] == 1:
		ones.add(i)
	elif dic[i] == 2:
		twos.add(i)
	else:
		more.add(i)
for i in ones:
	if a < b:
		a += 1
		seta.add(i)
		dic_ans[i] = deque(['A'])
	elif b < a:
		b += 1
		setb.add(i)
		dic_ans[i] = deque(['B'])
	else:
		a += 1
		seta.add(i)
		dic_ans[i] = deque(['A'])
for i in twos:
	setb.add(i)
	dic_ans[i] = deque(['B', 'A'])
	seta.add(i)
	a += 1
	b += 1
for i in more:
	if a < b:
		a += 1
		seta.add(i)
		dic_ans[i] = deque(['A'])
		for k in range(dic[i] - 1):
			dic_ans[i].append('B')
	elif b < a:
		b += 1
		setb.add(i)
		dic_ans[i] = deque(['B'])
		for k in range(dic[i] - 1):
			dic_ans[i].append('A')
	else:
		seta.add(i)
		dic_ans[i] = deque()
		for k in range(dic[i]):
			dic_ans[i].append('A')
if a == b:
	ans = ''
	for i in arr:
		ans += dic_ans[i].pop()
	print('YES')
	print(ans)
else:
	print('NO')


from collections import Counter
n = int(input())
s = list(map(int, input().split()))
sm = Counter(s)
su = set()
for i in sm.keys():
	if sm[i] == 1:
		su.add(i)
j = -1
i = 0
while i < n and j == -1:
	if sm[s[i]] >= 3:
		j = i
	i += 1
if len(su) % 2 == 1:
	if j == -1:
		print('NO')
	else:
		print('YES')
		cnt = 0
		ch = ''
		i = 0
		while i < n:
			if s[i] in su and cnt < len(su) // 2 or i == j:
				ch += 'A'
				if i != j:
					cnt += 1
			else:
				ch += 'B'
			i += 1
		print(ch)
else:
	print('YES')
	cnt = 0
	ch = ''
	i = 0
	while i < n:
		if s[i] in su and cnt < len(su) // 2:
			ch += 'A'
			cnt += 1
		else:
			ch += 'B'
		i += 1
	print(ch)


from collections import Counter
n = int(input())
numbers = [i for i in input().split()]
dict = Counter(numbers)
count = 0
for (key, value) in dict.items():
	if value == 1:
		count += 1
if not count:
	print('YES')
	print('B' * n)
elif count % 2 == 0:
	print('YES')
	uniqe = [key for (key, value) in dict.items() if value == 1]
	len_uq_A = len(uniqe) // 2
	res_string = ''
	for i in numbers:
		if i in uniqe and len_uq_A > 0:
			res_string += 'A'
			len_uq_A -= 1
		else:
			res_string += 'B'
	print(res_string)
else:
	ok = False
	super_num = None
	for (key, value) in dict.items():
		if value >= 3:
			ok = True
			super_num = key
			break
	if ok:
		print('YES')
		uniqe = [key for (key, value) in dict.items() if value == 1]
		len_uq_A = len(uniqe) // 2 + 1
		res_string = ''
		for i in numbers:
			if i in uniqe and len_uq_A > 0:
				res_string += 'A'
				len_uq_A -= 1
				if i == super_num:
					del uniqe[-1]
			else:
				res_string += 'B'
		index = numbers.index(super_num)
		res_string = res_string.replace('A', 'B', 1)
		res_string = res_string[:index] + 'A' + res_string[index + 1:]
		print(res_string)
	else:
		print('NO')


def ip():
	return int(input())

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

def sar():
	return list(ipp())

def pars(a):
	print(''.join(list(map(str, a))))
	print('\r')

def parl(a):
	print('\r'.join(list(map(str, a))))
	print('\r')
T = 1
for _ in range(T):
	n = ip()
	d = {}
	cn = {}
	a = sar()
	for i in range(n):
		d[a[i]] = i
		if a[i] in cn:
			cn[a[i]] += 1
		else:
			cn[a[i]] = 1
	nice = 0
	for kk in cn:
		if cn[kk] == 1:
			nice += 1
	ans = ['-'] * n
	na = 0
	nb = 0
	p = 0
	for kk in cn:
		if p % 2 == 0:
			if cn[kk] == 1:
				ans[d[kk]] = 'A'
				p += 1
				na += 1
		elif cn[kk] == 1:
			ans[d[kk]] = 'B'
			p += 1
			nb += 1
		if cn[kk] == 2:
			ans[d[kk]] = 'A'
			inn = a.index(kk)
			ans[inn] = 'B'
			na += 1
			nb += 1
	for kk in cn:
		if cn[kk] > 2:
			if na > nb:
				ans[d[kk]] = 'B'
				nb += 1
				for i in range(0, d[kk]):
					if a[i] == kk:
						ans[i] = 'A'
			elif na < nb:
				ans[d[kk]] = 'A'
				na += 1
				for i in range(0, d[kk]):
					if a[i] == kk:
						ans[i] = 'B'
	for i in range(n):
		if ans[i] == '-':
			ans[i] = 'A'
	if na == nb:
		print('YES')
		pars(ans)
	else:
		print('NO')


from sys import stdin, stdout
n = int(stdin.readline())
vl = list(map(int, stdin.readline().split()))
sze = 110
(a, b) = ([], [])
used = [[] for i in range(sze)]
(cnta, cntb) = (0, 0)
for i in range(n):
	used[vl[i]].append(i)
used.sort(key=lambda x: len(x))
for i in range(sze):
	if len(used[i]) == 1:
		if cnta < cntb:
			a.append(used[i][0])
			cnta += 1
		else:
			b.append(used[i][0])
			cntb += 1
	elif len(used[i]) == 2:
		a.append(used[i][0])
		b.append(used[i][1])
		cnta += 1
		cntb += 1
	elif len(used[i]) > 2:
		if cnta == cntb:
			for j in range(len(used[i])):
				a.append(used[i][j])
		elif cnta < cntb:
			cnta += 1
			a.append(used[i][0])
			for j in range(1, len(used[i])):
				b.append(used[i][j])
		else:
			cntb += 1
			b.append(used[i][0])
			for j in range(1, len(used[i])):
				a.append(used[i][j])
if cnta == cntb:
	stdout.write('YES\n')
	ans = ['' for i in range(n)]
	for v in a:
		ans[v] = 'A'
	for v in b:
		ans[v] = 'B'
	stdout.write(''.join(ans))
else:
	stdout.write('NO\n')


from collections import Counter
n = int(input())
S = [int(i) for i in input().split()]
c = Counter(S)
V = list(c.values())
cnt1 = V.count(1)
cnt2 = V.count(2)
if cnt1 % 2 == 1 and cnt1 + cnt2 * 2 == n:
	print('NO')
	exit()
d = dict()
s = ['A', 'B']
i = 0
flag = cnt1 % 2 == 1
for (k, v) in c.items():
	if v == 1:
		d[k] = [s[i]]
		i = (i + 1) % 2
	elif flag and v >= 3:
		d[k] = ['B'] + ['A'] * (v - 1)
		flag = False
	else:
		d[k] = ['A'] * v
print('YES')
for s in S:
	print(d[s].pop(), end='')
print()


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


r = input
n = int(r())
a = [int(x) for x in r().split()]
cnt = [0] * (100 + 1)
A = []
B = []
res = ''
for i in a:
	cnt[i] += 1
for (i, j) in enumerate(a):
	if cnt[j] == 1:
		A.append(i)
	if cnt[j] > 2:
		B.append(i)
pr = [0] * (n + 1)
if len(A) % 2 == 0:
	len2 = len(A) // 2
	res = 'YES\n'
	for i in A[:len2]:
		pr[i] = 1
	for i in A[len2:]:
		pr[i] = 2
	for i in range(n):
		if pr[i] == 1:
			res += 'A'
		else:
			res += 'B'
else:
	res = 'YES\n'
	dupx = -1
	len2 = len(A) // 2 + 1
	for (i, j) in enumerate(a):
		if cnt[j] > 2:
			dupx = i
			break
	pr = [0] * (n + 1)
	if dupx == -1:
		res = 'NO\n'
	else:
		pr[dupx] = 1
		for i in A[:len2]:
			pr[i] = 2
		for i in A[len2:]:
			pr[i] = 1
		for i in range(n):
			if pr[i] == 1:
				res += 'B'
			else:
				res += 'A'
print(res)


n = int(input())
c = [0] * 101
a = [int(i) for i in input().split()]
for i in range(n):
	c[a[i]] += 1
if n == c.count(1) + c.count(2) * 2:
	if c.count(1) % 2 == 1:
		print('NO')
	else:
		print('YES')
		k = c.count(1) // 2
		for i in range(n):
			if c[a[i]] == 1:
				if k:
					k -= 1
					print('A', end='')
				else:
					print('B', end='')
			else:
				print('A', end='')
else:
	print('YES')
	if c.count(1) % 2 == 0:
		k = c.count(1) // 2
		for i in range(n):
			if c[a[i]] == 1:
				if k:
					k -= 1
					print('A', end='')
				else:
					print('B', end='')
			else:
				print('A', end='')
	else:
		d = 0
		k = c.count(1) // 2
		for i in range(n):
			if c[a[i]] == 1:
				if k:
					k -= 1
					print('A', end='')
				else:
					print('B', end='')
			elif not d and c[a[i]] > 2:
				print('A', end='')
				d = 1
			else:
				print('B', end='')


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


from collections import Counter
n = int(input())
s = list(map(int, input().split()))
c = Counter(s)
singles = [i for i in c if c[i] == 1]
multis = [i for i in c if c[i] > 2]
if len(singles) & 1 and (not multis):
	print('NO')
else:
	print('YES')
	(sin, mul) = (len(singles) // 2, len(singles) & 1)
	ans = ''
	for x in s:
		if mul and c[x] > 2:
			mul -= 1
			ans += 'A'
		elif sin and c[x] == 1:
			sin -= 1
			ans += 'A'
		else:
			ans += 'B'
	print(ans)


n = int(input())
s = list(map(int, input().split()))
s1 = {}
for i in range(n):
	if s[i] in s1:
		s1[s[i]].append(i)
	else:
		s1[s[i]] = [i]
s2 = [i for i in s1 if len(s1[i]) == 1]
ls2 = len(s2)
if ls2 % 2 == 1 and ls2 == n:
	print('NO')
else:
	ec = 0
	oc = 0
	v = -1
	if ls2 % 2 == 0:
		print('YES')
		ec = 1
	else:
		f = 0
		for i in s1:
			if len(s1[i]) > 2:
				v = i
				f = 1
				break
		if f == 0:
			print('NO')
		else:
			print('YES')
			oc = 1
	if ec == 1:
		s = ['A'] * n
		mid = ls2 // 2
		for i in s2[mid:]:
			s[s1[i][0]] = 'B'
		print(''.join(s))
	elif oc == 1:
		s = ['A'] * n
		mid = ls2 // 2
		for i in s2[mid:]:
			s[s1[i][0]] = 'B'
		for i in s1[v][1:]:
			s[i] = 'B'
		print(''.join(s))


from collections import defaultdict
n = int(input().rstrip())
s = list(map(int, input().rstrip().split(' ')))
items = defaultdict(int)
for element in s:
	items[element] += 1
noice = 0
potentialNoice = 0
for val in items.values():
	if val == 1:
		noice += 1
	elif val > 2:
		potentialNoice += 1
if noice % 2 == 0:
	print('YES')
	noiceA = 0
	for element in s:
		if noiceA < noice // 2:
			if items[element] == 1:
				print('A', end='')
				noiceA += 1
				continue
		print('B', end='')
elif potentialNoice:
	print('YES')
	noiceA = 0
	potentialNoiceA = 0
	for element in s:
		if noiceA < noice // 2:
			if items[element] == 1:
				print('A', end='')
				noiceA += 1
				continue
		if not potentialNoiceA:
			if items[element] > 2:
				print('A', end='')
				potentialNoiceA += 1
				continue
		print('B', end='')
else:
	print('NO')


n = int(input())
from collections import Counter
m = list(map(int, input().split()))
d = Counter(m)
k = 0
r = 0
for c in d:
	if d[c] == 1:
		k += 1
	if d[c] > 2:
		r += 1
if r == 0 and k % 2:
	print('NO')
else:
	s = ''
	if k % 2:
		l = (k - 1) // 2
		j = 1
	else:
		l = k // 2
		j = 0
	i = 0
	h = set()
	for i in range(n):
		if d[m[i]] == 1:
			if l > 0:
				l -= 1
				s += 'A'
			else:
				s += 'B'
		elif d[m[i]] > 2 and j > 0:
			if m[i] not in h:
				s += 'A'
				h.add(m[i])
				j -= 1
			else:
				s += 'B'
		else:
			s += 'B'
	print('YES')
	print(s)


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


def init():
	n = int(input())
	Str = input()
	a = list(map(int, str.split(Str)))
	return (n, a)

def main():
	(n, a) = init()
	cnt = [0 for x in range(105)]
	tot1 = 0
	tot2 = 0
	tot3 = 0
	for i in range(n):
		cnt[a[i]] += 1
		if cnt[a[i]] == 1:
			tot1 += 1
		if cnt[a[i]] == 2:
			tot1 -= 1
			tot2 += 1
		if cnt[a[i]] == 3:
			tot2 -= 1
			tot3 += 1
	if tot1 % 2 != 0 and tot3 == 0:
		print('NO')
		return
	if tot1 % 2 == 0:
		print('YES')
		for i in range(n):
			if cnt[a[i]] != 1:
				print('A', end='')
			else:
				if tot1 % 2 == 0:
					print('A', end='')
				else:
					print('B', end='')
				tot1 -= 1
	else:
		flag = 0
		print('YES')
		for i in range(n):
			if cnt[a[i]] > 2:
				if flag == 0:
					print('A', end='')
					flag = 1
				else:
					print('B', end='')
			if cnt[a[i]] == 2:
				print('A', end='')
			if cnt[a[i]] == 1:
				if tot1 % 2 == 1:
					print('B', end='')
				else:
					print('A', end='')
				tot1 -= 1
main()


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)


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
d = Counter(a)
c = 0
s = ['A'] * n
p = []
x = -1
for v in d:
	if d[v] == 1:
		c = c + 1
		p.append(v)
	elif d[v] > 2:
		x = v
if c % 2 == 0:
	print('YES')
	p = p[:c // 2]
	for u in p:
		q = a.index(u)
		s[q] = 'B'
	print(''.join(s))
elif x != -1:
	print('YES')
	p = p[:c // 2]
	p.append(x)
	for u in p:
		q = a.index(u)
		s[q] = 'B'
	print(''.join(s))
else:
	print('NO')


n = int(input())
S = list(map(int, input().split()))
LIST = [0 for i in range(101)]
for s in S:
	LIST[s] += 1
for i in range(len(LIST)):
	if LIST[i] == 2:
		LIST[i] = 0
	elif LIST[i] > 2:
		LIST[i] = 3
if sum(LIST) % 2 == 1 and (not 3 in LIST):
	print('NO')
else:
	if sum(LIST) % 2 == 1:
		LIST[LIST.index(3)] = 0
	for i in range(len(LIST)):
		if LIST[i] > 2:
			LIST[i] = 1
	APP = sum(LIST) // 2
	ANS = ''
	for s in S:
		if APP > 0 and LIST[s] == 1:
			ANS += 'A'
			APP -= 1
			LIST[s] = 'B'
		elif LIST[s] == 1:
			ANS += 'B'
			LIST[s] = 'A'
		elif LIST[s] == 'A':
			ANS += 'A'
		else:
			ANS += 'B'
	print('YES')
	print(ANS)


n = int(input())
s = list(map(int, input().split()))
cnt = [0] * 105
for i in range(n):
	cnt[s[i]] += 1
cnt_nice = 0
for i in range(105):
	if cnt[i] == 1:
		cnt_nice += 1
if cnt_nice % 2 == 0:
	print('YES')
	tmp = cnt_nice / 2
	res = ''
	for i in range(n):
		if cnt[s[i]] != 1 or (tmp > 0 and cnt[s[i]] == 1):
			res += 'A'
			if cnt[s[i]] == 1:
				tmp -= 1
		else:
			res += 'B'
	print(res)
else:
	flag = False
	key_num = 0
	for i in range(n):
		if cnt[s[i]] != 1 and cnt[s[i]] > 2:
			flag = True
			key_num = s[i]
			break
	if flag:
		print('YES')
		tmp = cnt_nice / 2
		res = ''
		flag_key = False
		for i in range(n):
			if flag_key and s[i] == key_num:
				res += 'A'
			elif flag_key == False and s[i] == key_num:
				res += 'B'
				flag_key = True
			elif cnt[s[i]] != 1 or (tmp > 0 and cnt[s[i]] == 1):
				res += 'A'
				if cnt[s[i]] == 1:
					tmp -= 1
			else:
				res += 'B'
		print(res)
	else:
		print('NO')


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

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

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

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
from collections import Counter
lens = read_int()
arrs = read_ints()
3
ans = ['A'] * lens
arrc = Counter(arrs)
a = sum([1 for x in arrs if arrc[x] == 1])
b = 0
for i in range(lens):
	if arrc[arrs[i]] == 1 and a > b + 1:
		ans[i] = 'B'
		a -= 1
		b += 1
for i in range(lens):
	if arrc[arrs[i]] > 2 and a == b + 1:
		ans[i] = 'B'
		b += 1
		break
if a == b:
	print('YES')
	print(''.join(ans))
else:
	print('NO')


n = int(input())
s = list(map(int, input().split()))
for x in range(0, len(s), +1):
	s[x] = [s[x], x]
s_ile = []
for x in range(0, n, +1):
	s_ile.append([0, 0])
s = sorted(s)
tmp_ile = 1
ile_p = 0
s_wyn = [0] * n
i1 = 0
iw = 0
ia = 0
ib = 0
r = False
bb = False
for x in range(0, len(s) - 1, +1):
	if s[x][0] == s[x + 1][0]:
		tmp_ile += 1
		s_ile[x][1] = s[x][1]
	else:
		s_ile[x][0] = tmp_ile
		s_ile[x][1] = s[x][1]
		tmp_ile = 1
s_ile[-1][0] = tmp_ile
s_ile[-1][1] = s[-1][1]
for x in range(len(s_ile) - 1, -1, -1):
	if s_ile[x][0] == 0:
		s_ile[x][0] = s_ile[x + 1][0]
c1 = 0
for x in range(0, len(s_ile), +1):
	if s_ile[x][0] == 1:
		i1 += 1
	if s_ile[x][0] > 2:
		iw += 1
if i1 % 2 == 1 and iw == 0:
	print('NO')
	exit(0)
if i1 % 2 == 1:
	r = True
if r == True:
	for x in range(0, len(s_ile), +1):
		if s_wyn[s_ile[x][1]] == 'A' or s_wyn[s_ile[x][1]] == 'B':
			continue
		if s_ile[x][0] == 1:
			if ia < ib:
				s_wyn[s_ile[x][1]] = 'A'
				ia += 1
			else:
				s_wyn[s_ile[x][1]] = 'B'
				ib += 1
			continue
		if s_ile[x][0] > 2 and bb == False:
			bb = True
			s_wyn[s_ile[x][1]] = 'A'
			ia += 1
			for z in range(x + 1, x + s_ile[x][0], +1):
				s_wyn[s_ile[z][1]] = 'B'
			continue
		s_wyn[s_ile[x][1]] = 'A'
else:
	for x in range(0, len(s_ile), +1):
		if s_ile[x][0] == 1:
			if ia < int(i1 / 2):
				s_wyn[s_ile[x][1]] = 'A'
				ia += 1
			else:
				s_wyn[s_ile[x][1]] = 'B'
				ib += 1
		else:
			s_wyn[s_ile[x][1]] = 'A'
for x in range(0, len(s_ile), +1):
	if s_ile[x][0] == 0 or s_ile[x][0] == 2:
		s_wyn[s_ile[x][1]] = 'B'
		continue
print('YES')
print(''.join(s_wyn))


input()
s = []
d = {}
unic = 0
more_2 = 0
for a in input().split():
	a = int(a)
	s.append(a)
	if a in d:
		d[a] += 1
		if d[a] == 2:
			unic -= 1
		else:
			more_2 += 1
	else:
		d[a] = 1
		unic += 1
if unic % 2 == 1 and more_2 == 0:
	print('NO')
else:
	print('YES')
	splt = unic % 2 == 1
	a_left = unic // 2
	for a in s:
		if d[a] == 1:
			if a_left > 0:
				print('A', end='')
				a_left -= 1
			else:
				print('B', end='')
		elif splt and d[a] > 2:
			print('A', end='')
			splt = False
		else:
			print('B', end='')
	print()


n = int(input())
qtt = {}
dst = {}
tab = []
out = [''] * n
monos = []
dulis = []
polis = []
inp = input().split(' ')
for i in range(n):
	s = inp[i]
	tab.append(s)
	if s in qtt:
		qtt[s] += 1
	else:
		qtt[s] = 1
		dst[s] = 'A'
for i in qtt:
	if qtt[i] == 1:
		monos.append(i)
	elif qtt[i] == 2:
		dulis.append(i)
	else:
		polis.append(i)
if len(monos) % 2 != 0 and len(polis) < 1:
	print('NO')
else:
	if len(monos) % 2 == 0:
		prcd = 0
		for i in monos:
			if prcd < len(monos) / 2:
				dst[i] = 'B'
			else:
				break
			prcd += 1
		charity = False
	else:
		prcd = 0
		for i in monos:
			if prcd < (len(monos) - 1) / 2:
				dst[i] = 'B'
			else:
				break
			prcd += 1
		for i in polis:
			charity = i
			break
	for i in range(len(tab)):
		if tab[i] == charity:
			out[i] = 'B'
			charity = False
		else:
			out[i] = dst[tab[i]]
	print('YES')
	for i in out:
		print(i, end='')


n = int(input())
l = [int(i) for i in input().split()]
from collections import Counter
c = Counter(l)
k = sum((c[i] == 1 for i in c))
if k == 0:
	print('YES')
	print('A' * n)
	exit()
elif k and k % 2 == 0:
	print('YES')
	cn = 0
	f = 0
	k = k // 2
	for i in range(n):
		if c[l[i]] == 1 and f == 0:
			print('A', end='')
			cn += 1
		elif c[l[i]] == 1 and f == 1:
			print('B', end='')
		else:
			print('A', end='')
		if cn == k:
			f = 1
elif sum((c[i] > 1 for i in c)) == 0:
	print('NO')
	exit()
else:
	li = list(c.values())
	m = max(li)
	if m == 2:
		print('NO')
		exit()
	print('YES')
	k = k // 2 + k % 2
	f = 0
	cn = 0
	karma = 0
	for i in range(n):
		if c[l[i]] == 1:
			if f == 0:
				print('A', end='')
				cn += 1
				if cn == k:
					f = 1
			else:
				print('B', end='')
		elif c[l[i]] == m:
			if karma == 0:
				print('B', end='')
				karma = 1
			else:
				print('A', end='')
		else:
			print('A', end='')


def main():
	n = int(input())
	a = list(map(int, input().split()))
	s = set()
	elem = -1
	for i in range(n):
		if a.count(a[i]) == 1:
			s.add(a[i])
		elif a.count(a[i]) >= 3:
			elem = a[i]
	if len(s) == 0:
		print('YES')
		for i in range(n):
			print('A', end='')
	elif len(s) % 2 == 0:
		print('YES')
		f = True
		for i in range(n):
			if a[i] in s:
				if f:
					print('A', end='')
					f = False
				else:
					print('B', end='')
					f = True
			else:
				print('A', end='')
	elif elem == -1:
		print('NO')
	else:
		print('YES')
		a1 = []
		a2 = []
		for i in range(len(s) // 2):
			a1.append(s.pop())
		a1.append(elem)
		for i in range(len(s)):
			a2.append(s.pop())
		c = 0
		for i in range(n):
			if a[i] == elem:
				if c == 0:
					print('A', end='')
					c += 1
				else:
					print('B', end='')
			elif a[i] in a1:
				print('A', end='')
			elif a[i] in a2:
				print('B', end='')
			else:
				print('A', end='')
main()


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


import sys
input = sys.stdin.buffer.readline

def solution():
	n = int(input())
	l = list(map(int, input().split()))
	d = [0] * 101
	for i in l:
		d[i] += 1
	cnt = 0
	ind = 0
	x = []
	flag = 0
	s = ''
	for i in range(101):
		if d[i] == 1:
			cnt += 1
			x.append(i)
		if d[i] > 2:
			ind = i
	if cnt % 2 != 0 and ind == 0:
		print('NO')
	else:
		print('YES')
		if cnt % 2 == 0:
			for i in range(n):
				if d[l[i]] == 1:
					if flag == 0:
						s += 'A'
						flag = 1
					else:
						s += 'B'
						flag = 0
				else:
					s += 'A'
		else:
			flag = 0
			fa = 0
			fb = 0
			f = 0
			for i in range(n):
				if d[l[i]] == 1:
					if flag == 0:
						s += 'A'
						flag = 1
					else:
						s += 'B'
						flag = 0
				elif l[i] == ind and f == 0:
					if flag == 0:
						s += 'A'
						fa = 1
						flag = 1
					else:
						s += 'B'
						fb = 1
						flag = 0
					f = 1
				elif l[i] == ind:
					if fa == 1:
						s += 'B'
					else:
						s += 'A'
				else:
					s += 'A'
	print(s)
solution()


n = int(input())
a = list(map(int, input().split()))
from collections import Counter
counter = Counter(a)
unique = set()
option = None
for k in counter:
	if counter[k] == 1:
		unique.add(k)
	elif counter[k] != 2:
		option = k
if len(unique) % 2 == 0:
	option = None
choices = 'AB'
choice = 0
result = ''
used_option = False
if option or len(unique) % 2 == 0:
	for value in a:
		if value == option:
			result += choices[1 - used_option]
			used_option = True
		elif value in unique:
			result = result + choices[choice]
			choice = (choice + 1) % 2
		else:
			result = result + 'B'
	print('YES')
	print(result)
else:
	print('NO')


n = int(input())
line = input()
list = [int(s) - 1 for s in line.split()]
count = [0 for i in range(0, 100)]
for x in list:
	count[x] = count[x] + 1
one = []
two = []
greater = []
first_greater = -1
for i in range(0, 100):
	c = count[i]
	if c == 1:
		one.append(i)
	elif c == 2:
		two.append(i)
	elif c > 2:
		greater.append(i)
		if first_greater == -1:
			first_greater = i
if len(one) % 2 == 0:
	print('YES')
	num = len(one) / 2
	c = 0
	for i in list:
		if count[i] == 1:
			if c < num:
				print('A', end='')
				c = c + 1
			else:
				print('B', end='')
		else:
			print('A', end='')
elif len(greater) != 0:
	print('YES')
	num = len(one) // 2
	c = 0
	for i in list:
		if count[i] == 1:
			if c < num:
				print('A', end='')
				c = c + 1
			else:
				print('B', end='')
		elif count[i] > 2:
			if i == first_greater:
				print('A', end='')
				first_greater = -1
			else:
				print('B', end='')
		else:
			print('B', end='')
else:
	print('NO')


n = int(input())
s = [int(i) for i in input().split()]
count = [0 for i in range(200)]
for i in range(n):
	count[s[i]] = count[s[i]] + 1
big = 0
total = 0
biggie = 0
for i in range(1, 101):
	if count[i] == 1:
		total = total + 1
	if count[i] > 2:
		big = big + 1
for i in range(n):
	if count[s[i]] > 2:
		biggie = i
if total % 2 == 0:
	print('YES')
	alternate = 0
	string = ''
	for i in range(n):
		if count[s[i]] == 1:
			if alternate == 0:
				string = string + 'A'
				alternate = 1
			else:
				string = string + 'B'
				alternate = 0
		else:
			string = string + 'B'
	print(string)
elif big == 0:
	print('NO')
else:
	print('YES')
	alternate = 0
	string = ''
	for i in range(n):
		if count[s[i]] == 1:
			if alternate == 0:
				string = string + 'A'
				alternate = 1
			else:
				string = string + 'B'
				alternate = 0
		elif i == biggie:
			string = string + 'B'
		else:
			string = string + 'A'
	print(string)


n = int(input())
p = [int(x) for x in input().split()]
a = [0 for i in range(101)]
type1 = []
type2 = []
resa = []
for i in p:
	a[i] += 1
for i in range(len(a)):
	if a[i]:
		if a[i] == 1:
			type1.append(i)
		if a[i] >= 3:
			type2.append(i)
if len(type1) % 2 == 0:
	print('YES')
	resa = type1[:len(type1) // 2]
	for i in range(len(p)):
		if p[i] in resa:
			print('A', end='')
		else:
			print('B', end='')
	print()
elif len(type2) >= 1:
	print('YES')
	resa = type1[:len(type1) // 2]
	resb = [type2[0]]
	f = 1
	for i in p:
		if i in resa:
			print('A', end='')
		elif i in resb and f:
			f = 0
			print('A', end='')
		else:
			print('B', end='')
else:
	print('NO')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	temp = Counter(a)
	both = 0
	single = 0
	more = 0
	for x in temp.values():
		if x == 2:
			both += 1
		elif x > 2:
			more += 1
		else:
			single += 1
	ans = ''
	if single % 2 == 0:
		chk = 1
		print('YES')
		for x in range(n):
			if temp[a[x]] >= 2:
				ans += 'B'
			elif chk == 1:
				ans += 'A'
				chk ^= 1
			else:
				ans += 'B'
				chk ^= 1
		print(ans)
	elif more >= 1:
		print('YES')
		added = 0
		chk = 1
		for x in range(n):
			if temp[a[x]] > 2 and added == 0:
				ans += 'B'
				added = 1
			elif temp[a[x]] >= 2:
				ans += 'A'
			elif chk == 1:
				ans += 'A'
				chk ^= 1
			else:
				ans += 'B'
				chk ^= 1
		print(ans)
	else:
		print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


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


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
l = il()
l1 = [0] * 101
lans = ['A'] * n
for i in l:
	l1[i] += 1
c1 = 0
c3 = 0
for i in l1:
	if i == 1:
		c1 += 1
	elif i > 2:
		c3 += 1
if c1 & 1:
	if not c3 > 0:
		print('NO')
		exit(0)
	else:
		for i in range(101):
			if l1[i] > 2:
				x = l.index(i)
				lans[x] = 'B'
				break
c1 = 0
for i in l:
	if l1[i] == 1:
		c1 += 1
		if c1 % 2 == 0:
			x = l.index(i)
			lans[x] = 'B'
print('YES')
print(''.join(lans))


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

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

def rdi():
	return int(input())
n = rdi()
line = rlist()
cnt = [0] * 101
once = 0
triple_ind = 0
triple = 0
for elem in line:
	cnt[elem] += 1
	if cnt[elem] == 1:
		once += 1
	elif cnt[elem] == 2:
		once -= 1
	elif cnt[elem] == 3:
		triple = 1
if once % 2 == 0:
	print('YES')
	k = 0
	gg = ['A', 'B']
	for elem in line:
		if cnt[elem] == 1:
			print(gg[k], end='')
			k = (k + 1) % 2
		else:
			print('A', end='')
elif triple == 1:
	print('YES')
	k = 0
	gg = ['A', 'B']
	d = 'A'
	for elem in line:
		if cnt[elem] == 1:
			print(gg[k], end='')
			k = (k + 1) % 2
		elif triple == 1 and cnt[elem] >= 3:
			print(gg[k], end='')
			k = (k + 1) % 2
			triple = 0
			d = gg[k]
		elif cnt[elem] >= 3:
			print(d, end='')
		else:
			print('A', end='')
else:
	print('NO')


n = int(input())
s = list(map(int, input().split()))
f = dict()
for si in s:
	if si in f:
		f[si] += 1
	else:
		f[si] = 1
nice = set()
for k in f:
	if f[k] == 1:
		nice.add(k)
found = True
toChange = -1
if len(nice) % 2 != 0:
	found = False
	for k in f:
		if f[k] >= 3:
			toChange = k
			found = True
			break
nicelength = len(nice)
if not found:
	print('NO')
else:
	print('YES')
	ans = []
	for si in s:
		if si in nice:
			if len(nice) <= nicelength // 2:
				ans.append('A')
			else:
				ans.append('B')
			nice.remove(si)
		elif si == toChange:
			ans.append('A')
			toChange = -1
		else:
			ans.append('B')
	print(''.join(ans))


n = int(input())
a = [int(x) for x in input().split()]
m = {}
for aa in a:
	if aa in m:
		m[aa] += 1
	else:
		m[aa] = 1
count = 0
trick = False
for k in m:
	if m[k] == 1:
		count += 1
	elif m[k] > 2:
		trick = True
if count % 2 == 1:
	if trick:
		count += 1
	else:
		print('NO')
		exit()
else:
	trick = False
print('YES')
count = count / 2
r = []
for aa in a:
	if m[aa] == 1:
		if count > 0:
			r.append('A')
			count -= 1
		else:
			r.append('B')
	elif m[aa] == 2:
		r.append('A')
	elif trick:
		r.append('B')
		trick = False
	else:
		r.append('A')
print(''.join(r))


n = int(input())
s = list(map(int, input().split()))
res = ['A'] * n
(type1, type3) = ([], [])
w = list(set(s))
for v in w:
	indices = [i for (i, x) in enumerate(s) if x == v]
	if len(indices) == 1:
		type1.append(indices[0])
	elif len(indices) > 2:
		for i in range(len(indices)):
			type3.append((v, indices[i]))
(count_a, count_b) = (0, 0)
for i in range(len(type1)):
	if count_a > count_b:
		res[type1[i]] = 'B'
		count_b += 1
	else:
		count_a += 1
if count_a > count_b and len(type3) != 0:
	res[type3[0][1]] = 'B'
	count_b += 1
if count_a == count_b:
	print('YES')
	print(''.join(res))
else:
	print('NO')


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


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
l = I()
ans = []
char = 'A'
d = {'A': 0, 'B': 0}
cs = [0] * 105
for i in l:
	cs[i] += 1
for i in l:
	if cs[i] == 1:
		d[char] += 1
		ans.append(char)
		char = 'B' if char == 'A' else 'A'
	else:
		ans.append('A')
if d['A'] == d['B']:
	print('YES')
	print(*ans, sep='')
	exit()
fuc = 0
for i in range(1, 101):
	if cs[i] > 2:
		fuc = i
		break
if not fuc:
	print('NO')
	exit()
for i in range(n):
	if l[i] == fuc:
		ans[i] = 'B'
		break
print('YES')
print(*ans, sep='')


n = int(input())
b = list(map(int, input().split()))
d = dict()
for j in range(n):
	if b[j] in d.keys():
		d[b[j]] += 1
	else:
		d[b[j]] = 1
p = 0
q = -1
for j in range(n):
	if d[b[j]] == 1:
		p += 1
	elif d[b[j]] > 2:
		q = j
r = 0
c = ['A'] * n
if p % 2 == 0:
	for j in range(n):
		if d[b[j]] == 1:
			if r % 2 == 0:
				c[j] = 'A'
			else:
				c[j] = 'B'
			r += 1
		else:
			c[j] = 'A'
	print('YES')
	print(''.join(c))
elif p % 2 != 0:
	if q == -1:
		print('NO')
	else:
		for j in range(n):
			if d[b[j]] == 1:
				if r % 2 == 0:
					c[j] = 'A'
				else:
					c[j] = 'B'
				r += 1
			else:
				c[j] = 'A'
		c[q] = 'B'
		print('YES')
		print(''.join(c))


n = int(input())
lst = [*map(int, input().split())]
d = {}
for (i, x) in enumerate(lst):
	if d.get(x) == None:
		d[x] = 0
	d[x] += 1
(one, item, res) = (0, -1, [])
for (i, x) in enumerate(d):
	if d[x] == 1:
		one += 1
		res.append(x)
	if d[x] > 2:
		item = x
result = ['A'] * n
if one % 2 == 0:
	for (i, x) in enumerate(res[:one // 2]):
		result[lst.index(x)] = 'B'
	print('YES')
	print(''.join(result))
elif item == -1:
	print('NO')
else:
	for (i, x) in enumerate(res[:one // 2]):
		result[lst.index(x)] = 'B'
	result[lst.index(item)] = 'B'
	print('YES')
	print(''.join(result))


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


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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 main():
	n = int(input())
	s = list(map(int, input().split()))
	d = collections.Counter(s)
	ans = [''] * n
	x = 0
	for i in range(n):
		if d[s[i]] == 1:
			if x % 2 == 0:
				ans[i] = 'A'
			else:
				ans[i] = 'B'
			x += 1
	if x & 1 == 0:
		print('YES')
		for i in range(n):
			if d[s[i]] > 1:
				ans[i] = 'B'
		print(''.join(ans))
		return
	f = False
	for i in range(n):
		if d[s[i]] > 2 and (not f):
			f = True
			tmp = 0
			ans[i] = 'B'
		if ans[i] == '':
			ans[i] = 'A'
	if f:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')
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())
si = list(map(int, input().split()))
nums = [0] * 101
for i in range(n):
	nums[si[i]] += 1
num1 = 0
numnot12 = 0
for i in range(101):
	num1 += int(nums[i] == 1)
	numnot12 += int(nums[i] > 2)
if numnot12 == 0 and num1 % 2 == 1:
	print('NO')
else:
	print('YES')
	num2 = num1 % 2
	num1 //= 2
	for i in range(n):
		if nums[si[i]] == 1:
			if num1 > 0:
				print('A', end='')
				num1 -= 1
			else:
				print('B', end='')
		elif nums[si[i]] > 2:
			if num2 > 0:
				nums[si[i]] = 2
				print('A', end='')
				num2 -= 1
			else:
				print('A', end='')
		else:
			print('B', end='')


def swap(s, a, m):
	s = s[0:a:1] + m + s[a + 1:len(s):1]
	return s
i = int(input())
s = [int(k) for k in input().split()]
import collections
d = collections.Counter()
p = 0
z = 0
x = 0
e = []
r = -1
for t in s:
	u = []
	for m in range(0, len(s)):
		if s[m] == t:
			u.append(m)
	if len(u) == 1:
		e.append(t)
		p += 1
		z = 1
	elif len(u) >= 3:
		x = 1
		r = t
	d[t] = tuple(u)
y = '0' * i
if p == 0:
	print('YES')
	print('A' * i)
elif x == 0 and p % 2 != 0:
	print('NO')
else:
	print('YES')
	if p % 2 == 0:
		for w in range(0, len(e)):
			if w % 2 == 0:
				y = swap(y, d[e[w]][0], 'A')
			else:
				y = swap(y, d[e[w]][0], 'B')
		for b in range(0, len(y)):
			if y[b] == '0':
				y = swap(y, b, 'A')
		print(y)
	else:
		for w in range(0, len(e)):
			if w % 2 == 0:
				y = swap(y, d[e[w]][0], 'A')
			else:
				y = swap(y, d[e[w]][0], 'B')
		y = swap(y, d[r][-1], 'B')
		for b in range(0, len(y)):
			if y[b] == '0':
				y = swap(y, b, 'A')
		print(y)


n = int(input())
l = list(map(int, input().split()))
c = ['c'] * n
d = {}
for i in l:
	if i in d:
		d[i] = d[i] + 1
	else:
		d[i] = 1
t1 = 0
c1 = 0
tl = []
cl = []
for i in d:
	if d[i] == 1:
		t1 += 1
		tl.append(i)
	if d[i] > 2:
		c1 += 1
		cl.append(i)
if t1 % 2 == 1 and c1 == 0:
	print('NO')
elif t1 % 2 == 0:
	cnt = 0
	s = set()
	for i in tl:
		x = l.index(i)
		if cnt < t1 // 2:
			c[x] = 'A'
		else:
			c[x] = 'B'
		cnt = cnt + 1
		s.add(x)
	for i in range(len(c)):
		if i not in s:
			c[i] = 'B'
	print('YES')
	print(''.join(c))
else:
	cnt = 0
	s = set()
	for i in tl:
		x = l.index(i)
		if cnt < t1 // 2:
			c[x] = 'A'
		else:
			c[x] = 'B'
		cnt = cnt + 1
		s.add(x)
	e = cl[0]
	x = l.index(e)
	c[x] = 'A'
	s.add(x)
	for i in range(len(c)):
		if i not in s:
			c[i] = 'B'
	print('YES')
	print(''.join(c))


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())
d = dict()
a = [int(x) for x in input().split()]
for i in range(n):
	d.setdefault(a[i], []).append(i)
di = dict()
for (d, s) in d.items():
	di.setdefault(len(s), []).append(s)
exist = True
ans = ['A'] * n
if 1 in di:
	exist = False
	if len(di[1]) % 2 == 0:
		exist = True
		for i in range(0, len(di[1]), 2):
			ans[di[1][i][0]] = 'B'
	else:
		for i in range(0, len(di[1]) - 2, 2):
			ans[di[1][i][0]] = 'B'
		for i in range(3, n + 1):
			if i in di:
				ans[di[i][0][0]] = 'B'
				exist = True
				break
print('YES' if exist else 'NO')
if exist:
	print(''.join(ans))


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


n = int(input())
multiset = list(map(int, input().split()))
counts = [0 for _ in range(101)]
for elem in multiset:
	counts[elem] += 1
nice = 0
gt2elem = -1
for (i, count) in enumerate(counts):
	if i > 0:
		if count == 1:
			nice += 1
		elif count > 2:
			gt2elem = i
if nice % 2 == 0 or gt2elem != -1:
	x = 0
	s = []
	for elem in multiset:
		if counts[elem] == 1:
			s.append('AB'[x])
			x = 1 - x
		elif nice % 2 == 1 and elem == gt2elem:
			s.append('B')
			gt2elem = -1
		else:
			s.append('A')
	print('YES')
	print(''.join(s))
else:
	print('NO')


from math import ceil, gcd, sqrt

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

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

def li():
	return list(mi())

def si():
	return input()
n = ii()
m = {}
a = li()
for i in range(n):
	if a[i] not in m:
		m[a[i]] = []
		m[a[i]].append(i)
	else:
		m[a[i]].append(i)
a.clear()
x = []
c = -1
for i in m.keys():
	if len(m[i]) == 1:
		x.append(m[i][0])
	else:
		if len(m[i]) > 2:
			c = m[i][0]
		for j in range(len(m[i])):
			a.append(m[i][j])
ans = ['0'] * n
if len(x) % 2 == 0 or c != -1:
	print('YES')
	for i in a:
		ans[i] = 'A'
	if len(x) % 2:
		for i in range(0, len(x) - 1, 2):
			ans[x[i]] = 'A'
			ans[x[i + 1]] = 'B'
		ans[x[len(x) - 1]] = 'A'
		ans[c] = 'B'
	else:
		for i in range(0, len(x), 2):
			ans[x[i]] = 'A'
			ans[x[i + 1]] = 'B'
	print(''.join(ans))
else:
	print('NO')


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
n = int(input())
s = list(map(int, input().split()))
s1 = {}
for i in range(n):
	if s[i] in s1:
		s1[s[i]].append(i)
	else:
		s1[s[i]] = [i]
s2 = [i for i in s1 if len(s1[i]) == 1]
ls2 = len(s2)
if ls2 % 2 == 1 and ls2 == n:
	print('NO')
else:
	ec = 0
	oc = 0
	v = -1
	if ls2 % 2 == 0:
		print('YES')
		ec = 1
	else:
		f = 0
		for i in s1:
			if len(s1[i]) > 2:
				v = i
				f = 1
				break
		if f == 0:
			print('NO')
		else:
			print('YES')
			oc = 1
	if ec == 1:
		s = ['A'] * n
		mid = ls2 // 2
		for i in s2[mid:]:
			s[s1[i][0]] = 'B'
		print(''.join(s))
	elif oc == 1:
		s = ['A'] * n
		mid = ls2 // 2
		for i in s2[mid:]:
			s[s1[i][0]] = 'B'
		for i in s1[v][1:]:
			s[i] = 'B'
		print(''.join(s))


from collections import Counter
inp = lambda : map(int, input().rstrip().split())
n = int(input())
s = list(inp())
c = Counter(s)
t = 0
for x in c:
	if c[x] == 1:
		t += 1
if t % 2 == 1 and t == n:
	print('NO')
else:
	ans = ''
	i = 0
	if t % 2 == 1:
		flag = 1
	else:
		flag = 0
	for x in s:
		if c[x] == 1:
			if i < (t + 1) // 2:
				ans += 'A'
				i += 1
			else:
				ans += 'B'
		elif flag == 1 and c[x] > 2:
			ans += 'B'
			flag = 0
		else:
			ans += 'A'
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


from collections import Counter
n = int(input())
sarr = list(map(int, input().split()))
dct = Counter(sarr)
if dct.most_common(1)[0][1] == 1:
	if n % 2:
		print('NO')
	else:
		print('YES')
		print(''.join(['A' if i % 2 else 'B' for i in range(n)]))
	exit(0)
occ = list(filter(lambda o: o[1] == 1, dct.most_common()))
if not occ:
	print('YES')
	print(''.join(['A' for i in range(n)]))
	exit(0)
hn = None
ndct = {}
if len(occ) % 2:
	cmn = dct.most_common(1)[0]
	if cmn[1] < 3:
		print('NO')
		exit(0)
	hn = cmn[0]
for (i, o) in enumerate(occ):
	if i % 2:
		ndct[o[0]] = 'B'
rez = [None for _ in range(n)]
for (i, s) in enumerate(sarr):
	if s in ndct:
		rez[i] = 'B'
	else:
		rez[i] = 'A'
if hn:
	rez[sarr.index(hn)] = 'B'
print('YES')
print(''.join(rez))


n = int(input())
dict1 = {}
arr = list(map(int, input().split()))
for i in range(n):
	try:
		dict1[arr[i]] += 1
	except:
		KeyError
		dict1[arr[i]] = 1
if 1 not in dict1.values():
	print('YES')
	print('A' * n)
else:
	count1 = 0
	count2 = 0
	arr1 = []
	arr2 = []
	arr3 = []
	for i in dict1:
		if dict1[i] == 1:
			count1 += 1
			arr1.append(i)
		elif dict1[i] > 2:
			count2 += 1
			arr3.append(i)
		else:
			arr2.append(i)
	s = ''
	arrx1 = arr1[:count1 // 2]
	arrx2 = arr1[count1 // 2:]
	for i in range(n):
		if arr[i] in arrx1:
			s += 'A'
		else:
			s += 'B'
	if count1 % 2 == 0:
		print('YES')
		print(s)
	elif count2 == 0:
		print('NO')
	else:
		for i in range(n):
			if arr[i] == arr3[0]:
				s = s[:i] + 'A' + s[i + 1:]
				break
		print('YES')
		print(s)


num = int(input())
multiset = [int(x) for x in input().split(' ')]
non_multiset = set(multiset)
help_dict = dict()
good = True
add = False
add_num = 0
count = 0
for x in non_multiset:
	if multiset.count(x) == 1:
		if good:
			help_dict[x] = 'A'
		else:
			help_dict[x] = 'B'
		good = not good
		count += 1
	if multiset.count(x) >= 3:
		add = True
		add_num = x
if count % 2 == 1:
	if add:
		first = True
		print('YES')
		res = ''
		for x in multiset:
			if multiset.count(x) == 1:
				res += help_dict[x]
			elif x == add_num and first:
				res += 'B'
				first = False
			else:
				res += 'A'
		print(res)
	else:
		print('NO')
else:
	print('YES')
	res = ''
	for x in multiset:
		if multiset.count(x) == 1:
			res += help_dict[x]
		else:
			res += 'A'
	print(res)


n = int(input())
a = list(map(int, input().split()))
counts = [0] * 101
for guy in a:
	counts[guy] += 1
useless = counts.count(0) + counts.count(2)
forced = counts.count(1)
useful = 101 - useless - forced
if useful == 0 and forced % 2 == 1:
	print('NO')
else:
	if forced % 2 == 0:
		each = forced // 2
		out = ''
		seen = 0
		for guy in a:
			if counts[guy] == 1 and seen < each:
				out += 'A'
				seen += 1
			else:
				out += 'B'
	else:
		As = forced // 2
		out = ''
		seen = 0
		good = 0
		for guy in a:
			if counts[guy] == 1 and seen < As:
				out += 'A'
				seen += 1
			elif counts[guy] > 2 and good == 0:
				out += 'A'
				good = 1
			else:
				out += 'B'
	print('YES')
	print(out)