15
MIRZOYANOVECLOX
 23
AABBBAAACCCCCAAADDDDDDD
 2
QA
 11
GGRRAATTZZZ
 6
AZAZAZ
 10
SQSQSQSQTG
 3
KEK
 100
URXCAIZFIBNJTPCZHBQIBCILLPXZCFGMKKZMNPLCYGAVJVIBMCZEBSJWPSCPQDYCTTKPOKIJRSKIZPDGCHVOUTMPNECYORSFZFNC
 3
LOL
 2
WW
 8
PUTINVOR
 26
QWERTYUIOPASDFGHJKLZXCVBNM
 5
AZAZA
 9
EGORLETOV
 7
KADUROV
 9
MIKEPIDOR
 9
AAAAAAAAA
 100
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 5
FUFEL
 50
NYQAHBYYOXLTRYQDMVENEMAQNBAKGLGQOLXNAIFNQTOCLNNQIA

MI
 DD
 QA
 ZZ
 AZ
 SQ
 KE
 IB
 LO
 WW
 PU
 QW
 AZ
 EG
 KA
 MI
 AA
 AA
 FU
 YQ

n = int(input())
l = input()
ans = []
if n == 2:
	print(l)
else:
	for i in range(n - 2):
		if l[i] == l[i + 1] == l[i + 2]:
			ans.append(l[i])
			ans.append(l[i + 1])
	if len(ans) == 2:
		print(''.join(ans))
	else:
		c1 = 0
		c2 = 0
		c3 = 0
		for i in range(n - 1):
			if l[i] == l[i + 1]:
				c1 += 1
			elif chr(ord(l[i]) + 1) == l[i + 1]:
				c2 += 1
			elif l[i] != 'A':
				if chr(ord(l[i]) - 1) == l[i + 1]:
					c3 += 1
			if c1 == 2:
				ans.append(l[i])
				ans.append(l[i + 1])
			elif c2 == 2:
				ans.append(l[i])
				ans.append(l[i + 1])
			elif c3 == 2:
				ans.append(l[i])
				ans.append(l[i + 1])
			if len(ans) == 2:
				break
		print(''.join(ans))