You are given a string $s$, consisting of $n$ lowercase Latin letters.

A substring of string $s$ is a continuous segment of letters from $s$. For example, "defor" is a substring of "codeforces" and "fors" is not. 

The length of the substring is the number of letters in it.

Let's call some string of length $n$ diverse if and only if there is no letter to appear strictly more than $\frac n 2$ times. For example, strings "abc" and "iltlml" are diverse and strings "aab" and "zz" are not.

Your task is to find any diverse substring of string $s$ or report that there is none. Note that it is not required to maximize or minimize the length of the resulting substring.


-----Input-----

The first line contains a single integer $n$ ($1 \le n \le 1000$) — the length of string $s$.

The second line is the string $s$, consisting of exactly $n$ lowercase Latin letters.


-----Output-----

Print "NO" if there is no diverse substring in the string $s$.

Otherwise the first line should contain "YES". The second line should contain any diverse substring of string $s$.


-----Examples-----
Input
10
codeforces

Output
YES
code

Input
5
aaaaa

Output
NO



-----Note-----

The first example has lots of correct answers. 

Please, restrain yourself from asking if some specific answer is correct for some specific test or not, these questions always lead to "No comments" answer.

Difficulty: EASY
Tags: String algorithms

Implementation

Starter code:

Solutions:
def diverseSubstring(n, s):
	letters = ''
	n = n - 1
	for i in range(n):
		j = i + 1
		if s[i] != s[j]:
			print('YES')
			letters = s[i] + s[i + 1]
			return letters
	return 'NO'
n = int(input())
s = str(input())
print(diverseSubstring(n, s))


n = int(input())
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	g = set()
	ans = ''
	for i in s:
		if i not in ans:
			ans += i
		g.add(i)
		if len(ans) >= 2:
			break
	print('YES')
	print(ans)


def solve():
	_ = int(input())
	s = input()
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i:i + 2])
			return
	print('NO')
solve()


n = int(input())
s = input()
A = [s[i:j + 1] for i in range(n) for j in range(i, n)]
c = 0
for i in A:
	if len(i) > 1 and all((i.count(x) <= int(len(i) / 2) for x in i)):
		print('YES')
		print(i)
		c += 1
		break
if c == 0:
	print('NO')


n = int(input())
s = input()

def main():
	for w in range(0, n - 1):
		sub = s[w:w + 2]
		if sub[0] != sub[1]:
			print('YES')
			print(sub)
			return
	print('NO')
main()


import math
import bisect
import itertools
import sys

def mindiff(a):
	b = a[:]
	b.sort()
	m = 10000000000
	for i in range(len(b) - 1):
		if b[i + 1] - b[i] < m:
			m = b[i + 1] - b[i]
	return m

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

def merge(a, b):
	i = 0
	j = 0
	c = 0
	ans = []
	while i < len(a) and j < len(b):
		if a[i] < b[j]:
			ans.append(a[i])
			i += 1
		else:
			ans.append(b[j])
			c += len(a) - i
			j += 1
	ans += a[i:]
	ans += b[j:]
	return (ans, c)

def mergesort(a):
	if len(a) == 1:
		return (a, 0)
	mid = len(a) // 2
	(left, left_inversion) = mergesort(a[:mid])
	(right, right_inversion) = mergesort(a[mid:])
	(m, c) = merge(left, right)
	c += left_inversion + right_inversion
	return (m, c)

def is_prime(num):
	if num == 2:
		return True
	if num == 3:
		return True
	if num % 2 == 0:
		return False
	if num % 3 == 0:
		return False
	t = 5
	a = 2
	while t <= int(math.sqrt(num)):
		if num % t == 0:
			return False
		t += a
		a = 6 - a
	return True

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1

def binsearch(arr, b, low, high):
	if low == high:
		return low
	if arr[math.ceil((low + high) / 2)] < b:
		return binsearch(arr, b, low, math.ceil((low + high) / 2) - 1)
	else:
		return binsearch(arr, b, math.ceil((low + high) / 2), high)
n = int(input())
s = list(input())
for i in range(n):
	k = []
	for j in range(i, n):
		k += [s[j]]
		for l in range(len(k)):
			if k.count(k[l]) <= len(k) / 2:
				print('YES')
				exit(print(''.join(k)))
			else:
				break
print('NO')


from collections import Counter
n = int(input())
s = input()
d = Counter(s)
length = len(d)
if length == 1:
	print('NO')
else:
	print('YES')
	minimum = d.most_common(length)[-1][0]
	idx = s.index(minimum)
	if idx != 0:
		print(s[idx - 1:idx + 1])
	else:
		t = ''
		for i in s:
			t += i
			if Counter(t)[minimum] <= len(t) / 2:
				print(t)
				break


s = int(input())
string = input()

def __main__():
	for elem_to_start in range(s - 1):
		counter_dict = dict(zip('abcdefjhijklmnopqrstuvwxyz', [0] * 26))
		max_letter = 0
		for (cur_len, letter) in enumerate(string[elem_to_start:], 1):
			counter_dict[letter] += 1
			if counter_dict[letter] > max_letter:
				max_letter = counter_dict[letter]
			if max_letter <= cur_len / 2:
				print('YES')
				print(string[elem_to_start:elem_to_start + cur_len])
				return 0
	print('NO')
	return 0
__main__()


n = int(input())
s = input()
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		exit()
print('NO')


slen = input()
s = input()
i = 0
while i < int(slen) - 1:
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		break
	i += 1
if i == int(slen) - 1:
	print('NO')


n = int(input())
s = input()
flag = False
for i in range(len(s) - 1):
	if flag:
		break
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		flag = True
if not flag:
	print('NO')


n = int(input())
x = input()
k = -1
for i in range(n - 1):
	if x[i] != x[i + 1]:
		k = i
		break
if k == -1:
	print('NO')
else:
	print('YES')
	print(x[k] + x[k + 1])


n = int(input())
s = input()
f = True
for i in range(0, n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		f = False
		break
if f:
	print('NO')


import math
n = int(input())
s = input()
F = False
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		F = True
		break
if F == False:
	print('NO')


n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		exit(0)
print('NO')


n = int(input())
l = list(input())
set_ = list(set(l))
if len(set_) < 2:
	print('NO')
else:
	print('YES')
	ans = l[0]
	for i in range(1, n):
		if l[i] != ans:
			ans += l[i]
			break
	print(ans)


n = int(input())
s = input()
for i in range(len(s)):
	freq = {}
	for j in range(i, len(s)):
		sub = s[i:j + 1]
		if s[j] not in freq:
			freq[s[j]] = 1
		else:
			freq[s[j]] += 1
		check = True
		for key in freq.keys():
			if freq[key] > len(sub) / 2:
				check = False
				break
		if check:
			print('YES')
			print(sub)
			exit(0)
print('NO')


a = int(input())
b = input()
w = 0
f = ''
for i in range(0, len(b) - 1):
	if b[i] != b[i + 1]:
		print('YES')
		w = 1
		f = b[i] + b[i + 1]
		print(f)
		break
if w == 0:
	print('NO')


import math, sys

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

def main():
	n = int(input())
	a = input().strip()
	for i in range(n - 1):
		if a[i] != a[i + 1]:
			print('YES')
			print(a[i] + a[i + 1])
			return
	print('NO')
deb = 0
if deb:
	file = open('input.txt', 'r')
	input = file.readline
else:
	input = sys.stdin.readline
main()
if deb:
	file.close()


N = int(input())
s = str(input())
unique = ''
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		unique = s[i] + s[i + 1]
	else:
		unique = ''
	if len(unique) >= 2:
		print('YES')
		print(unique)
		exit(0)
print('NO')


n = input()
s = input()
diverse_substring = None
for i in range(0, len(s) - 1):
	if s[i] != s[i + 1]:
		diverse_substring = s[i] + s[i + 1]
		break
if diverse_substring != None:
	print('YES' + '\n' + diverse_substring)
else:
	print('NO')


n = int(input())
s = input()
ans = s[0]
for i in s[1:]:
	if i != s[0]:
		ans += i
		break
if len(ans) == 1:
	print('NO')
else:
	print('YES')
	print(ans)


n = int(input())
s = input()
x = 0
for i in range(0, n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		x = 1
		print(s[i] + s[i + 1])
		break
if x == 0:
	print('NO')


n = int(input())
s = input()
v = ''
for a in range(n - 1):
	if n > 1:
		v = s[a:a + 2]
		if v[0] != v[1]:
			break
		else:
			v = ''
			pass
if v:
	print('YES\n' + v)
else:
	print('NO')


n = int(input())
s = input()
if len(set(list(s))) == 1:
	print('NO')
	exit()
for i in range(1, n):
	if s[i] != s[i - 1]:
		print('YES')
		print(s[i - 1] + s[i])
		exit()


l = int(input())
t = input()
s = set(list(t))
if len(s) == 1:
	print('NO')
else:
	print('YES')
	c = t[0]
	for i in s:
		if i != c:
			print(c + i)
			break


n = int(input())
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	k = str()
	for i in range(n - 1):
		if len(set(s[i:i + 2])) != 1:
			k = s[i:i + 2]
			break
	print('YES')
	print(k)


n = int(input())
s = input()
if len(set(list(s))) == 1:
	print('NO')
else:
	print('YES')
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print(s[i] + s[i + 1])
			break


n = int(input())
s = input()
pos = 0
for i in range(1, n):
	if s[i] != s[i - 1]:
		pos = i
		break
if pos == 0:
	print('NO')
else:
	print('YES')
	print(s[pos - 1] + s[pos])


(n, s) = (int(input()), input())
if n <= 1:
	print('NO')
else:
	d = {}
	loc = -1
	d[s[0]] = 1
	for i in range(1, n):
		if s[i] not in d:
			loc = i - 1
			break
	if loc == -1:
		print('NO')
	else:
		print('YES')
		print(s[loc:loc + 2])


class Substring:
	n = int(input())
	news = list(input())
	isSub = False
	substring = ''
	for i in range(len(news) - 1):
		if news[i] != news[i + 1]:
			substring = news[i] + news[i + 1]
			isSub = True
			break
	if isSub == False:
		print('NO')
	else:
		print('YES')
		print(substring)


n = int(input())
s = input()
lm = list(s)
from difflib import SequenceMatcher

def longestSubstring(str1, str2):
	seqMatch = SequenceMatcher(None, str1, str2)
	match = seqMatch.find_longest_match(0, len(str1), 0, len(str2))
	if match.size != 0:
		print(str1[match.a:match.a + match.size])
	else:
		print('No longest common sub-string found')
if lm.count(s[0]) == n:
	print('NO')
else:
	l = list(s)
	print('Yes')
	sec = list(set(l))
	l3 = []
	for i in range(len(l)):
		if l[i] in sec:
			l3.append(l[i])
			sec.remove(l[i])
	s3 = ''
	for i in l3:
		s3 = s3 + str(i)
	s4 = ''
	for i in l:
		s4 = s4 + str(i)
	longestSubstring(s3, s4)


input()
s = input()
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		exit()
print('NO')


n = int(input())
s = input()
ans = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		ans = s[i:i + 2]
		break
if ans:
	print('YES')
	print(ans)
else:
	print('NO')


import sys
input = sys.stdin.readline
n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i], s[i + 1], sep='')
		sys.exit()
print('NO')


def m():
	a = input()
	s = input()
	for i in range(1, len(s)):
		if s[i] != s[i - 1]:
			print('YES')
			print(s[i - 1] + s[i])
			return
	print('NO')
	return
m()


n = int(input())
c = n // 2
mot = str(input())
freq = dict()
f = False
for i in range(1, n):
	if mot[i] != mot[i - 1]:
		print('YES')
		print(mot[i - 1] + mot[i])
		f = True
		break
if not f:
	for i in range(n):
		if mot[i] in freq:
			freq[mot[i]] += 1
		else:
			freq[mot[i]] = 1
	ff = True
	for v in freq.values():
		if v < c:
			ff = False
			break
	if ff:
		print('NO')


def main():
	n = int(input())
	s = input()
	l = len(s)
	for i in range(l - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i:i + 2])
			return
	print('NO')
main()


(n, s) = (int(input()), input())
for i in range(1, n):
	if s[i] != s[i - 1]:
		print(f'YES\n{s[i - 1] + s[i]}')
		break
else:
	print('NO')


n = int(input())
s = input()
end = False

def checks(s, l):
	l /= 2
	lst = list(s)
	y = set(s)
	for x in y:
		if lst.count(x) > l:
			return False
	return True
v = len(set(s))
for i in range(2, n + 1):
	if i > v * 2:
		break
	if not end:
		for j in range(n - i + 1):
			t = s[j:i + j]
			if checks(t, i):
				print('YES')
				print(t)
				end = True
				break
if not end:
	print('NO')


n = int(input())
l = input()
for i in range(n - 1):
	if l[i] != l[i + 1]:
		print('YES')
		print(l[i] + l[i + 1])
		break
else:
	print('NO')


a = int(input())
s = str(input())
if a == 1:
	print('NO')
else:
	i = 0
	while i < len(s) - 1:
		if s[i] == s[i + 1]:
			i += 1
		elif s[i] != s[i + 1]:
			print('YES')
			print(s[i] + s[i + 1])
			break
		if i == len(s) - 1:
			print('NO')


p = int(input())
a = list(input())
if p == 1:
	print('NO')
else:
	for i in range(p - 1):
		if a[i] != a[i + 1]:
			print('YES')
			print(a[i] + a[i + 1])
			break
		elif i == p - 2:
			print('NO')
			break
		else:
			pass


n = int(input()) - 1
a = input()
for i in range(n):
	if a[i] != a[i + 1]:
		print('YES')
		print(a[i] + a[i + 1])
		exit()
print('NO')


n = input()
s = input()
ok = False
for i in range(1, len(s)):
	if s[i] != s[i - 1]:
		print('YES')
		ok = True
		print(s[i - 1:i + 1])
		break
if not ok:
	print('NO')


n = int(input())
s = input()
d = {}
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
	if len(d) >= 2:
		break
ans = ''
for (k, v) in d.items():
	ans += k
if len(d) >= 2:
	print('YES')
	print(ans)
else:
	print('NO')


n = int(input())
s = str(input())
i = 0
t = ''
f = 0
while i < n - 1:
	if s[i] != s[i + 1]:
		t = t + s[i] + s[i + 1]
		f = 1
		break
	i = i + 1
if f == 1:
	print('YES')
	print(t)
else:
	print('NO')


n = int(input())
s = list(input())
res = ''
for c in s:
	if c not in res:
		res = res + c
	if len(res) >= 2:
		print('YES\n' + res)
		exit()
print('NO')


import sys
import math
input = sys.stdin.readline
n = int(input())
s = list(input())
idx = -1
for i in range(n - 1):
	if s[i] != s[i + 1]:
		idx = i
		break
if idx == -1:
	print('NO')
else:
	print('YES')
	print(s[i] + s[i + 1])


import pdb
import sys
from collections import defaultdict

def sol_1():
	N = int(sys.stdin.readline().strip())
	string = sys.stdin.readline().strip()
	letter_count = dict()
	found = False
	ret = None
	for i in range(N):
		if found:
			break
		for j in range(i, N + 1):
			if i == j:
				letter_count[i, j] = [0] * 26
			else:
				letter_count[i, j] = letter_count[i, j - 1]
				try:
					letter_count[i, j][ord(string[j - 1]) - ord('a')] += 1
				except:
					pdb.set_trace()
				if max(letter_count[i, j]) < (j - i) // 2:
					found = True
					ret = string[i:j]
					break
	if ret:
		print('YES')
		print(ret)
	else:
		print('NO')

def sol_2():
	N = int(sys.stdin.readline().strip())
	string = sys.stdin.readline().strip()
	found = False
	for c in string[1:]:
		if c != string[0]:
			print('YES')
			print(string[0] + c)
			found = True
			break
	if not found:
		print('NO')
sol_2()


n = int(input())
s = input()
n0 = len(s)

def check():
	sum0 = 0
	prev = s[0]
	for s0 in s:
		if prev != s0:
			print('YES')
			print(prev + s0)
			return
	print('NO')
check()


n = int(input())
t = input()
D = {}
b = False
for i in range(n - 1):
	if t[i] != t[i + 1]:
		print('YES')
		print(t[i:i + 2])
		b = True
		break
if not b:
	print('NO')


n = int(input())
b = input()
check = 1
for i in range(1, n):
	if b[i] != b[i - 1]:
		print('YES')
		print(b[i - 1] + b[i])
		check = 0
		break
if check == 1:
	print('NO')


n = int(input())
s = str(input())
s1 = ''
moze = False
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		moze = True
		s1 = s[i] + s[i + 1]
		break
if moze:
	print('YES')
	print(s1)
else:
	print('NO')


n = int(input())
s = input()
if n == 1:
	print('NO')
for i in range(1, n):
	if s[i] != s[i - 1]:
		print('YES')
		print(s[i - 1] + s[i])
		break
	elif i == n - 1:
		print('NO')


n = int(input())
s = str(input())
val = ''
for j in range(n - 1):
	if s[j] != s[j + 1]:
		val = s[j] + s[j + 1]
		break
if val == '':
	print('NO')
else:
	print('YES')
	print(val)


(n, s) = (input(), input())
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES\n' + s[i] + s[i + 1])
		break
else:
	print('NO')


n = int(input())
b = input()
s = ''
f = 0
for j in range(n - 1):
	if b[j] != b[j + 1]:
		f = 1
		s = b[j] + b[j + 1]
		break
if f == 1:
	print('YES')
	print(s)
else:
	print('NO')


n = int(input())
f = input()
if len(set(f)) == 1:
	print('NO')
else:
	ams = ''
	for i in range(n):
		if f[i] != f[i + 1]:
			ams += f[i] + f[i + 1]
			break
	print('YES')
	print(ams)


input()
s = input()
a = set()
for i in range(len(s)):
	a.add(s[i])
if len(a) == 1:
	print('NO')
	exit(0)
else:
	j = 0
	while s[j] == s[j + 1]:
		j += 1
	print('YES')
	print(s[j] + s[j + 1])
	exit(0)


n = int(input())
l = str(input())
flag = 0
if n == 1:
	print('NO')
else:
	for i in range(1, len(l)):
		if l[i] != l[i - 1]:
			print('YES')
			print(l[i - 1] + l[i])
			flag = 1
			break
	if flag == 0:
		print('NO')


input()
s = input()
t = s.replace(s[0], '')
print(t and 'YES\n' + s[0] + t[0] or 'NO')


import collections

def sol():
	l = input()
	s = input()
	if len(s) == 1:
		print('NO')
		return
	p = s[0]
	for c in s[1:]:
		if p != c:
			print('YES')
			print(p + c)
			return
		p = c
	print('NO')
sol()


n = int(input())
s = input()
letter = ''
maxi = 0
for char in s:
	c = s.count(char)
	if c > maxi:
		letter = char
		maxi = c
if maxi == n:
	print('NO')
else:
	print('YES')
	ns = list(s)
	for i in range(n):
		if ns[i] != letter:
			if i > 0:
				print(''.join(ns[i - 1:i + 1]))
			else:
				for j in range(i + 1, n):
					if ns[j] != ns[i]:
						print(''.join(ns[i] + ns[j]))
						break
			break


input()
X = input()
if len(set(X)) == 1:
	print('NO')
	exit()
for i in range(len(X) - 1):
	if X[i] != X[i + 1]:
		print('YES')
		print(X[i] + X[i + 1])
		exit()


def d():
	arrlen = int(input())
	arr = list(input())
	ans = False
	for i in range(1, arrlen):
		if arr[i] != arr[i - 1]:
			ans = True
			print('YES')
			print(arr[i - 1] + arr[i])
			break
	if not ans:
		print('NO')
d()


import sys
n = int(input())
s = sys.stdin.readline()
flag = 0
for i in range(n - 1):
	if s[i] != s[i + 1]:
		flag = 1
		print('YES')
		print(s[i], s[i + 1], sep='')
		break
if flag == 0:
	print('NO')


n = int(input())
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	print('YES')
	ans = ''.join(dict.fromkeys(s))
	found = False
	for i in range(len(ans)):
		if found:
			break
		for j in range(i, len(ans)):
			if ans[i] + ans[j] in ans:
				print(ans[i] + ans[j])
				found = True
				break


n = int(input())
word = input()
if n > 1:
	for i in range(0, n - 1):
		first = word[i]
		second = word[i + 1]
		if first != second:
			print('YES')
			print('{}{}'.format(first, second))
			break
	else:
		print('NO')
else:
	print('NO')


a = int(input())
a = str(input())
el = False
for i in range(len(a) - 1):
	if a[i] != a[i + 1]:
		print('YES')
		print(a[i:i + 2])
		el = True
		break
if el == False:
	print('NO')


I = input
P = print
n = int(I())
s = I()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		P('YES\n' + s[i:i + 2])
		exit()
P('NO')


n = int(input())
strok = input()
i = 0
while i < n - 1:
	if strok[i] != strok[i + 1]:
		print('YES')
		print(strok[i:i + 2])
		break
	i += 1
else:
	print('NO')


import sys
n = int(input())
s = str(input())
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		sys.exit()
print('NO')


n = int(input())
s = input()
if s.count(s[0]) == len(s):
	print('NO')
elif s.count(s[-1]) == len(s):
	print('NO')
else:
	prev = s[0]
	for x in s[1:]:
		if x != prev:
			print('YES')
			print(prev + x)
			break
		else:
			prev = x


n = int(input())
s = input()
p = None
for i in range(1, n):
	if s[i] != s[i - 1]:
		p = i
		break
if p:
	print('YES')
	print(s[p - 1:p + 1])
else:
	print('NO')


def substr(string):
	j = 1
	a = set()
	while True:
		for i in range(len(string) - j + 1):
			a.add(string[i:i + j])
		if j == len(string):
			break
		j += 1
	return a

def fun():
	n = int(input())
	str = input()
	b = ()
	b = substr(str)
	l = list(b)
	for st in l:
		leng = len(st)
		l1 = int(leng / 2)
		i = 0
		j = 0
		for ch in st:
			ct = st.count(ch)
			if ct <= l1:
				if i == len(st) - 1:
					print('YES')
					print(st)
					return
				i = i + 1
			else:
				break
		j = j + 1
	print('NO')
fun()


s = int(input())
x = input()
d = 0
if len(set(x)) == 1:
	print('NO')
else:
	for c in range(0, s):
		if x[c] != x[c + 1]:
			print('YES')
			print(x[c:c + 2])
			exit()


n = input()
s = list(input())
res = ''
flag = 1
for i in s:
	if i not in res:
		res += i
	if len(res) >= 2:
		print('YES\n' + res)
		flag = 0
		break
if flag == 1:
	print('NO')


q = int(input())
w = list(input())
e = []
for i in range(len(w) - 1):
	if w[i] != w[i + 1]:
		e.append(w[i])
		e.append(w[i + 1])
		break
if len(e) > 1:
	print('YES')
	for i in e:
		print(i, end='')
else:
	print('NO')


n = int(input())
a = input()
b = []
flag = 0
c = len(set(a))
for i in range(n - 1):
	if a[i] != a[i + 1]:
		flag = 1
		b.append(a[i])
		b.append(a[i + 1])
		break
if flag == 1:
	print('YES')
	print(b[0], b[1], sep='')
else:
	print('NO')


def different(s):
	for i in range(len(s)):
		if i + 1 < len(s) and s[i] != s[i + 1]:
			return ('YES', s[i], s[i + 1])
	return ('NO',)
n = int(input())
t = input()
if len(different(t)) == 1:
	print(*different(t))
else:
	(x, y, z) = different(t)
	print(x, ''.join((y, z)), sep='\n')


n = int(input())
s = input()
result = ''
flag = 0
for i in range(0, n):
	if i < n - 1:
		if s[i] != s[i + 1]:
			flag = 1
			result = result + s[i] + s[i + 1]
			break
if flag != 0:
	print('Yes')
	print(result)
else:
	print('No')


n = int(input())
s = input()
i = 0
answer = 'NO'
example = ''
while i < n:
	if i == n - 1:
		break
	if s[i] != s[i + 1]:
		answer = 'YES'
		example = s[i] + s[i + 1]
		break
	i += 1
print(answer)
if example != '':
	print(example)


n = int(input())
s = input()
final = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		final = s[i] + s[i + 1]
if len(final) > 1:
	print('YES')
	print(final)
else:
	print('NO')


n = int(input())
li = list(input())
uk1 = 0
while uk1 <= n - 2:
	a = li[uk1] + li[uk1 + 1]
	b = set(a)
	if len(b) == 2:
		print('YES')
		print(''.join(map(str, li[uk1:uk1 + 2])))
		exit()
	uk1 += 1
print('NO')


n = int(input())
s = input()
ans = False
val = ''
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		ans = True
		val = s[i] + s[i + 1]
if ans:
	print('YES')
	print(val)
else:
	print('NO')


from sys import stdin, stdout

def main():
	global n, s
	n = int(stdin.readline())
	s = stdin.readline()
	for i in range(n):
		if i + 1 < n:
			if s[i] != s[i + 1]:
				stdout.write('YES\n' + s[i:i + 2])
				return 0
	stdout.write('NO')
	return 0
main()


n = int(input())
x = input()
if len(set(x)) == 1:
	print('NO')
else:
	print('YES')
	for i in range(len(x) - 1):
		if x[i] != x[i + 1]:
			print(x[i] + x[i + 1])
			break


n = int(input())
text = input()
ans = False
for i in range(1, n):
	if text[i] != text[i - 1]:
		print('YES')
		print(text[i - 1:i + 1])
		ans = True
		break
if not ans:
	print('NO')


import sys
n = int(sys.stdin.readline().strip())
s = sys.stdin.readline().strip()
if len(set(s)) == 1:
	r = 'NO'
else:
	l = s[0]
	for i in range(1, len(s)):
		if s[i] != l:
			r = 'YES\n' + l + s[i]
			break
print(r)


n = int(input())
s = input()
ans = s[0]
t = ''
f = True
for i in range(len(s)):
	if s[i] != ans:
		print('YES')
		print(ans + s[i])
		f = False
		break
	else:
		ans = s[i]
if f:
	print('NO')


def isDiverse(s):
	t = list(set(s))
	freq = [0] * len(t)
	for i in range(len(s)):
		for j in range(len(t)):
			if s[i] == t[j]:
				freq[j] += 1
	maximo = len(s) // 2
	if max(freq) <= maximo:
		return True
	else:
		return False
n = int(input())
s = input()
achou = False
i = 0
while i < n - 1 and s[i] == s[i + 1]:
	i += 1
while i <= n and (not achou):
	j = i + 1
	while j <= n and (not achou):
		achou = isDiverse(s[i:j])
		if achou:
			t = s[i:j]
		j += 1
	i += 1
if achou:
	print('YES', t, sep='\n')
else:
	print('NO')


def main():
	n = int(input())
	string = input()
	for i in range(len(string) - 1):
		if string[i] != string[i + 1]:
			print('YES')
			print(string[i] + string[i + 1])
			return
	print('NO')
main()


n = int(input())
str = input()
letters = []
for char in str:
	if char not in letters:
		letters.append(char)
	if len(letters) == 2:
		break
if len(letters) == 1:
	print('NO')
else:
	print('YES')
	print(letters[0] + letters[1])


n = int(input())
s = input()
(i, j) = (0, 1)
first = s[i]
for i in range(1, n):
	if s[i] == first:
		continue
	else:
		print('YES')
		print(first + s[i])
		exit(0)
print('NO')


def div(str_: str):
	for a in str_:
		if str_.count(a) > len(str_) / 2:
			return False
	return True

def div_(str_: str):
	for i in range(len(str_)):
		for j in range(i + 1, len(str_) + 1):
			if div(str_[i:j]):
				return str_[i:j]
	return None
input()
str_ = div_(input())
if str_ is None:
	print('NO')
else:
	print('YES\n%s' % str_)


n = int(input())
ls = [x for x in input().strip()]
q = [0] * 26
for i in range(n):
	q[ord(ls[i]) - ord('a')] += 1
if max(q) > n - 1:
	print('NO')
	exit(0)
print('YES')
lss = [ls[0]]
i = 1
while ls[i] == lss[0]:
	i += 1
lss.append(ls[i])
print(*lss, sep='')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

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

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
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 = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = ii()
	s = si()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i] + s[i + 1])
			return
	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')

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


n = input()
n = input()
i = 0
while i < len(n) - 1:
	if n[i] != n[i + 1]:
		print('YES')
		print(n[i] + n[i + 1])
		break
	i += 1
if i == len(n) - 1:
	print('NO')


n = int(input())
s = input()
f = 0
for i in range(1, n):
	if s[i - 1] != s[i]:
		print('YES')
		print(s[i - 1], s[i], sep='')
		f = 1
		break
if f == 0:
	print('NO')


n = int(input())
s = str(input())
ans = None
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		ans = i
		break
if ans != None:
	print('YES')
	print(s[ans] + s[ans + 1])
else:
	print('NO')


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
n = int(input())
string = input()
flag = 0
for i in range(n - 1):
	if string[i] != string[i + 1]:
		print('YES')
		print(string[i], end='')
		print(string[i + 1])
		flag = 1
		break
if flag == 0:
	print('NO')


n = int(input())
st = input()
cnt = 0
for i in range(1, n):
	if st[i] != st[i - 1]:
		cnt = 1
		print('YES\n{}{}'.format(st[i - 1], st[i]))
		break
if cnt == 0:
	print('NO')


n = int(input())
s = input()
d = {}
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
if len(d.items()) == 1:
	print('NO')
else:
	for i in range(1, n):
		if s[i - 1] != s[i]:
			a = s[i - 1] + s[i]
			print('YES')
			print(a)
			break


n = int(input())
string = input()
ans = True
for i in range(n - 1):
	if string[i] != string[i + 1]:
		print('YES')
		print(string[i:i + 2])
		ans = False
		break
if ans:
	print('NO')


n = int(input())
s = input()
equal = True
for c in s:
	if c != s[0]:
		equal = False
if equal:
	print('NO')
else:
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i] + s[i + 1])
			break


n = int(input())
s = input()
l = []
flag = True
for i in s:
	if i not in l:
		l.append(i)
	if len(l) >= 2:
		flag = False
		print('YES')
		print(l[0] + l[1])
		break
if flag:
	print('NO')


n = int(input())
s = input()
c = 0
li = []
for i in range(n - 1):
	if not s[i] == s[i + 1]:
		li.append(i)
		li.append(i + 1)
		c = 1
if c == 1:
	print('YES')
	print(s[li[0]:li[1] + 1])
else:
	print('NO')


n = int(input())
s = input()

def checkDiverse(st):
	a = len(st) // 2
	l = []
	for x in st:
		if x not in l:
			if st.count(x) > a:
				return False
			else:
				l.append(x)
	return True
for x in range(0, n + 1):
	for y in range(0, n + 1):
		if len(s[x:y]) > 0:
			if checkDiverse(s[x:y]) and x != y:
				print('YES')
				print(s[x:y])
				exit(0)
print('No')


def main():
	n = int(input())
	s = input()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i], s[i + 1], sep='')
			return
	print('NO')
main()


n = int(input())
s = input()
result = [False, s[0]]
for c in s[1:]:
	if result[1] != c:
		result = [True, result[1] + c]
		break
	result[1] = c
if result[0]:
	print('YES\n' + result[1])
else:
	print('NO')


n = int(input())
S = input()
s = ''
for i in range(n - 1):
	if S[i] != S[i + 1]:
		s = S[i]
		s = s + S[i + 1]
		break
if len(s) > 0:
	print('YES')
	print(s)
else:
	print('NO')


n = int(input())
s = input()
nDig = [[0 for i in range(ord('z') - ord('a') + 1)] for j in range(n + 1)]
for i in range(n):
	nDig[i + 1] = nDig[i][:]
	nDig[i + 1][ord(s[i]) - ord('a')] += 1
for l in range(n):
	for r in range(l, n):
		length = r - l + 1
		good = True
		for d in range(0, ord('z') - ord('a') + 1):
			if 2 * (nDig[r + 1][d] - nDig[l][d]) > length:
				good = False
				break
		if good:
			print('YES')
			print(s[l:r + 1])
			exit()
print('NO')


n = int(input())
s = input()
t = 'NO'

def f(x, y):
	global t
	t = 'YES'
	m = y - x + 1
	for i in range(x, y + 1):
		if s[x:y + 1].count(s[i]) > m / 2:
			t = 'NO'
			break
	if t == 'YES':
		return s[x:y + 1]
i = 0
while i < n - 1 and t == 'NO':
	for j in range(i + 1, n):
		f(i, j)
		if t == 'YES':
			print(t)
			print(f(i, j))
			break
	i += 1
if t == 'NO':
	print(t)


n = int(input())
string = input()
for i in range(string.__len__() - 1):
	if string[i] != string[i + 1]:
		print('YES')
		print(string[i] + string[i + 1])
		exit(0)
print('NO')


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

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

def li():
	return list(mi())
n = ii()
s = input().strip()
ans = 'NO'
for i in range(n - 1):
	if s[i] != s[i + 1]:
		ans = 'YES\n' + s[i:i + 2]
		break
print(ans)


x = int(input())
a = input()
flag = 0
for i in range(x // 2 + 1):
	t1 = 0
	for j in range(x):
		if a[i] != a[j]:
			print('YES')
			print(a[j - 1:j + 1])
			flag = 1
			break
	if flag == 1:
		break
if flag == 0:
	print('NO')


input()
s = input()
t = s.strip(s[0])
print(t and 'YES\n' + s[0] + t[0] or 'NO')


n = int(input())
strin = input()
if n == 1:
	print('NO')
elif len(set(strin)) == 1:
	print('NO')
else:
	found = False
	comb = [strin[i] + strin[i + 1] for i in range(n - 1)]
	for item in comb:
		if item[0] != item[1]:
			print('YES')
			print(item)
			found = True
			break
	if found == False:
		print('NO')


n = int(input())
s = input()
v = False
for i in range(1, n):
	if s[i] != s[i - 1]:
		print('YES')
		print(s[i - 1] + s[i])
		v = True
		break
if v == False:
	print('NO')


n = int(input())
lst = input()
n = len(lst)
good = False
if len(lst) < 2:
	print('NO')
else:
	for i in range(n - 1):
		if lst[i] != lst[i + 1]:
			good = True
			print('YES')
			print(lst[i:i + 2])
			break
	if not good:
		print('NO')


import re

def main(args):
	n = int(input())
	s = input()
	res = re.search('(\\w)(?!\\1)\\w', s)
	if res:
		print('YES')
		print(res.group())
	else:
		print('NO')
	return 0
import sys
sys.exit(main(sys.argv))


n = int(input())
s = input()

def cosa():
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print('{}{}'.format(s[i], s[i + 1]))
			return
	print('NO')
cosa()


n = int(input())
s = input()
for i in range(n - 1):
	s_set = set(s[i:i + 2])
	if len(s_set) > 1:
		print('YES')
		print(''.join(s[i:i + 2]))
		break
else:
	print('NO')


n = int(input())
arr = [c for c in input()]
if len(set(arr)) == 1:
	print('NO')
else:
	print('YES')
	for i in range(1, n):
		if arr[i] != arr[i - 1]:
			print(arr[i - 1] + arr[i])
			break


n = int(input())
s = input()
flag = False
res = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		res = s[i] + s[i + 1]
		flag = True
		break
if flag:
	print('YES')
	print(res)
else:
	print('NO')


input()
t = input()
s = t.strip(t[0])
print('NO' if s == '' else 'YES\n' + t[0] + s[0])


number = input()
letter = input()
length = len(letter)
verifier = False
for i in range(1, length):
	if letter[i - 1] != letter[i]:
		verifier = True
		print('YES')
		print(letter[i - 1:i + 1])
		break
if verifier == False:
	print('NO')


import sys
from array import array
import typing as Tp

def input():
	return sys.stdin.buffer.readline().decode('utf-8')

def main():
	n = int(input())
	s = input().rstrip()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print(f'YES\n{s[i:i + 2]}')
			break
	else:
		print('NO')
main()


n = int(input())
s = input()
a = s[0]
i = 0
k = 0
while i < n:
	if s[i] != a:
		print('YES')
		print(a, s[i], sep='')
		k += 1
		break
	else:
		i += 1
if k == 0:
	print('NO')


n = int(input())
string = input()
a = 0
for i in range(0, n - 1):
	if string[i] != string[i + 1]:
		a = 1
		break
if a == 1:
	print('YES')
	print(string[i] + string[i + 1])
else:
	print('NO')


x = int(input())
s = input()
z = ''
l = 0
for n in range(x - 1):
	if s[n] != s[n + 1]:
		z += s[n]
		z += s[n + 1]
		print('YES')
		l = 1
		print(z)
		break
if l == 0:
	print('NO')


length = int(input())
line = input()
answer = 'NO'
diverse_substring = None
if length > 1:
	for i in range(length - 1):
		if line[i] != line[i + 1]:
			answer = 'YES'
			diverse_substring = line[i:i + 2]
			break
print(answer)
if diverse_substring:
	print(diverse_substring)


n = int(input())
s = input()
Flag = False
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES', s[i] + s[i + 1], sep='\n')
		Flag = True
		break
if Flag == False:
	print('NO')


n = int(input())
s = input()
ans = ''
flag = 1
for i in range(1, n):
	if s[i] != s[i - 1]:
		ans = s[i - 1:i + 1]
		flag = 0
		break
if flag == 1:
	print('NO')
else:
	print('YES')
	print(ans)


x = int(input())
a = input()
l = []
for i in a:
	if i not in l:
		l += [i]
if len(l) > 1:
	l = ''
	l += a[0]
	for i in a:
		if i in l:
			pass
		else:
			l += i
			break
	print('YES')
	print(l)
else:
	print('NO')


import sys
import math
import bisect
import itertools
import random

def main():
	n = int(input())
	s = input()
	ans = None
	for i in range(1, n):
		if s[i - 1] != s[i]:
			ans = s[i - 1:i + 1]
	if ans:
		print('YES')
		print(ans)
	else:
		print('NO')
main()


n = int(input())
s = input()
c = 0
for i in range(0, n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		s1 = s[i] + s[i + 1]
		print(s1)
		c = 1
		break
if c == 0:
	print('NO')


n = int(input())
S = input()
f = 0
for i in range(1, n):
	if S[i] != S[i - 1]:
		print('Yes')
		print(S[i - 1], S[i], sep='')
		f += 1
		break
if f == 0:
	print('No')


from collections import Counter
n = int(input())
string = list(input())
C = Counter(string)
if len(Counter(string)) <= 1:
	print('NO')
else:
	res = list(C.keys())[:2]
	print('YES')
	print(''.join(res))


import math
from sys import stdin
string1 = stdin.readline().strip().split()
string2 = stdin.readline().strip().split()
number = int(string1[0])
string = string2[0]
lst = []
result = 'NO'
word = ''
head = ''
for letter in string:
	if letter != '\n':
		if head == '':
			head = letter
		elif letter != head:
			word = head + letter
			result = 'YES'
			break
print(result)
if result == 'YES':
	print(word)


a = int(input())
b = input()
for i in range(a):
	if b[0] != b[i]:
		print('YES')
		print(b[0] + b[i])
		exit()
print('NO')


n = int(input())
w = list(input())
x = 0
while x < n - 1:
	if w[x] != w[x + 1]:
		c = ''.join([w[x], w[x + 1]])
		print('YES')
		print(c)
		break
	x += 1
if x == n - 1:
	print('NO')


a = int(input())
l = list(input())
flag = 0
for i in range(a - 1):
	if l[i] != l[i + 1]:
		print('YES')
		print(str(l[i] + l[i + 1]))
		flag = 1
		break
if flag == 0:
	print('NO')


n = int(input())
a = input()
ans = ''
for i in range(1, n):
	if a[i - 1] != a[i]:
		ans = a[i - 1] + a[i]
if len(ans) > 0:
	print('YES')
	print(ans)
else:
	print('NO')


n = int(input())
s = input()
i = 1
diverse = False
while i < len(s):
	if s[i] != s[i - 1]:
		print('YES')
		print(s[i - 1] + s[i])
		diverse = True
		break
	i += 1
if not diverse:
	print('NO')


n = input()
s = input()
if s.count(s[0]) == len(s):
	print('NO')
	quit(0)
print('YES')
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		print(s[i] + s[i + 1])
		quit(0)


from collections import defaultdict
d = defaultdict(lambda : 0)
n = int(input())
s = input()
f = 0
res = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		f = 1
		res = s[i:i + 2]
		break
if f:
	print('YES')
	print(res)
else:
	print('NO')


n = int(input())
s = input()
b = False
val = 0
for i in range(n - 1):
	if s[i] != s[i + 1]:
		b = True
		val = i
		break
if b:
	print('YES')
	print(s[val:val + 2])
else:
	print('NO')


from sys import stdin
from collections import Counter
n = stdin.readline()
s = stdin.readline().rstrip()

def solve(s):
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i:i + 2])
			return
	print('NO')
solve(s)


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import PriorityQueue as pq
n = int(input())
s = input()[:-1]
f = 0
for i in range(n - 1):
	if s[i] != s[i + 1]:
		f = 1
		break
if f:
	print('YES')
	print(s[i:i + 2])
else:
	print('NO')


n = int(input())
x = input()
if len(set(x)) == 1:
	print('NO')
else:
	print('YES')
	for i in range(len(x) - 1):
		if x[i] != x[i + 1]:
			print(x[i] + x[i + 1])
			exit(0)


n = int(input())
a = input()
if n > 1:
	no = -1
	for i in range(1, n):
		if a[i - 1] != a[i]:
			no = i
			break
	if no == -1:
		print('NO')
	else:
		print('YES')
		print(a[i - 1] + a[i])
else:
	print('NO')


from sys import stdin, stdout
import cProfile, math
from collections import Counter
from bisect import bisect_left
import itertools
from fractions import Fraction
printHeap = str()
test = False
memory_constrained = False
N = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10000000)

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

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

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

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

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

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

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

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

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

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

def main():
	n = get_int()
	st = list(input())
	if n == 1:
		print('NO')
		return
	for i in range(1, len(st)):
		if st[i - 1] != st[i]:
			print('YES')
			display(str(st[i - 1]) + str(st[i]))
			return
	print('NO')
if TestCases:
	for _ in range(get_int()):
		cProfile.run('main()') if test else main()
else:
	cProfile.run('main()') if test else main()


def is_substring(string, n_letters):
	for letter_idx in range(n_letters - 1):
		if string[letter_idx] != string[letter_idx + 1]:
			print('YES')
			print(string[letter_idx] + string[letter_idx + 1])
			return True
	return False
n_letters = int(input())
string = input()
if not is_substring(string, n_letters):
	print('NO')


n = input()
lst = input()
finish = False
for i in range(len(lst) - 1):
	if lst[i] != lst[i + 1]:
		print('YES')
		print(lst[i:i + 2])
		finish = True
		break
if finish == False:
	print('NO')


def solve(n, str):
	for i in range(1, n):
		if str[i - 1] != str[i]:
			print('YES')
			print(str[i - 1:i + 1])
			return
	print('NO')
n = int(input())
str = input()
solve(n, str)


n = int(input())
r = input()
l = len(r)
for i in range(l - 1):
	if r[i] != r[i + 1]:
		print('YES')
		print(r[i] + r[i + 1])
		exit(0)
print('NO')


nbLetters = int(input())
string = input()
prev = string[0]
found = False
for letter in string:
	if letter != prev:
		found = True
		print('YES')
		print(prev, end='')
		print(letter)
		break
	prev = letter
if not found:
	print('NO')


length = int(input())
letters = input()
flag = True
for (i, l) in enumerate(letters):
	if i == 0:
		continue
	elif letters[i - 1] != l:
		print('YES')
		print(letters[i - 1] + l)
		flag = False
		break
if flag:
	print('NO')


n = int(input())
s = input()
flag = False
p_1 = s[0]
for ch in s[1:]:
	if p_1 != ch:
		print('YES')
		print(p_1, ch, sep='')
		flag = True
		break
	else:
		p_1 = ch
if not flag:
	print('NO')


n = int(input())
s = list(input())
c = 0
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		c = 1
		break
if c == 0:
	print('NO')


x = int(input())
s = input()
s = list(s)
ye = False
for i in range(0, len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		ye = True
		break
if ye == False:
	print('NO')


length = int(input())

def AllSubsets(s):
	l = []
	for i in range(len(s)):
		if i < len(s) - 1:
			for j in range(i + 2, len(s) + 1):
				l += [s[i:j]]
		else:
			l += [s[i]]
	return l

def diverse(st):
	for z in range(len(st)):
		if st.count(st[z]) > len(st) // 2:
			return 0
		elif z == len(st) - 1:
			return 1

def output(l):
	for sub in l:
		if diverse(sub) == 1:
			print('YES')
			print(sub)
			break
	else:
		print('NO')
output(AllSubsets(input()))


n = int(input())
S = input()
N = 0
for i in range(0, n - 1):
	if S[i] != S[i + 1]:
		print('YES')
		print(S[i] + S[i + 1])
		N = 1
		break
if N == 0:
	print('NO')


input()
s = input()
for (ch1, ch2) in zip(s, s[1:]):
	if ch1 != ch2:
		print('YES', ch1 + ch2, sep='\n')
		break
else:
	print('NO')


n = int(input())
a = input()
s1 = 0
s2 = 0
error = 1
for i in range(n):
	if i == 0:
		s1 = a[i]
		continue
	s2 = s1
	s1 = a[i]
	if s1 != s2:
		error = 0
		break
if error == 0:
	print('YES')
	print(a[i - 1:i + 1])
else:
	print('NO')


from collections import Counter

def main():
	n = int(input())
	string = input()
	prev = '-'
	for i in range(n - 1):
		if string[i] != string[i + 1]:
			print('YES')
			print(string[i:i + 2])
			return
	print('NO')
main()


n = int(input())
s = input()
flag = 0
for i in range(1, n):
	if s[i - 1] != s[i]:
		a = s[i - 1] + s[i]
		print('YES')
		print(a)
		flag = 1
		break
if flag == 0:
	print('NO')


import sys
from math import *

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

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
n = mint()
s = minp()
r = None
for i in range(n - 1):
	if s[i] != s[i + 1]:
		r = s[i] + s[i + 1]
		break
if r != None:
	print('YES')
	print(r)
else:
	print('NO')


from collections import Counter

def main():
	n = int(input())
	s = input()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			return 'YES\n' + s[i] + s[i + 1]
	return 'NO'
res = main()
print(res)


n = eval(input())
s = input()

def check(s):
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i] + s[i + 1])
			return
	print('NO')
check(s)


n = int(input())
s = input()
i = 0
found = False
while i < n - 1:
	if s[i] != s[i + 1]:
		found = True
		break
	i += 1
if found:
	print('YES')
	print(s[i:i + 2])
else:
	print('NO')


import math as m
string_size = int(input())
string = input()
if string_size == 1:
	print('NO')
else:
	counting = 1
	first = string[0]
	for c in string:
		if c != first:
			counting += 1
			first += c
			break
		else:
			first = c
	if counting == 1:
		print('NO')
	else:
		print('YES')
		print(first)


n = int(input())
A = input()
i = -1
for j in range(1, len(A)):
	if A[j] != A[j - 1]:
		i = j
if i == -1:
	print('NO')
else:
	print('YES')
	print(A[i - 1] + A[i])


n = int(input())
s = input()
flag = 0
for i in range(len(s)):
	if i > 0 and s[i] != s[i - 1]:
		flag = i
if flag == 0:
	print('NO')
else:
	print('YES')
	print(s[flag - 1:flag + 1])


n = int(input())
s = input()
found = False
i = 0
while i < n - 1 and (not found):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i], s[i + 1], sep='')
		found = True
	i += 1
if not found:
	print('NO')


n = int(input())
p = list(input())
j = []
for d in range(n - 1):
	if p[d] == p[d + 1]:
		pass
	else:
		j.append(p[d])
		j.append(p[d + 1])
		break
if j == list():
	print('NO')
else:
	print('YES')
	print(''.join(j))


n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		quit()
print('NO')


input()
t = input()
s = list(set([t[i:i + 2] for i in range(len(t) - 1)]))
if len(set(t)) == 1:
	print('NO')
else:
	for i in s:
		if i[0] != i[1]:
			print('YES' + '\n' + i)
			break


n = int(input())
st = input()
if ord(min(st)) == ord(max(st)):
	print('NO')
else:
	print('YES')
	for i in range(n - 1):
		if st[i] != st[i + 1]:
			print(st[i:i + 2])
			break


n = int(input())
s = input()
arr = [0] * 26
for i in s:
	arr[ord(i) - 97] += 1
t = n // 2
flag = 0
for i in range(26):
	if arr[i] == n:
		print('NO')
		flag = 1
		break
if flag == 0:
	print('YES')
	for i in range(1, n):
		if s[i - 1] != s[i]:
			a = s[i - 1] + s[i]
			print(a)
			break


(n, a) = (int(input()), list(input()))
for i in range(n - 1):
	if a[i:i + 2] == list(dict.fromkeys(a[i:i + 2])):
		print('YES')
		print(''.join(a[i:i + 2]))
		exit()
print('NO')


n = int(input())
words = str(input())
if n == 1:
	print('NO')
else:
	for i in range(len(words) - 1):
		sub = words[i] + words[i + 1]
		if not words[i] == words[i + 1]:
			print('YES')
			print(sub)
			break
		else:
			i = i + 1
			sub = ''
	if sub == '':
		print('NO')


b = int(input())
a = input()
done = 0
for i in range(len(a) - 1):
	if not a[i] == a[i + 1]:
		print('YES')
		print(a[i] + a[i + 1])
		done = 1
		break
if done == 0:
	print('NO')


n = int(input())
s = input()
for start in range(n):
	acc = {}
	for end in range(start, n):
		char = s[end]
		acc[char] = acc[char] + 1 if char in acc else 1
		l2 = (end - start + 1) // 2
		for char in acc:
			if acc[char] > l2:
				break
		else:
			print('YES', s[start:end + 1], sep='\n')
			exit()
print('NO')


def diverse(s):
	L = len(s)
	for x in set(s):
		if s.count(x) > L / 2:
			return False
	return True

def program():
	n = int(input())
	s = input()
	for L in range(1, min(3, len(s) + 1)):
		for start in range(0, len(s) - L + 1):
			sub = s[start:start + L]
			if diverse(sub):
				print('YES\n' + sub)
				return
	print('NO')
program()


from sys import stdin

def main():
	N = int(input())
	S = input()
	for i in range(N - 1):
		if S[i] != S[i + 1]:
			print('YES')
			print(S[i:i + 2])
			break
	else:
		print('NO')
input = lambda : stdin.readline().rstrip()
main()


N = int(input())
s = input()
for i in range(1, N):
	if s[i] != s[i - 1]:
		print('YES')
		print(s[i - 1] + s[i])
		exit()
print('NO')


n = int(input())
word = input()
for i in range(len(word) - 1):
	temp = word[i:i + 2]
	if len(set(temp)) == 2:
		print('YES')
		print(temp)
		break
else:
	print('NO')


n = int(input())
a = input()
can = False
for i in range(n - 1):
	if a[i] != a[i + 1]:
		can = True
		ans = a[i:i + 2]
		break
if can:
	print('YES')
	print(ans)
else:
	print('NO')


a = int(input())
b = input()
if len(set(b)) == 1:
	print('NO')
else:
	print('YES')
	for i in range(a - 1):
		if b[i] != b[i + 1]:
			print(b[i] + b[i + 1])
			exit()


import sys
n = int(input())
s = input()
s = list(s)
for i in range(len(s)):
	if i >= 1:
		if s[i] != s[i - 1]:
			print('YES')
			print(s[i - 1] + s[i])
			sys.exit()
print('No')


x = int(input())
s = input()
if s.count(s[0]) == s.__len__():
	print('NO')
else:
	print('YES')
	for i in range(x):
		if not s[i] == s[0]:
			print(s[i - 1] + s[i])
			break


n = input()
s = input()
for i in range(0, len(s) - 1):
	if s[i] != s[i + 1]:
		print('Yes')
		print(s[i] + s[i + 1])
		exit()
print('No')


number = int(input())
string = input()
point = 0
for i in range(len(string) - 1):
	if string[i] != string[i + 1]:
		print('YES')
		print(string[i] + string[i + 1])
		point += 1
		break
if point == 0:
	print('NO')


n = int(input())
st = str(input())
flag = 0
for i in range(n - 1):
	if st[i] != st[i + 1]:
		print('YES')
		print(st[i:i + 2])
		flag = 1
		break
if flag == 0:
	print('NO')


x = int(input())
p = input()
if len(set(p)) == 1:
	print('NO')
	exit()
for i in range(x):
	if p[i] != p[i + 1]:
		exit(print('YES', p[i] + p[i + 1], sep='\n'))


from sys import *
from math import *
from sys import stdin, stdout
from collections import *
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)

def ans():
	l = int(input())
	s = str(input())
	if l == 1:
		print('NO')
		return
	for i in range(l):
		for j in range(i + 1, l):
			if s[i] != s[i + 1]:
				print('YES')
				print(s[i] + s[i + 1])
				return
	print('NO')
	return
ans()


n = int(input())
s = input()
answer = 'NO'
substring = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		answer = 'YES'
		substring = s[i] + s[i + 1]
		break
print(answer)
if answer == 'YES':
	print(substring)


n = int(input())
a = input()
flag = False
for i in range(1, n):
	if a[i - 1] != a[i]:
		print('YES')
		print(a[i - 1] + a[i])
		flag = True
		break
if not flag:
	print('NO')


n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		return
print('NO')


n = int(input())
s = input()
f = s[0]
for c in s:
	if c != f:
		print('YES')
		print(f + c)
		return
print('NO')


n = int(input())
s = input()
flag = False
ans = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		flag = True
		ans += s[i]
		ans += s[i + 1]
		break
if flag:
	print('Yes')
	print(ans)
else:
	print('No')


read = lambda : [int(i) for i in input().split()]
n = read()[0]
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES\n' + s[i] + s[i + 1])
		exit(0)
print('NO')


n = int(input())
s = input()
mp = {}
ans = 0
z = ''
h = 0
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		h = 1
		z += s[i] + s[i + 1]
		break
if h == 0:
	print('NO')
else:
	print('YES')
	print(z)


import sys
z = int(input())
x = input()
for i in range(0, z - 1):
	if x[i] != x[i + 1]:
		print('YES')
		print(x[i], x[i + 1], sep='')
		sys.exit(0)
print('NO')


n = int(input())
s = input()
s_ = sorted(s)
if s_[-1] == s_[0]:
	print('NO')
else:
	print('YES')
	r = ''
	for i in range(1, n):
		if s[i] != s[i - 1]:
			r += s[i - 1]
			r += s[i]
			break
	print(r)


n = int(input())
strs = input()
i = 1
boolean = False
ia = -1
ja = -1
while i < len(strs):
	if strs[i] != strs[i - 1]:
		boolean = True
		ia = i
		ja = i - 1
		break
	i += 1
if boolean == False:
	print('NO')
else:
	print('YES')
	print(strs[ja:ia + 1])


(l, s) = (int(input()), input())
p = -1
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		p = i
if p == -1:
	print('NO')
else:
	print('YES')
	print(s[p:p + 2])


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x) + '\n')
n = get_int()
s = get_string()
flag = False
res = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		res = s[i] + s[i + 1]
		flag = True
		break
if flag:
	print('YES')
	print(res)
else:
	print('NO')


k = int(input())
s1 = input()
n = ''
f = 0
for i in range(k - 1):
	if s1[i] != s1[i + 1]:
		f = 1
		n += s1[i] + s1[i + 1]
		break
if f == 1:
	print('YES')
	print(n)
else:
	print('NO')


import sys
import queue

def FILE_IO():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
n = int(input())
s = list(input())
for i in range(1, n):
	if s[i] != s[i - 1]:
		print('YES')
		print(''.join(s[i - 1:i + 1]))
		exit(0)
print('NO')


def test_0():
	import math
	from collections import Counter
	n = list(map(int, input().split(' ')))[0]
	ss = input()
	aa = ''
	for i in range(n - 1):
		if ss[i] != ss[i + 1]:
			aa = ss[i:i + 2]
			break
	if aa == '':
		print('NO')
	else:
		print('YES')
		print(aa)
test_0()


n = int(input())
s = input()
l = len(s)
if s.count(s[0]) == l:
	print('NO')
else:
	crnt = s[0]
	for i in range(1, l):
		if s[i] != crnt:
			break
		else:
			crnt = s[i]
	print('YES')
	print(crnt + s[i])


from sys import stdin, stdout
from math import sin, tan, cos
n = int(stdin.readline())
s = stdin.readline().strip()
if s.count(s[0]) == len(s):
	stdout.write('NO')
else:
	stdout.write('YES\n')
	for i in range(1, len(s)):
		if s[i] != s[i - 1]:
			stdout.write(s[i - 1] + s[i])
			break


n = input()
s = input()
prev = s[0]
t = 0
for item in s[1:]:
	if item != prev:
		print('YES')
		print(prev + item)
		t = 1
		break
	prev = item
if t == 0:
	print('NO')


def g_couple(itr):
	a = next(itr)
	for b in itr:
		yield (a, b)
		a = b

def main():
	n = int(input())
	s = input()
	for (a, b) in g_couple(iter(s)):
		if a != b:
			print('YES')
			print(a + b)
			return
	print('NO')
main()


def read():
	return int(input())

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

def readmap():
	return map(int, input().split())
n = read()
s = input()
for i in range(n):
	if i == n - 1:
		print('NO')
		quit()
	elif s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		quit()


Input = lambda : map(int, input().split())
n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		exit()
print('NO')


n = input()
a = input()
diff_str = []
for i in a.strip():
	if i not in diff_str:
		diff_str.append(i)
		if len(diff_str) == 2:
			print('YES')
			print(''.join(diff_str))
			break
	else:
		diff_str = [i]
else:
	print('NO')


n = int(input())
l = input()
s = set(l)
if len(s) == 1:
	print('NO')
else:
	print('YES')
	for x in range(1, n):
		if l[x] != l[0]:
			print(l[0] + l[x])
			break


n = int(input())
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	print('YES')
	z = s[0]
	for i in s:
		if i != z:
			z += i
			break
	print(z)


n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('Yes\n' + s[i] + s[i + 1])
		break
else:
	print('No')


n = int(input())
st = input()
if n == 1:
	print('NO')
else:
	check = False
	for i in range(0, n - 1):
		if st[i] != st[i + 1]:
			check = True
			break
	if check:
		print('YES')
		print(st[i] + st[i + 1])
	else:
		print('NO')


input()
word = input()
ans = 'NO'
subs = ''
for x in range(len(word)):
	if x + 1 >= len(word):
		continue
	if word[x] is not word[x + 1]:
		ans = 'YES'
		subs = word[x:x + 2]
		break
print(ans)
if ans is 'YES':
	print(subs)


n = int(input())
s = input()
flag = 0
for i in range(n):
	c = 0
	d = {}
	w = ''
	for j in range(i, n):
		c += 1
		k = 0
		w += s[j]
		if s[j] in d:
			d[s[j]] += 1
		else:
			d[s[j]] = 1
		for j in d.items():
			if j[1] <= c // 2:
				k += 1
		if k == len(d.items()):
			print('YES')
			print(w)
			flag = 1
			break
	if flag == 1:
		break
if flag == 0:
	print('NO')


n = int(input())
r = input()
l = len(r)
for i in range(l - 1):
	if r[i] != r[i + 1]:
		print('YES')
		print(r[i] + r[i + 1])
		return
print('NO')


n = int(input())
s = input()
first_letter = s[0]
if n == 1:
	print('NO')
	exit(0)
for char in s[1:]:
	if char != first_letter:
		print('YES')
		print(first_letter + char)
		break
else:
	print('NO')


n = int(input())
s = input()[:n]
b = False
for i in range(1, len(s)):
	if s[i] != s[i - 1]:
		print('YES\n%s' % (s[i - 1] + s[i]))
		b = True
		break
print('NO\n' if not b else '', end='')


m = int(input())
s = str(input())
i = 0
while i + 1 < m:
	if s[i + 1] == s[i]:
		i = i + 1
		continue
	else:
		print('YES')
		print(s[i:i + 2])
		break
if i == m - 1:
	print('NO')


import sys
n = int(input())
s = input()
for i in range(len(s) - 1):
	if ord(s[i]) != ord(s[i + 1]):
		print('YES')
		print(s[i] + s[i + 1])
		sys.exit()
print('NO')


N = int(input())
s = str(input())
for i in range(N - 1):
	b = s[i]
	if b != s[i + 1]:
		print('YES')
		print(b + s[i + 1])
		break
else:
	print('NO')


n = int(input())
s = input()
c = s[0]
for i in s:
	if i != c:
		print('YES')
		print(c + i)
		exit()
print('NO')


n = input()
s = input()
len = 0
prev = ''
after = ''
for i in s:
	if prev == '':
		prev = i
		len = 1
	elif i != prev:
		len = 2
		after = i
		break
if len == 2:
	print('YES')
	prev += after
	print(prev)
else:
	print('NO')


import sys
n = int(input())
s = input()
for i in range(1, n):
	if s[i] != s[i - 1]:
		print('YES')
		print(s[i - 1] + s[i])
		return
print('NO')


n = int(input())
l1 = input()
l = list(l1)
k = 0
for i in range(n - 1):
	if l[i] != l[i + 1]:
		print('YES')
		print(l1[i] + l1[i + 1])
		k = 1
		break
if k != 1:
	print('NO')


n = int(input())
s = input()
if len(set(list(s))) == 1:
	print('NO')
else:
	for (x, y) in zip(s, s[1:]):
		if x != y:
			print('YES')
			print(x + y)
			break


a = input()
line = input()
n = len(line)
str = []
for i in range(n):
	if i == 0:
		str.append(line[i])
	if line[i] not in str:
		print('YES')
		print(line[i - 1:i + 1])
		exit()
print('NO')


from collections import Counter
n = int(input())
s = input()
stop = False
for i in range(n - 1):
	c = Counter(s[i:i + 2])
	if max(c.values()) * 2 <= 2:
		print('YES')
		print(s[i:i + 2])
		stop = True
	if stop:
		break
if not stop:
	print('NO')


import sys
n = int(sys.stdin.readline())
p = sys.stdin.readline()[0:-1]
q = False
for i in range(n - 1):
	if p[i] != p[i + 1]:
		q = True
	if q == True:
		print('YES')
		print(p[i] + p[i + 1])
		break
if q == False:
	print('NO')


n = int(input())
s = list(input())
if all((s[i] == s[0] for i in range(n))):
	print('NO')
else:
	for i in range(0, n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i] + s[i + 1])
			break


n = input()
s = input()

def pexit(s):
	print(s)
	exit()
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		pexit('YES\n' + s[i] + s[i + 1])
else:
	pexit('NO')


n = int(input())
ts = str(input())
i = 0
a = ''
while i <= n - 2:
	if ts[i] != ts[i + 1]:
		a += ts[i]
		a += ts[i + 1]
		break
	i += 1
if len(a) > 0:
	print('YES')
	print(a)
else:
	print('NO')


n = int(input())
str = input()
if len(set(str)) >= 2:
	print('YES')
else:
	print('NO')
	exit()
for i in range(0, n - 1):
	a = str[i]
	if str[i + 1] != a:
		print(str[i:i + 2])
		exit()


n = int(input())
s = input()
if n == 1:
	print('NO')
else:
	i = 0
	g = 0
	while s[i] == s[0]:
		i += 1
		if i == n:
			g += 1
			break
	if g == 1:
		print('NO')
	else:
		print('YES')
		print(s[i - 1] + s[i])


input()
s = input()
try:
	r = 'YES\n' + s[0] + next((c for c in s if c != s[0]))
except:
	r = 'NO'
print(r)


def fun(s, n):
	for i in range(1, n):
		if s[i] != s[i - 1]:
			return s[i - 1] + s[i]
	return False
n = int(input())
s = input()
if fun(s, n):
	print('YES')
	print(fun(s, n))
else:
	print('NO')


n = int(input())
s = input()
c = s.count(s[0])
if c == n:
	print('NO')
else:
	print('YES')
	t1 = s[0]
	i = 1
	while t1 == s[i]:
		t1 = s[i]
		i += 1
	print(t1 + s[i])


N = int(input())
string = input().strip()
ans = []
for i in range(1, N):
	if string[i - 1] == string[i]:
		continue
	else:
		ans.append(string[i - 1])
		ans.append(string[i])
		break
if len(ans) == 0:
	print('NO')
else:
	print('YES')
	print(*ans, sep='')


n = int(input())
k = input()
c = False
for i in range(n - 1):
	if k[i] != k[i + 1]:
		print('YES\n' + str(k[i] + k[i + 1]))
		c = True
		break
if c == False:
	print('NO')


N = int(input())
a = list(input())
if a.count(a[0]) == N:
	print('NO')
else:
	for i in range(0, N - 1):
		if a[i] != a[i + 1]:
			S = a[i] + a[i + 1]
			break
	print('YES')
	print(S)


input()
x = list(input())

def go():
	for i in range(len(x)):
		if x[i] != x[0]:
			print('YES')
			print(x[0] + x[i])
			return
	print('NO')
go()


am = int(input())
data = list(input())
for i in range(am - 1):
	if data[i] != data[i + 1]:
		print('YES')
		print(data[i] + data[i + 1])
		break
else:
	print('NO')


y = int(input())
x = input()
for i in range(y):
	if len(set(x[i:i + 2])) == 2:
		print('YES')
		print(x[i:i + 2])
		quit()
print('NO')


n = int(input())
s = input()

def subs(n, s):
	for i in range(1, n):
		if s[i - 1] != s[i]:
			print('YES')
			print(s[i - 1:i + 1])
			return
	print('NO')
	return
subs(n, s)


(n, h) = (int(input()), input())
for i in range(n - 1):
	if h[i] != h[i + 1]:
		print('YES')
		print(h[i], h[i + 1], sep='')
		exit()
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 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
x = nu()
n = input()
le = len(n)
for i in range(le):
	fr = [0] * 26
	s = ''
	z = ''
	cc = 0
	mx = -1
	for j in range(i, le):
		z += n[j]
		fr[ord(n[j]) - 97] += 1
		cc += 1
		pp = cc // 2
		fl = True
		mx = max(fr[ord(n[j]) - 97], mx)
		if mx > pp:
			fl = False
		if fl == True:
			print('YES')
			print(z)
			exit(0)
print('NO')


input()
a = list(dict.fromkeys(input()))
print(['NO', 'YES\n' + ''.join(a[:2])][len(a) > 1])


n = int(input())
a = input()
b = False
x = ''
for i in range(n - 1):
	if a[i] != a[i + 1]:
		b = True
		x = a[i] + a[i + 1]
		break
if b:
	print('YES')
	print(x)
else:
	print('NO')


(n, str) = (int(input()), input())
for i in range(n - 1):
	if str[i] != str[i + 1]:
		print('YES\n' + str[i:i + 2])
		exit()
print('NO')


from collections import defaultdict
length = int(input())
s = input()
for i in range(length - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		exit(0)
print('NO')


n = int(input())
l = list(input())
for i in range(n - 1):
	if l[i] != l[i + 1]:
		print('YES')
		print(l[i], l[i + 1], sep='')
		exit()
print('NO')


import collections
n = int(input())
a = input()
l = list(a)
i = 1
flag = 0
while i < n:
	if a[i] != a[i - 1]:
		flag = 1
		break
	i += 1
if flag == 0:
	print('NO')
else:
	print('YES')
	print(a[i - 1] + a[i])


n = int(input())
a = input()
mb = False
for x in range(n - 1):
	s = set()
	line = a[x:x + 2]
	for i in range(2):
		s.add(line[i])
	if len(s) > 1:
		print('YES')
		print(line)
		exit()
print('NO')


n = int(input())
k = input()
ans = ''
temp = 0
for i in range(len(k) - 1):
	if k[i] != k[i + 1]:
		ans += k[i]
		ans += k[i + 1]
		print('YES')
		print(ans)
		temp = 1
		break
if temp == 0:
	print('NO')


n = int(input())
s = list(input())
if s.count(s[0]) == n:
	print('NO')
else:
	ans = ''
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			ans = s[i] + s[i + 1]
			break
		i = i + 1
	print('YES')
	print(ans)


n = int(input())
arr = list(input().strip())
if arr.count(arr[0]) != n:
	print('YES')
	for i in range(n - 1):
		if arr[i] != arr[i + 1]:
			print(arr[i] + arr[i + 1])
			break
else:
	print('NO')


from collections import Counter
n = int(input())
string = str(input())
flag = 0
for i in range(len(string) - 1):
	if string[i] == string[i + 1]:
		continue
	else:
		flag = 1
		break
	if flag == 1:
		break
if flag == 1:
	print('YES')
	print(string[i], end='')
	print(string[i + 1], end='\n')
else:
	print('NO')


import sys, time, os
from pprint import pprint as pp
if os.environ.get('_ONPC_', False):
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')
	sys.stdin = stdin
	sys.stdout = stdout
	now = time.time()
	__flag = True
else:
	__flag = False

def what(obj):
	if __flag:
		pp(obj, sys.stderr)

def f(x, y):
	res = {}
	for (key, item) in y.items():
		res[key] = item - x[key]
	return res
from collections import defaultdict
n = int(input())
s = input()
a = [defaultdict(int)]
for el in s:
	t = a[-1].copy()
	t[el] += 1
	a.append(t)
for i in range(n + 1):
	for j in range(i + 1, n + 1):
		if max(f(a[i], a[j]).values()) <= (j - i) // 2:
			print('YES')
			print(s[i:j])
			exit()
print('NO')
if __flag:
	stdout.close()
	stdin.close()
	print(time.time() - now, file=sys.stderr)


n = int(input())
s = input()
for j in range(n):
	a = [0] * 26
	for k in range(1, n - j):
		flag = 1
		for i in s[j:j + k + 1]:
			x = ord(i) - 97
			a[x] += 1
			if a[x] > (k + 1) // 2:
				flag = 0
				break
		if flag == 1:
			print('YES')
			print(s[j:j + k + 1])
			exit()
print('NO')


n = int(input())
s = input()
no = True
d = ''
for i in range(1, n):
	if s[i - 1] != s[i]:
		no = False
		d = s[i - 1] + s[i]
		break
if not no:
	print('YES')
	print(d)
else:
	print('NO')


n = int(input())
s = list(input())
v = s
q = 0
m = str()
for i in range(n):
	x = 0
	for j in range(n):
		if v[j] == v[i]:
			x += 1
if x == n:
	print('no')
elif n == 1:
	print('no')
else:
	print('yes')
	for i in range(1, n):
		if v[i] != v[i - 1]:
			m = str(v[i - 1]) + str(v[i])
	print(m)


def main():
	value = input()
	value = int(value)
	values = input()
	found = False
	for i in range(len(values)):
		if i + 1 < len(values):
			if found == False and values[i] != values[i + 1]:
				print('YES')
				print(values[i] + values[i + 1])
				found = True
	if found == False:
		print('NO')
main()


n = int(input())
s = input()
k = -1
for i in range(n - 1):
	if s[i] != s[i + 1]:
		k = i
if k == -1:
	print('NO')
else:
	print('YES')
	print(s[k] + s[k + 1])


def main(args):
	n = int(input())
	s = input()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i:i + 2])
			return 0
	print('NO')
	return 0
import sys
sys.exit(main(sys.argv))


n = int(input())
g = input()
for i in range(n - 1):
	j = i + 1
	if g[i] != g[j]:
		print('YES')
		print(g[i] + g[j])
		exit()
print('NO')


def go(s, n):
	dict1 = {}
	for i in range(n - 1):
		dict1 = {}
		if i in dict1:
			dict1[s[i]] += 1
		else:
			dict1[s[i]] = 1
		max1 = 1
		for j in range(i + 1, len(s)):
			if s[j] in dict1:
				dict1[s[j]] += 1
				max1 = max(max1, dict1[s[j]])
				if max1 <= (j - i + 1) // 2:
					print('YES')
					print(s[i:j + 1])
					return
			else:
				dict1[s[j]] = 1
				max1 = max(max1, dict1[s[j]])
				if max1 <= (j - i + 1) // 2:
					print('YES')
					print(s[i:j + 1])
					return
	print('NO')
n = int(input())
s = input()
go(s, n)


input()
s = input()
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		return
print('NO')


n = int(input())
a = input()
b = list(a)
flag = 0
for i in range(0, len(b) - 1):
	if b[i] != b[i + 1]:
		print('YES')
		print(b[i] + b[i + 1])
		flag = 1
		break
if flag == 0:
	print('NO')


n = int(input())
st = input()
for i in range(n - 1):
	if st[i] != st[i + 1]:
		print('YES')
		print(st[i:i + 2])
		exit(0)
print('NO')


n = int(input())
s = input()
if n == 1:
	print('NO')
else:
	for x in range(n - 1):
		(a, b) = (s[x], s[x + 1])
		if a != b:
			print('YES')
			print(a + b)
			break
	else:
		print('NO')


n = int(input().strip())
s = input().strip()
c = ''
k = 0
for j in range(n - 1):
	if s[j] != s[j + 1]:
		k = 1
		c = s[j] + s[j + 1]
		break
if k:
	print('YES')
	print(c)
else:
	print('NO')


n = int(input())
given_string = input()
dummy = 0
for i in range(0, n - 1):
	if given_string[i] != given_string[i + 1]:
		print('YES')
		print(given_string[i:i + 2])
		dummy = 1
		break
if dummy == 0:
	print('NO')


from sys import exit
n = int(input())
s = input()
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		exit(0)
print('NO')


str_len = int(input())
inp_str = input()
fl = inp_str[0]
for i in range(str_len):
	if inp_str[i] != fl:
		print('YES')
		print(inp_str[i - 1] + inp_str[i])
		break
else:
	print('NO')


length = int(input())
string = input()
for i in range(0, length - 1):
	letter1 = string[i]
	letter2 = string[i + 1]
	if letter1 != letter2:
		print('YES')
		print(letter1 + letter2)
		break
else:
	print('NO')


n = int(input())
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	print('YES')
	for j in range(len(s) - 1):
		if s[j] != s[j + 1]:
			print(s[j] + s[j + 1])
			break


import re

def main(args):
	n = int(input())
	s = input()
	d = [a + b for (a, b) in zip(s[:-1], s[1:]) if a != b]
	if d:
		print('YES')
		print(d.pop())
	else:
		print('NO')
	return 0
import sys
sys.exit(main(sys.argv))


def main():
	input()
	string = list(input())
	for i in range(len(string) - 1):
		if string[i] != string[i + 1]:
			print('YES')
			print(''.join(string[i:i + 2]))
			exit(0)
	print('NO')
main()


n = int(input())
str = input()
ans = ''
for c in range(n - 1):
	if str[c] != str[c + 1]:
		ans = str[c] + str[c + 1]
		break
if len(ans) > 0:
	print('YES')
	print(ans)
else:
	print('NO')


def main():
	n = int(input())
	s = input()
	last = s[0]
	for c in s:
		if c != last:
			print('YES')
			print(last + c)
			break
		else:
			last = c
	else:
		print('NO')
main()


def checkStringForDiverse(strToCheck):
	strLength = len(strToCheck)
	for index in (0, len(strToCheck) - 1):
		if strToCheck.count(strToCheck[index]) / strLength > 0.5:
			continue
		else:
			return 1
	return 0

def checkDiverse(str1):
	strLength = len(str1)
	for n in range(2, strLength + 1):
		for p in range(0, strLength - n + 1):
			strToCheck = str1[p:p + n]
			resultOfStrCheck = checkStringForDiverse(strToCheck)
			if resultOfStrCheck == 1:
				return strToCheck
			else:
				continue
	return 0

def diverseString():
	n = input()
	n = input()
	checkSubString = checkDiverse(n)
	if checkSubString != 0:
		print('YES')
		print(checkSubString)
	else:
		print('NO')
diverseString()


import sys
import bisect
t = 1

def solve():
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			return s[i] + s[i + 1]
	return 'NO'
mod = 10 ** 9 + 7
for _ in range(t):
	n = int(input())
	s = input()
	print(solve())


_ = input()
s = input()
ans = None
for (a, b) in zip(s, s[1:]):
	if a != b:
		ans = a + b
		break
if ans:
	print('YES')
	print(ans)
else:
	print('NO')


n = int(input())
stroka = str(input())
for el in range(n):
	try:
		if stroka[el] != stroka[el + 1]:
			print('YES')
			print(stroka[el] + stroka[el + 1], sep='')
			raise SystemExit
	except IndexError:
		break
print('No')


n = int(input())
s = input()

def f():
	for i in range(n):
		occ = [0] * 26
		for j in range(i, n):
			occ[ord(s[j]) - 97] += 1
			hl = (j - i + 1) / 2
			if all((o <= hl for o in occ)):
				return s[i:j + 1]
	return None
ans = f()
if ans is None:
	print('NO')
else:
	print('YES')
	print(ans)


def get_diverse(string):
	if string == string[0] * n:
		return ''
	for idx in range(len(string) - 1):
		if string[idx] != string[idx + 1]:
			return string[idx] + string[idx + 1]
n = int(input())
string = input()
result = get_diverse(string)
if result:
	print('YES')
	print(result)
else:
	print('NO')


import math
import sys
import re

def func(n, s):
	if n == 1:
		return 'NO'
	else:
		a = s[0]
		for x in s[1:]:
			if x != a:
				a = a + x
				print('YES')
				return a
			else:
				a = x
	return 'NO'
n = int(input())
s = input()
print(func(n, s))


n = int(input())
s = input()
k = 0
for i in range(0, len(s) - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		k = 1
		break
if k == 0:
	print('NO')


length = int(input(''))
word = input('')

def diverse(s, l):
	check = False
	count = 0
	while count < l - 1:
		if word[count] == word[count + 1]:
			count += 1
		else:
			check = True
			return (check, word[count] + word[count + 1])
			break
	return (check, word[count - 1] + word[count])
if diverse(word, length)[0] == True:
	print('YES')
	print(diverse(word, length)[1])
else:
	print('NO')


n = int(input())
st = input()
for i in range(len(st)):
	d = dict()
	check = False
	for j in range(i, len(st)):
		if st[j] not in d:
			d[st[j]] = 1
		else:
			d[st[j]] += 1
		check = True
		for k in d.keys():
			if d[k] > (j - i + 1) // 2:
				check = False
		if check:
			print('YES')
			print(st[i:j + 1])
			exit()
print('NO')


n = int(input())
s = str(input())
if s.count(s[0]) == n:
	print('NO')
else:
	print('YES')
	for i in range(1, n):
		if s[i - 1] != s[i]:
			print(s[i - 1:i + 1])
			break


input()
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			print('YES', s[i] + s[i + 1], sep='\n')
			exit()


n = int(input())
s = input()
ans = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		ans = 'Yes\n{}{}'.format(s[i], s[i + 1])
		break
if ans == '':
	print('NO')
else:
	print(ans)


input()
b = input()
if len(set(b)) == 1:
	print('NO')
else:
	print('YES')
	z = ''
	for i in b:
		if i not in z:
			z += i
		if len(z) == 2:
			print(z)
			break


n = int(input())
string = input()
resp = 0
for i in range(1, n):
	if string[i] != string[i - 1]:
		resp += 1
		print('YES')
		print('%s%s' % (string[i - 1], string[i]))
		break
if resp != 1:
	print('NO')


x1 = input()
x2 = input()
k = 0
for i in range(len(x2) - 1):
	if x2[i] != x2[i + 1]:
		print('YES')
		print(x2[i] + x2[i + 1])
		k = 1
		break
if k == 0:
	print('NO')


import math
length_of_string = int(input())
string = input()
half_length = math.floor(length_of_string / 2)

def get_all_substrings(input_string, length_of_string):
	return [input_string[i:j + 1] for i in range(length_of_string) for j in range(i, length_of_string)]

def diverse_string(input_string):
	for letter in input_string:
		if input_string.count(letter) > math.floor(len(input_string) / 2):
			return False
	return True
flag = 0
for individual_string in get_all_substrings(string, length_of_string):
	if diverse_string(individual_string):
		print('YES')
		print(individual_string)
		flag = 1
		break
if flag == 0:
	print('NO')


def main():
	n = int(input())
	s = input()
	if len(set(s)) == 1:
		print('NO')
	else:
		print('YES')
		for i in range(n - 1):
			if s[i] != s[i + 1]:
				print(s[i] + s[i + 1])
				return
main()


a = input()
string = input()

def find(string):
	for i in range(len(string) - 1):
		if string[i] != string[i + 1]:
			print('YES')
			print(string[i:i + 2])
			return
	print('NO')
find(string)


n = int(input())
st = input()
ch = st[0]
count = st.count(ch)
if count == n:
	print('NO')
else:
	print('YES')
	for i in range(n - 1):
		if st[i] != st[i + 1]:
			print(st[i] + st[i + 1])
			break


def substr():
	n = int(input())
	s = input()
	if n == 1:
		print('NO')
		return 0
	for i in range(1, n):
		if s[i - 1] != s[i]:
			print('YES')
			print(s[i - 1] + s[i])
			return 0
	print('NO')
	return 0
substr()


def main():
	_ = input()
	n = input()
	for i in range(len(n) - 1):
		if n[i] != n[i + 1]:
			print('YES')
			print(n[i:i + 2])
			return
	print('NO')
main()


n = int(input())
s = input()
ans = False
k = ''
for i in range(n - 1):
	if s[i] != s[i + 1]:
		ans = True
		k = s[i] + s[i + 1]
		break
if ans:
	print('YES')
	print(k)
else:
	print('NO')


n = int(input())
s = list(input())
if sorted(s)[0] == sorted(s)[n - 1]:
	print('NO')
else:
	print('YES')
	for i in range(0, n - 1):
		if s[i] != s[i + 1]:
			g = s[i] + s[i + 1]
			print(g)
			exit()


x = int(input())
arr = input()
correct = False
ans = ['k'] * 2
if x == 1:
	correct = False
else:
	for i in range(1, x):
		if arr[i] != arr[i - 1]:
			ans[0] = arr[i - 1]
			ans[1] = arr[i]
			correct = True
			break
if correct:
	print('YES')
	print(str(ans[0] + ans[1]))
else:
	print('NO')


N = int(input())
S = input()
tmp = ''
for i in range(N):
	s = S[i]
	if i == 0:
		tmp = s
	elif tmp != s:
		ans = tmp + s
		print('YES')
		print(ans)
		exit()
	else:
		tmp = s
print('NO')


n = int(input())
a = input()
m = 'NO'
for i in range(n - 1):
	if a[i] != a[i + 1]:
		m = 'YES'
		break
if m == 'YES':
	print(m, a[i:i + 2], sep='\n')
else:
	print(m)


n = int(input())
s = input()
k = s[0]
for i in s:
	if i != k:
		print('YES')
		print(k + i)
		break
else:
	print('NO')


n = int(input())
s = input()
o = 0
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		o = 1
		break
if o == 0:
	print('NO')


def ans(s):
	i = 0
	while i < n - 1:
		if s[i] != s[i + 1]:
			print('YES')
			return s[i] + s[i + 1]
		i += 1
	return 'NO'
n = int(input())
s = input()
print(ans(s))


n = int(input())
l1 = list(input())
if len(set(l1)) >= 2:
	print('YES')
	print(''.join(list(set(l1))[:2]))
else:
	print('NO')


def get_dict(s):
	result = dict()
	for symb in s:
		result[symb] = int(1 if result.get(symb) == None else result[symb] + 1)
	return result.copy()

def get_min_key(d):
	mincount = 1000
	for key in d.keys():
		if d.get(key) < mincount:
			mincount = d.get(key)
			minkey = key
	return minkey

def main():
	n = input()
	text = input()
	mydict = get_dict(text)
	if len(mydict.keys()) == 1:
		print('NO')
		return
	minkey = get_min_key(mydict)
	for idx in range(len(text)):
		if text[idx] == minkey:
			if idx > 0 and text[idx - 1] != minkey:
				print('YES')
				print(text[idx - 1] + text[idx])
				return
			if idx < len(text) and text[idx + 1] != minkey:
				print('YES')
				print(text[idx] + text[idx + 1])
				return
	print('NO')
main()


n = int(input())
s = input()
f = [0] * 26
for i in s:
	f[ord(i) - ord('a')] += 1
mm = max(f)
if mm == n or n == 1:
	print('NO')
else:
	print('YES')
	ans = ''
	for i in range(0, n - 1):
		if s[i] != s[i + 1]:
			ans += s[i]
			ans += s[i + 1]
			break
	print(ans)


def inint():
	return int(input())

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

def main():
	n = inint()
	s = input()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			print('YES')
			print(s[i] + s[i + 1])
			return
	print('NO')
main()


n = int(input())
s = input()
tmp = s[0]
for i in s[1:]:
	if i != tmp[-1]:
		tmp += i
if len(tmp) > 1:
	print('YES\n', tmp[:2], sep='')
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
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
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())
s = input()
if N == 1:
	Y(0)
else:
	for i in range(N - 1):
		if s[i] != s[i + 1]:
			Y(1)
			print(s[i] + s[i + 1])
			exit(0)
	Y(0)


def go():
	n = int(input())
	a = [i for i in input()]
	if n == 1:
		print('NO')
		return
	for i in range(n - 1):
		if a[i] != a[i + 1]:
			print('YES')
			print(a[i] + a[i + 1])
			return
	if a[len(a) - 1] != a[len(a) - 2]:
		print('YES')
		print(a[len(a) - 1] + a[len(a) - 2])
		return
	print('NO')
go()


def solution(s, n):
	i = 0
	while i < n - 1 and s[i] == s[i + 1]:
		i += 1
	if i == n - 1:
		print('NO')
	else:
		print('YES\n{}{}'.format(s[i], s[i + 1]))

def main():
	t = int(input())
	s = input()
	solution(s, t)
main()


t = int(input())
n = input()
k = 1
for i in range(len(n) - 1):
	if n[i] != n[i + 1]:
		print('YES')
		print(n[i:i + 2])
		k = 0
		break
if k:
	print('NO')


input()
s = input()
prev = ''
for cur in s:
	if prev not in cur:
		print('YES')
		print(prev + cur)
		break
	prev = cur
else:
	print('NO')


n = int(input())
str2 = str(input())
str1 = list(str2)
flag = 0
for i in range(n - 1):
	if str1[i] != str1[i + 1]:
		print('YES')
		print(str(str2[i:i + 2]))
		flag = 1
		break
if flag == 0:
	print('NO')


n = int(input())
s = input()
ada = False
for i in range(2, n + 1):
	for j in range(0, n - i + 1):
		ss = s[j:j + i]
		ada = True
		for k in ss:
			if ss.count(k) > len(ss) // 2:
				ada = False
				break
		if ada:
			print('YES')
			print(ss)
			break
	if ada:
		break
if not ada:
	print('NO')


n = int(input())
s = input().strip()
for x in range(n - 1):
	if s[x] != s[x + 1]:
		print('YES')
		print(s[x:x + 2])
		exit()
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()]
lens = read_int()
ins = read_str()
ans = 'NO'
ans1 = ''
for i in range(1, lens):
	if ins[i] != ins[i - 1]:
		ans = 'YES'
		ans1 = ins[i - 1:i + 1]
		break
print(ans)
if ans1:
	print(ans1)


n = input()
string = input()
for i in range(1, len(string)):
	if string[i] != string[i - 1]:
		print('YES')
		print(string[i - 1] + string[i])
		exit(0)
print('NO')


n = int(input())
s = list(input())
a = n / 2
d = [0] * 26
f = 0
if len(set(s)) == 1:
	print('NO')
for i in range(n - 1):
	if len(set(s[i:i + 2])) == 2:
		print('YES')
		print(''.join(s[i:i + 2]))
		break


input()
an = ''
S = input()
for (i, q) in enumerate(S):
	if i > 0 and S[i] != S[i - 1]:
		an = S[i - 1:i + 1]
		break
if an != '':
	print('YES')
	print(an)
else:
	print('NO')


n = int(input())
s = list(input())
i = 0
while i < n - 1:
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i] + s[i + 1])
		exit()
	i += 1
print('NO')


n = int(input())
s = input()
if len(set(s)) == 1:
	print('NO')
else:
	for (i, j) in zip(s[:-1], s[1:]):
		if i != j:
			print('YES')
			print(i, j, sep='')
			break


import sys
n = sys.stdin.readline()
fullstring = sys.stdin.readline().rstrip()
saved = fullstring[0]
flag = False
out = ''
for c in fullstring:
	if c != saved:
		out = saved + c
		flag = True
		break
if flag:
	print('YES')
	print(out)
else:
	print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

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

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

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

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

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

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	s = S()
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			return 'YES\n{}'.format(s[i:i + 2])
	return 'NO'
print(main())


n = int(input().strip())
s = input().strip()
found = False
for i in range(n - 1):
	if s[i] != s[i + 1]:
		print('YES')
		print(s[i:i + 2])
		found = True
		break
if not found:
	print('NO')


n = int(input())
string = input()
found = 0
if n == 1:
	print('NO')
else:
	for i in range(0, n - 1):
		if string[i] != string[i + 1]:
			print('YES')
			print(string[i], end='')
			print(string[i + 1])
			found = 1
			break
	if found == 0:
		print('NO')


n = int(input())
s = input().rstrip()
if n == 1:
	print('NO')
	exit()
if s.count(s[0]) == n:
	print('NO')
	exit()
else:
	print('YES')
	for x in range(n):
		for y in range(x + 1, n):
			if s[x] != s[y]:
				print(s[x:y + 1])
				exit()
			elif s[x] == s[y]:
				break


n = int(input())
S = list(input())
from collections import Counter
count = Counter(S)
count = count.items()
if len(count) == 1:
	print('NO')
else:
	ind = 0
	while True:
		if S[ind] != S[ind + 1]:
			print('YES')
			print(S[ind] + S[ind + 1])
			break
		ind += 1


n = input()
s = input()
window_length = 2
i = 0
flage = False
while True:
	if i + window_length > int(n):
		i = 0
		if window_length + 1 <= int(n):
			window_length += 10000
		else:
			break
	substr = s[i:i + window_length]
	i += 1
	counter = {}
	for j in substr:
		flage = True
		if j in counter:
			counter[j] += 1
			if counter[j] > len(substr) / 2:
				flage = False
				break
		else:
			counter[j] = 1
	if flage:
		print('YES')
		print(substr)
		break
if not flage:
	print('NO')


n = int(input())
ch = input()
s = set()
for element in ch:
	s.add(element)

def res(ch):
	i = 0
	while ch[i] == ch[i + 1]:
		i += 1
	return ch[i:i + 2]
if len(s) - 1:
	print('YES', res(ch), sep='\n')
else:
	print('NO')


n = int(input())
a = input()
if len(set(a)) - 1:
	print('YES')
	print(a[0], end='')
	for i in range(1, n):
		if a[i] != a[0]:
			exit(print(a[i]))
print('NO')


n = int(input())
s = input()
for x in range(0, len(s) - 1, +1):
	if s[x] != s[x + 1]:
		print('YES')
		print(s[x] + s[x + 1])
		exit(0)
print('NO')


n = input()
s = input()

def rez(s):
	if len(s) == 1:
		return 'NO'
	else:
		for i in range(len(s)):
			if s[i] != s[0]:
				return 'YES\n' + s[0] + s[i]
	return 'NO'
print(rez(s))


def main():
	n = int(input())
	s = input()
	ans = ''
	i = 0
	while i < n - 1:
		if s[i] == s[i + 1]:
			i += 1
		else:
			ans += s[i]
			ans += s[i + 1]
			break
	if len(ans) > 0:
		print('YES')
		print(ans)
	else:
		print('NO')
main()


n = int(input())
lul = list(input())
if n == 1:
	print('NO')
else:
	sub = []
	for c in range(1, lul.__len__()):
		if lul[c] != lul[c - 1]:
			print('YES')
			print(lul[c - 1] + lul[c])
			break
	else:
		print('NO')


a = int(input())
t = list(input())
p = list(set(t))
s = a // 2
i = 0
if len(p) >= 2:
	print('YES')
	for k in range(a - 2 + 1):
		if len(t[k:k + 2]) == len(set(t[k:k + 2])):
			print(''.join(t[k:k + 2]))
			break
else:
	print('NO')


n = int(input())
f = 0
a = input()
for i in range(n - 1):
	if ord(a[i]) != ord(a[i + 1]):
		print('YES')
		print(str(a[i]) + str(a[i + 1]))
		f = 1
		break
if f == 0:
	print('NO')


n = int(input())
ch = input()
l = list(ch)
i = l.count(l[0])
if i == n:
	print('NO')
else:
	ch1 = l[0]
	l = [j for j in l if j != l[0]]
	ch1 = ch1 + l[0]
	print('YES')
	print(ch1)


import sys
n = int(sys.stdin.readline())
arr = list(sys.stdin.readline().rstrip())
for i in range(n - 1):
	if arr[i] != arr[i + 1]:
		print('YES')
		print(''.join(arr[i:i + 2]))
		sys.exit(0)
print('NO')


import sys
_ = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
for i in range(1, len(s)):
	if s[i - 1] != s[i]:
		print('YES')
		print(s[i - 1] + s[i])
		break
else:
	print('NO')


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline()[0:-1]
c = True
for i in range(n - 1):
	w = s[i:i + 2]
	if w[0] != w[1]:
		print('YES')
		print(w)
		c = False
		break
if c:
	print('NO')


n = int(input())
s = input()
t = s[0]
flag = 0
for letter in s:
	if letter != t:
		print('YES')
		print(t, end='')
		print(letter)
		flag = 1
		break
	else:
		t = letter
if flag == 0:
	print('NO')


n = int(input())
s = input()
for idx in range(n - 1):
	if s[idx] != s[idx + 1]:
		print('YES')
		print(s[idx:idx + 2])
		quit()
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()
ss = input()
for i in range(1, N):
	if ss[i - 1] != ss[i]:
		print('YES')
		print(ss[i - 1:i + 1])
		sys.exit()
print('NO')


import sys
n = input()
s = input()
for caracter in range(len(s) - 1):
	if s[caracter] != s[caracter + 1]:
		print('YES')
		print(s[caracter] + s[caracter + 1])
		sys.exit()
print('NO')


n = int(input())
c = input().strip()
b = True
for i in range(n - 1):
	if c[i] != c[i + 1]:
		if b:
			print('YES')
			print(c[i], c[i + 1], sep='')
			b = False
if b:
	print('NO')


def main():
	n = int(input())
	string = input()
	try:
		index = next((i for i in range(n - 1) if string[i] != string[i + 1]))
		print('YES')
		print(string[index:index + 2])
	except StopIteration:
		print('NO')
main()


n = input('')
s = input('')
for i in range(int(n)):
	if s[i] != s[0]:
		print('YES')
		print(s[0] + s[i])
		break
	elif i == int(n) - 1:
		print('NO')
		break
	else:
		continue


number = int(input())
word = input()
for i in range(1, len(word)):
	if word[i] != word[i - 1]:
		print('YES')
		print(word[i - 1] + word[i])
		exit()
print('NO')


def principal_period(s):
	i = (s + s).find(s, 1, -1)
	return 'YES' if i == -1 else 'NO'
N = int(input())
l = input()
if N == 1:
	print('NO')
	exit()
print(principal_period(l))
for i in range(N - 1):
	if l[i] != l[i + 1]:
		print(l[i] + l[i + 1])
		exit()


n = int(input().strip())
s = input().strip()
se = set()
for i in s:
	se.add(i)
if len(se) < 2:
	print('NO')
else:
	print('YES')
	s1 = list(se)
	print(s1[0] + s1[1])


l = int(input())
st = input()
flag = 0
for i in range(l - 1):
	if st[i] != st[i + 1]:
		print('YES')
		flag = 1
		break
if flag == 0:
	print('NO')
else:
	print(st[i:i + 2])


input()
a = input()
for (x, y) in zip(a, a[1:]):
	if x != y:
		print('YES\n', x, y, sep='')
		exit(0)
print('NO')