You are given two strings $s$ and $t$ both of length $2$ and both consisting only of characters 'a', 'b' and 'c'.

Possible examples of strings $s$ and $t$: "ab", "ca", "bb".

You have to find a string $res$ consisting of $3n$ characters, $n$ characters should be 'a', $n$ characters should be 'b' and $n$ characters should be 'c' and $s$ and $t$ should not occur in $res$ as substrings.

A substring of a string is a contiguous subsequence of that string. So, the strings "ab", "ac" and "cc" are substrings of the string "abacc", but the strings "bc", "aa" and "cb" are not substrings of the string "abacc".

If there are multiple answers, you can print any of them.


-----Input-----

The first line of the input contains one integer $n$ ($1 \le n \le 10^5$) — the number of characters 'a', 'b' and 'c' in the resulting string.

The second line of the input contains one string $s$ of length $2$ consisting of characters 'a', 'b' and 'c'.

The third line of the input contains one string $t$ of length $2$ consisting of characters 'a', 'b' and 'c'.


-----Output-----

If it is impossible to find the suitable string, print "NO" on the first line. 

Otherwise print "YES" on the first line and string $res$ on the second line. $res$ should consist of $3n$ characters, $n$ characters should be 'a', $n$ characters should be 'b' and $n$ characters should be 'c' and $s$ and $t$ should not occur in $res$ as substrings.

If there are multiple answers, you can print any of them.


-----Examples-----
Input
2
ab
bc

Output
YES
acbbac

Input
3
aa
bc

Output
YES
cacbacbab

Input
1
cb
ac

Output
YES
abc

Source: codeforces | Difficulty: HARD
Tags: Complete search

Constructive algorithms


Solutions:
n = int(input())
l = ['abc' * n, 'acb' * n, 'bca' * n, 'cab' * n, 'bca' * n, 'cba' * n, 'b' * n + 'c' * n + 'a' * n, 'a' * n + 'b' * n + 'c' * n, 'c' * n + 'a' * n + 'b' * n]
a = input()
b = input()
print('YES')
for i in l:
	if a not in i and b not in i:
		print(i)
		break


n = int(input())
(s, t) = (input(), input())
res = ''
a = ['abc' * n, 'acb' * n, 'bca' * n, 'bac' * n, 'cab' * n, 'cba' * n]
b = ['a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'b' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n]
for temp in a + b:
	if s not in temp and t not in temp:
		res = temp
if res == '':
	print('NO')
else:
	print('YES')
	print(res)


import sys, math
input = sys.stdin.readline

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

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

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

def getStr():
	return input().strip()
n = getInt()
s = getStr()
t = getStr()
d = {}
d['aaaa'] = ['ab', 'c', '']
d['aaab'] = ['ac', 'b', '']
d['aaac'] = ['ab', 'c', '']
d['aaba'] = ['ac', 'b', '']
d['aabb'] = ['ab', 'c', '']
d['aabc'] = ['ac', 'b', '']
d['aaca'] = ['ab', 'c', '']
d['aacb'] = ['ab', 'c', '']
d['aacc'] = ['ac', 'b', '']
d['abab'] = ['a', 'c', 'b']
d['abac'] = ['b', 'c', 'a']
d['abba'] = ['a', 'c', 'b']
d['abbb'] = ['bc', 'a', '']
d['abbc'] = ['b', 'a', 'c']
d['abca'] = ['b', 'a', 'c']
d['abcb'] = ['b', 'a', 'c']
d['abcc'] = ['ac', 'b', '']
d['acac'] = ['a', 'b', 'c']
d['acba'] = ['b', 'c', 'a']
d['acbb'] = ['c', 'ab', '']
d['acbc'] = ['c', 'a', 'b']
d['acca'] = ['a', 'b', 'c']
d['accb'] = ['c', 'a', 'b']
d['accc'] = ['bc', 'a', '']
d['baba'] = ['a', 'c', 'b']
d['babb'] = ['a', 'bc', '']
d['babc'] = ['a', 'c', 'b']
d['baca'] = ['a', 'b', 'c']
d['bacb'] = ['a', 'b', 'c']
d['bacc'] = ['bc', 'a', '']
d['bbbb'] = ['ab', 'c', '']
d['bbbc'] = ['ba', 'c', '']
d['bbca'] = ['ab', 'c', '']
d['bbcb'] = ['ab', 'c', '']
d['bbcc'] = ['ab', 'c', '']
d['bcbc'] = ['a', 'c', 'b']
d['bcca'] = ['c', 'b', 'a']
d['bccb'] = ['b', 'a', 'c']
d['bccc'] = ['b', 'ac', '']
d['caca'] = ['a', 'b', 'c']
d['cacb'] = ['a', 'b', 'c']
d['cacc'] = ['cb', 'a', '']
d['cbcb'] = ['a', 'b', 'c']
d['cbcc'] = ['b', 'ac', '']
d['cccc'] = ['ac', 'b']
res = ''
if t < s:
	(s, t) = (t, s)
for s1 in d[s + t]:
	if s1 != '':
		res += s1 * n
print('YES')
print(res)


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	s = input()
	t = input()
	z = ['a', 'b', 'c']
	(x, y) = (s[::-1], t[::-1])
	print('YES')
	if x[1] == y[1] and x[0] == y[0]:
		if x[0] == x[1]:
			print('abc' * n)
		else:
			c = str()
			for item in z:
				if item not in x:
					c = item
					break
			print((x + c) * n)
	elif x[1] == y[1]:
		if x[0] == x[1]:
			c = str()
			for item in z:
				if item not in y:
					c = item
					break
			print((c + y) * n)
		elif y[0] == y[1]:
			c = str()
			for item in z:
				if item not in x:
					c = item
					break
			print((c + x) * n)
		else:
			print((x[0] + y[0]) * n + x[1] * n)
	elif x[0] == y[0]:
		if x[0] == x[1]:
			c = str()
			for item in z:
				if item not in y:
					c = item
					break
			print((c + y) * n)
		elif y[0] == y[1]:
			c = str()
			for item in z:
				if item not in x:
					c = item
					break
			print((c + x) * n)
		else:
			print(x[0] * n + (x[1] + y[1]) * n)
	elif x[0] == x[1] and y[0] == y[1]:
		print('abc' * n)
	elif x[0] == x[1]:
		print((x[0] + y) * n)
	elif y[0] == y[1]:
		print((y[0] + x) * n)
	else:
		c = ''
		for item in z:
			if item not in x and item not in y:
				c = item
				break
		if c != '':
			print(x[0] * n + c * n + x[1] * n)
		elif x[0] == y[1]:
			print((y + x[1]) * n)
		else:
			print((x + y[1]) * n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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


n = int(input())
s = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
a = input()
b = input()
for i in range(len(s)):
	l = s[i] * n
	if a not in l and b not in l:
		print('YES')
		print(l)
		exit()
s = ['a', 'b', 'c']
l = s[0] * n + s[1] * n + s[2] * n
if a not in l and b not in l:
	print('YES')
	print(l)
	exit()
l = s[0] * n + s[2] * n + s[1] * n
if a not in l and b not in l:
	print('YES')
	print(l)
	exit()
l = s[1] * n + s[0] * n + s[2] * n
if a not in l and b not in l:
	print('YES')
	print(l)
	exit()
l = s[1] * n + s[2] * n + s[0] * n
if a not in l and b not in l:
	print('YES')
	print(l)
	exit()
l = s[2] * n + s[1] * n + s[0] * n
if a not in l and b not in l:
	print('YES')
	print(l)
	exit()
l = s[2] * n + s[0] * n + s[1] * n
if a not in l and b not in l:
	print('YES')
	print(l)
	exit()
print('NO')


n = int(input())
a = input()
b = input()
s = ['abc', 'acb', 'bac', 'bca', 'cba', 'cab']
flag = False
for i in s:
	l = ''
	l1 = ''
	for j in range(n):
		l += i
	l1 += i[0] * n + i[1] * n + i[2] * n
	if a not in l and b not in l:
		print('YES')
		print(l)
		flag = True
		break
	elif a not in l1 and b not in l1:
		print('YES')
		print(l1)
		flag = True
		break
if not flag:
	print('NO')


import re
n = int(input())
s1 = input()
s2 = input()
s = ['abc', 'acb', 'bca', 'cba', 'bac', 'cab']
ss = ['ab', 'ba', 'bc', 'cb', 'ac', 'ca']
ss1 = ['c', 'c', 'a', 'a', 'b', 'b']
print('YES')
for i in range(len(s)):
	ans = ''
	for j in range(n):
		ans += s[i]
	if re.search(s1, ans) or re.search(s2, ans):
		continue
	print(ans)
	quit()
for i in range(len(ss)):
	ans = ''
	for j in range(n):
		ans += ss[i]
	for j in range(n):
		ans += ss1[i]
	if re.search(s1, ans) or re.search(s2, ans):
		continue
	print(ans)
	quit()
for i in range(len(ss)):
	ans = ''
	for j in range(n):
		ans += ss1[i]
	for j in range(n):
		ans += ss[i]
	if re.search(s1, ans) or re.search(s2, ans):
		continue
	print(ans)
	quit()


n = int(input())
s = input()
t = input()
d = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
ans = []
u = 0
for e in d:
	if not s in e and (not t in e):
		ans.append(e)
		u += 1
gr = [[] for i in range(u)]
for i in range(u):
	for j in range(u):
		e = ans[i] + ans[j]
		if not s in e and (not t in e):
			gr[i].append(j)

def dfs(i, v, u, st, g, ll):
	if len(st) > 100:
		return
	if st[0] == i and len(st) > 1 or len(st) * 3 > ll:
		aa = ''
		if st[0] == i:
			st.pop()
		for j in st:
			aa += g[j]
		tmp = ''
		while len(tmp) < ll:
			tmp = tmp + aa
		print('YES')
		print(tmp[:ll])
		exit()
	u[i] = True
	for x in v[i]:
		f = [xx for xx in st]
		f.append(x)
		dfs(x, v, u, f, g, ll)
for i in range(len(ans)):
	u = [False for j in range(len(ans))]
	dfs(i, gr, u, [i], ans, 3 * n)
if s[0] == t[0]:
	print('YES')
	print(n * s[1] + n * t[1] + n * t[0])
elif s[1] == t[1]:
	print('YES')
	print(n * s[1] + n * t[0] + n * s[0])
else:
	print('NO')


n = int(input())
s = input()
t = input()
choice = ['abcabc', 'acbacb', 'bacbac', 'bcabca', 'cabcab', 'cbacba'] + ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
print('YES')
for i in choice:
	if s not in i and t not in i:
		if s[0] == s[1] or t[0] == t[1]:
			print(i[:3] * n)
			break
		else:
			print(i[0] * n + i[1] * n + i[2] * n)
			break


n = int(input())
s = input()
t = input()
if s[0] != s[1] and t[0] != t[1]:
	if not (s == 'ab' or t == 'ab' or s == 'bc' or (t == 'bc')):
		res = 'a' * n + 'b' * n + 'c' * n
	elif not (s == 'ac' or t == 'ac' or s == 'cb' or (t == 'cb')):
		res = 'a' * n + 'c' * n + 'b' * n
	elif not (s == 'ba' or t == 'ba' or s == 'ac' or (t == 'ac')):
		res = 'b' * n + 'a' * n + 'c' * n
	elif not (s == 'bc' or s == 'ca' or t == 'bc' or (t == 'ca')):
		res = 'b' * n + 'c' * n + 'a' * n
	elif not (s == 'ca' or s == 'ab' or t == 'ca' or (t == 'ab')):
		res = 'c' * n + 'a' * n + 'b' * n
	else:
		res = 'c' * n + 'b' * n + 'a' * n
elif s[0] == s[1] and t[0] != t[1]:
	if t == 'bc' or t == 'ab' or t == 'ca':
		res = 'acb' * n
	else:
		res = 'abc' * n
elif s[0] != s[1] and t[0] == t[1]:
	if s == 'ab' or s == 'bc' or s == 'ca':
		res = 'acb' * n
	else:
		res = 'abc' * n
elif s[0] == s[1] and t[0] == t[1]:
	res = 'abc' * n
print('YES')
print(res)


from itertools import permutations

class Pattern:

	def fits(self, pair):
		raise NotImplementedError()

	def generate(self, size):
		raise NotImplementedError()

class Alternating(Pattern):
	__slots__ = ['kernel']

	def __init__(self, kernel):
		self.kernel = kernel

	def fits(self, pair):
		extended = self.kernel + self.kernel[0]
		return all((s not in extended for s in pair))

	def generate(self, size):
		return self.kernel * size

class Blocky(Pattern):
	__slots__ = ['order']

	def __init__(self, order):
		self.order = order

	def fits(self, pair):
		transitions = [self.order[:2], self.order[1:]]
		return all((s not in transitions for s in pair))

	def generate(self, size):
		return ''.join((ch * size for ch in self.order))

def solve(size, pair):
	patterns = [Alternating('abc'), Alternating('acb')]
	patterns.extend((Blocky(''.join(tup)) for tup in permutations('abc', 3)))
	for p in patterns:
		if p.fits(pair):
			return p.generate(size)
	return ''
size = int(input())
s1 = input()
s2 = input()
res = solve(size, (s1, s2))
if res == '':
	print('NO')
else:
	print('YES')
	print(res)


n = int(input())
s = input()
t = input()
res = ''
k = 3 * n
q = False
a = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
if n == 1:
	for i in a:
		if s in i or t in i:
			pass
		else:
			q = True
			res = i
			break
else:
	for i in range(6):
		for j in range(6):
			m = a[i] + a[j]
			if s in m or t in m or s == m[5] + m[0] or (t == m[5] + m[0]):
				pass
			else:
				q = True
				res = m
				break
		if q:
			break
if q:
	print('YES')
	res = res * n
	print(res[0:k])
else:
	for i in a:
		m = i[0] * n + i[1] * n + i[2] * n
		if s in m or t in m:
			pass
		else:
			q = True
			res = m
			break
	if q:
		print('YES')
		print(res)
	else:
		print('NO')


from itertools import product

def main():
	(n, s, t) = (int(input()), input(), input())
	print('YES')
	abc = ('abc', 'acb', 'bac', 'bca', 'cab', 'cba')
	if s[0] != s[1] and t[0] != t[1]:
		for p in abc:
			if s not in p and t not in p:
				print(p[0] * n, p[1] * n, p[2] * n, sep='')
				return
	for pp in product(abc, repeat=min(n, 2)):
		p = f'{pp[0]}{pp[-1]}{pp[0]}'[:min(n, 3) * 3]
		if s not in p and t not in p:
			break
	print((p[:6] * ((n + 1) // 2))[:n * 3])
main()


import sys
n = int(input())
s = input()
t = input()
print('YES')
pat = ['aabbcc', 'aaccbb', 'bbaacc', 'bbccaa', 'ccaabb', 'ccbbaa']
chosen_pattern = None
for p in pat:
	if s not in p and t not in p:
		chosen_pattern = p
		break
if chosen_pattern:
	ans = chosen_pattern[0] * n + chosen_pattern[2] * n + chosen_pattern[4] * n
	print(ans)
	exit()
pat = ['abcabc', 'acbacb', 'bacbac', 'bcabca', 'cabcab', 'cbacba']
for p in pat:
	if s not in p and t not in p:
		chosen_pattern = p
		break
if chosen_pattern:
	ans = chosen_pattern[0:3] * n
	print(ans)
	exit()


n = int(input())
s = input()
t = input()
if n == 1:
	one = ['ab', 'bc']
	two = ['ac', 'cb']
	three = ['ba', 'ac']
	four = ['bc', 'ca']
	five = ['ca', 'ab']
	six = ['cb', 'ba']
	main = [one, two, three, four, five, six]
	ans = 0
	for i in range(0, 6):
		temp = 1
		for j in range(0, 2):
			if main[i][j] == s or main[i][j] == t:
				temp = 0
				break
		if temp == 1:
			print('YES')
			if i == 0:
				print('abc' * n)
			elif i == 1:
				print('acb' * n)
			elif i == 2:
				print('bac' * n)
			elif i == 3:
				print('bca' * n)
			elif i == 4:
				print('cab' * n)
			else:
				print('cba' * n)
			ans = 1
			break
else:
	one = ['ab', 'bc', 'ca']
	two = ['ac', 'cb', 'ba']
	three = ['ba', 'ac', 'cb']
	four = ['bc', 'ca', 'ab']
	five = ['ca', 'ab', 'bc']
	six = ['cb', 'ba', 'ac']
	main = [one, two, three, four, five, six]
	ans = 0
	for i in range(0, 6):
		temp = 1
		for j in range(0, 3):
			if main[i][j] == s or main[i][j] == t:
				temp = 0
				break
		if temp == 1:
			print('YES')
			if i == 0:
				print('abc' * n)
			elif i == 1:
				print('acb' * n)
			elif i == 2:
				print('bac' * n)
			elif i == 3:
				print('bca' * n)
			elif i == 4:
				print('cab' * n)
			else:
				print('cba' * n)
			ans = 1
			break
	if ans == 0:
		print('YES')
		if set(s) == set(t):
			if 'a' != s[0] and 'a' != s[1]:
				print('b' * n + 'a' * n + 'c' * n)
			elif 'b' != s[0] and 'b' != s[1]:
				print('a' * n + 'b' * n + 'c' * n)
			else:
				print('a' * n + 'c' * n + 'b' * n)
		elif s[1] == 'a' and t[1] == 'a':
			print('a' * n + 'b' * n + 'c' * n)
		elif s[1] == 'b' and t[1] == 'b':
			print('b' * n + 'a' * n + 'c' * n)
		elif s[1] == 'c' and t[1] == 'c':
			print('c' * n + 'b' * n + 'a' * n)
		elif s[0] == 'a':
			print('b' * n + 'c' * n + 'a' * n)
		elif s[0] == 'b':
			print('a' * n + 'c' * n + 'b' * n)
		else:
			print('b' * n + 'a' * n + 'c' * n)


def main():
	from itertools import permutations as pm
	n = int(input())
	s = 'abc'
	a = list(pm(s))
	a = [''.join(i) for i in a]
	b = [i * n for i in a]
	for i in a:
		b.append(i[0] * n + i[1] * n + i[2] * n)
	z1 = input()
	z2 = input()
	for i in b:
		if z1 not in i:
			if z2 not in i:
				print('YES')
				print(i)
				return
	print('NO')
	return
main()


import sys

def other(x, y):
	s = sum((ord(z) for z in 'abc'))
	return chr(s - ord(x) - ord(y))

def main():
	n = int(input())
	s = input()
	t = input()
	sys.stdout.write('YES\n')
	temp = 'abc' * 2
	if s not in temp and t not in temp:
		sys.stdout.write('abc' * n)
		return
	temp = 'acb' * 2
	if s not in temp and t not in temp:
		sys.stdout.write('acb' * n)
		return
	sys.stdout.write(s[1] * n)
	sys.stdout.write(other(s[0], s[1]) * n)
	sys.stdout.write(s[0] * n)
main()


n = int(input())
s = input()
t = input()
from itertools import permutations
p = [*permutations('abc')]
ans = []
for i in p:
	ans.append(''.join(i) * n)
	ans.append(i[0] * n + i[1] * n + i[2] * n)
for i in ans:
	if s not in i and t not in i:
		print('YES', i, sep='\n')
		exit()
print('NO')


def get(c, m):
	freq = {'a': 0, 'b': 0, 'c': 0}
	for k in m['a']:
		freq[k] += 1
	for k in m['b']:
		freq[k] += 1
	for k in m['c']:
		freq[k] += 1
	mi = m[c][0]
	for k in m[c]:
		if freq[mi] > freq[k]:
			mi = k
	return mi
n = int(input())
s = input()
t = input()
size = {'a': n, 'b': n, 'c': n}
st = ''
m = {'a': ['a', 'b', 'c'], 'b': ['a', 'b', 'c'], 'c': ['a', 'b', 'c']}
m[s[0]].remove(s[1])
try:
	m[t[0]].remove(t[1])
except Exception:
	pass
freq = {'a': 0, 'b': 0, 'c': 0}
for k in m['a']:
	freq[k] += 1
for k in m['b']:
	freq[k] += 1
for k in m['c']:
	freq[k] += 1
if freq['a'] <= freq['b'] and freq['a'] <= freq['c']:
	c = 'a'
elif freq['c'] >= freq['b']:
	c = 'b'
else:
	c = 'c'
st += c
size[c] -= 1
if size['a'] == 0:
	try:
		m['a'].remove('a')
	except ValueError:
		pass
	try:
		m['b'].remove('a')
	except ValueError:
		pass
	try:
		m['c'].remove('a')
	except ValueError:
		pass
if size['b'] == 0:
	try:
		m['a'].remove('b')
	except ValueError:
		pass
	try:
		m['b'].remove('b')
	except ValueError:
		pass
	try:
		m['c'].remove('b')
	except ValueError:
		pass
if size['c'] == 0:
	try:
		m['a'].remove('c')
	except ValueError:
		pass
	try:
		m['b'].remove('c')
	except ValueError:
		pass
	try:
		m['c'].remove('c')
	except ValueError:
		pass
for i in range(3 * n - 1):
	k = get(st[i], m)
	st += k
	size[k] -= 1
	if size['a'] == 0:
		try:
			m['a'].remove('a')
		except ValueError:
			pass
		try:
			m['b'].remove('a')
		except ValueError:
			pass
		try:
			m['c'].remove('a')
		except ValueError:
			pass
	if size['b'] == 0:
		try:
			m['a'].remove('b')
		except ValueError:
			pass
		try:
			m['b'].remove('b')
		except ValueError:
			pass
		try:
			m['c'].remove('b')
		except ValueError:
			pass
	if size['c'] == 0:
		try:
			m['a'].remove('c')
		except ValueError:
			pass
		try:
			m['b'].remove('c')
		except ValueError:
			pass
		try:
			m['c'].remove('c')
		except ValueError:
			pass
print('YES')
print(st)


n = int(input())
s = input()
t = input()
m = {('aa', 'aa'): 'abc', ('bb', 'bb'): 'abc', ('cc', 'cc'): 'abc', ('ab', 'ab'): 'acb', ('ab', 'ab'): 'acb', ('ba', 'ba'): 'abc', ('ca', 'ca'): 'cba', ('cb', 'cb'): 'abc', ('ac', 'ac'): 'abc', ('bc', 'bc'): 'acb', ('aa', 'ab'): 'acb', ('aa', 'ac'): 'abc', ('aa', 'ba'): 'abc', ('aa', 'bb'): 'acb', ('aa', 'bc'): 'acb', ('aa', 'ca'): 'acb', ('aa', 'cb'): 'abc', ('aa', 'cc'): 'abc', ('ab', 'ac'): ('bc', 'a'), ('ab', 'ba'): ('bc', 'a'), ('ab', 'bb'): ('bc', 'a'), ('ab', 'bc'): 'cba', ('ab', 'ca'): 'cba', ('ab', 'cb'): ('b', 'ca'), ('ab', 'cc'): 'cba', ('ac', 'ba'): 'cab', ('ac', 'bb'): 'cab', ('ac', 'bc'): ('c', 'ba'), ('ac', 'ca'): ('c', 'ba'), ('ac', 'cb'): ('c', 'ab'), ('ac', 'cc'): 'abc', ('ba', 'bb'): 'abc', ('ba', 'bc'): ('ac', 'b'), ('ba', 'ca'): ('a', 'bc'), ('ba', 'cb'): 'bca', ('ba', 'cc'): 'bca', ('bb', 'bc'): 'acb', ('bb', 'ca'): 'acb', ('bb', 'cb'): 'abc', ('bb', 'cc'): 'abc', ('bc', 'ca'): ('ba', 'c'), ('bc', 'cb'): 'bac', ('bc', 'cc'): 'bac', ('ca', 'cb'): ('ab', 'c'), ('ca', 'cc'): 'acb', ('cb', 'cc'): 'abc'}
r = m[s, t] if (s, t) in m else m[t, s]
if len(r) == 2:
	ans = r[0] * n + r[1] * n
else:
	ans = r * n
print('YES')
print(ans)


from itertools import permutations
n = int(input().strip())
s = input().strip()
t = input().strip()

def doEven(n, s, t):
	d = ['a', 'a', 'b', 'b', 'c', 'c']
	filePerms = []
	for i in permutations(d):
		if i not in filePerms:
			filePerms.append(i)
	for i in range(len(filePerms)):
		filePerms[i] = ''.join(filePerms[i])
	cases = []
	for i in filePerms:
		if s not in i and t not in i:
			cases.append(i)
	if n == 2:
		return cases[0]
	for i in cases:
		j = i + i
		if s not in j and t not in j and (n % 2 == 0):
			return i

def doOdd(x, s, t):
	d = ['a', 'a', 'b', 'b', 'c', 'c']
	filePerms = []
	for i in permutations(d):
		if i not in filePerms:
			filePerms.append(i)
	for i in range(len(filePerms)):
		filePerms[i] = ''.join(filePerms[i])
	cases = []
	for i in filePerms:
		if s not in i and t not in i:
			cases.append(i)
	for i in cases:
		if x == 2:
			j = i
		else:
			j = i + i
		if s not in j and t not in j:
			options = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
			for k in options:
				possible = k + i
				if s not in possible and t not in possible:
					return k + int(x / 2) * i
			for k in options:
				possible = i + k
				if s not in possible and t not in possible:
					return int(x / 2) * i + k
flag = [0]
if s[0] == t[0] and s[1] != t[1] and (s[0] != s[1]) and (t[0] != t[1]):
	print('YES')
	print(n * s[1] + n * t[1] + n * s[0])
elif s[1] == t[1] and s[0] != t[0] and (s[1] != s[0]) and (t[1] != t[0]):
	print('YES')
	print(n * s[1] + n * t[0] + n * s[0])
elif n == 1:
	options = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
	for i in options:
		if s not in i and t not in i:
			print('YES')
			print(i)
			break
elif n % 2 == 0:
	solution = doEven(n, s, t)
	if flag[0] == 1:
		print('NO')
	else:
		print('YES')
		print(int(n / 2) * solution)
else:
	solution = doOdd(n - 1, s, t)
	if flag[0] == 1:
		print('NO')
	else:
		print('YES')
		print(solution)


from sys import stdin
from sys import setrecursionlimit as SRL
SRL(10 ** 7)
rd = stdin.readline
rrd = lambda : map(int, rd().strip().split())
g = ['a', 'b', 'c']
n = int(rd())
s = str(rd().strip())
t = str(rd().strip())
ans = ''

def find():
	ct = [s, t]
	for i in range(3):
		for j in range(3):
			if j != i:
				for k in range(3):
					if k != i and k != j:
						if g[i] + g[j] not in ct and g[j] + g[k] not in ct and (g[k] + g[i] not in ct):
							return g[i] + g[j] + g[k]
if s == t:
	ans = find() * n
elif s[0] == t[0]:
	for i in g:
		if i != s[1] and i != t[1]:
			if i == s[0]:
				ans = s[1] * n + t[1] * n + i * n
			else:
				ans = find() * n
elif s[1] == t[1]:
	for i in g:
		if i != s[0] and i != t[0]:
			if i == s[1]:
				ans = i * n + s[0] * n + t[0] * n
			else:
				ans = find() * n
elif s == t[::-1]:
	for i in g:
		if i != s[0] and i != s[1]:
			ans = s[0] * n + i * n + s[1] * n
else:
	ans = find() * n
print('YES')
print(ans)


n = int(input())
a = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cab' * n, 'cba' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'c' * n + 'b' * n + 'a' * n]
(s, t) = (input(), input())
print('YES')
for e in a:
	if s not in e and t not in e:
		print(e)
		break


n = int(input())
ft = input()
lt = input()
arr = ['abc' * n, 'bac' * n, 'cab' * n, 'bca' * n, 'cba' * n, 'acb' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'c' * n + 'b' * n + 'a' * n]
for i in arr:
	if ft not in i and lt not in i:
		print('YES')
		print(i)
		break
else:
	print('NO')


from itertools import permutations
n = int(input())
a = input()
b = input()
print('YES')
alpha = ['a', 'b', 'c']
doublealpha = alpha * 2
ax = list(permutations(alpha))
ay = ax + list(permutations(doublealpha))
for x in ay:
	hoh = ''.join(x + (x[0],))
	if n == 1:
		hoh = hoh[:-1]
	if not (a in hoh or b in hoh):
		print((''.join(x) * n)[:3 * n])
		exit()
if a[0] == b[0]:
	print(a[1] * n + b[1] * n + a[0] * n)
else:
	print(a[1] * n + a[0] * n + b[0] * n)


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

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

def solve(n, s, t):
	TEMPL = ('abc', 'acb', 'bac', 'bca', 'cab', 'cba')
	if n == 1:
		for s1 in TEMPL:
			if s not in s1 and t not in s1:
				return s1
	for templ in TEMPL:
		s1 = ''
		for c in templ:
			s1 += 2 * c
		if s not in s1 and t not in s1:
			s1 = ''
			for c in templ:
				s1 += n * c
			return s1
		s2 = templ + templ
		if s not in s2 and t not in s2:
			return n * templ
n = rint()
s = input()
t = input()
print('YES')
print(solve(n, s, t))


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

def gen_singular(c):
	global ans
	ans += c * n

def gen_pairs(p, q):
	global ans
	ans += (p + q) * n

def d(s):
	return s[0] != s[1]

def e(p):
	return p[0] == p[1]

def rest(s, t):
	return [el for el in ['a', 'b', 'c'] if el not in set(s + t)][0]

def attempt(s, t):
	global ans
	if s[0] == t[0] and s[1] != t[1] and d(s) and d(t):
		gen_singular(s[1])
		gen_singular(t[1])
		gen_singular(s[0])
	if s[1] == t[1] and s[0] != t[0] and d(s) and d(t):
		gen_singular(s[1])
		gen_singular(t[0])
		gen_singular(s[0])
	if e(s) and t[0] == s[0] and d(t):
		gen_singular(t[1])
		gen_pairs(s[0], rest(s, t))
	if e(s) and t[1] == s[0] and d(t):
		gen_pairs(s[0], rest(s, t))
		gen_singular(t[0])
	if d(s) and d(t) and (s[1] == t[0]) and (s[0] != t[1]):
		gen_singular(t[1])
		gen_singular(s[1])
		gen_singular(s[0])
	if s[0] == s[1] == t[0] == t[1]:
		if s[0] == 'a':
			gen_pairs(s[0], 'c')
			gen_singular('b')
		else:
			gen_pairs(s[0], 'a')
			gen_singular(rest('a', s[0]))
	if d(s) and d(t) and (t == s[::-1]):
		gen_singular(s[0])
		gen_singular(rest(s[0], s[1]))
		gen_singular(s[1])
	if e(s) and d(t) and (s[0] != t[0]) and (s[0] != t[1]):
		gen_pairs(t[0], s[0])
		gen_singular(t[1])
	if d(s) and s == t:
		gen_singular(s[0])
		gen_singular(rest(s[0], s[1]))
		gen_singular(s[1])
	if e(s) and e(t) and (s[0] != t[0]):
		gen_pairs(s[0], t[0])
		gen_singular(rest(s[0], t[0]))
attempt(s, t)
if len(ans) == 0:
	attempt(t, s)
print('YES')
print(ans)


def mp():
	return map(int, input().split())
n = int(input())
s = input()
t = input()
if s[1] == t[1] and s[0] != t[0] and (s[1] != s[0]) and (t[1] != t[0]):
	print('YES')
	print(s[1] * n + s[0] * n + t[0] * n)
elif s[0] == t[0] and s[1] != t[1] and (s[0] != s[1]) and (t[0] != t[1]):
	print('YES')
	print(s[1] * n + t[1] * n + s[0] * n)
else:
	for w in ['a', 'b', 'c']:
		ans = [w]
		cnt = [0, 0, 0]
		cnt[ord(w) - 97] += 1
		for i in range(3 * n - 1):
			p = ans[-1]
			may = [1] * 3
			if s[0] == p:
				may[ord(s[1]) - 97] = 0
			if t[0] == p:
				may[ord(t[1]) - 97] = 0
			jj = -1
			for j in range(3):
				if may[j] and cnt[j] < n and (jj == -1 or cnt[j] <= cnt[jj]):
					jj = j
			if jj == -1:
				break
			ans.append(chr(jj + 97))
			cnt[jj] += 1
		if len(ans) == 3 * n:
			print('YES')
			print(''.join(ans))
			break
	else:
		for w in ['a', 'b', 'c']:
			ans = [w]
			cnt = [0, 0, 0]
			cnt[ord(w) - 97] += 1
			for i in range(3 * n - 1):
				p = ans[-1]
				may = [1] * 3
				if s[0] == p:
					may[ord(s[1]) - 97] = 0
				if t[0] == p:
					may[ord(t[1]) - 97] = 0
				jj = -1
				for j in range(3):
					if may[j] and cnt[j] < n and (jj == -1 or cnt[j] < cnt[jj]):
						jj = j
				if jj == -1:
					break
				ans.append(chr(jj + 97))
				cnt[jj] += 1
			if len(ans) == 3 * n:
				print('YES')
				print(''.join(ans))
				break
		else:
			print('NO')


n = int(input())
s = input()
t = input()
if s[0] != s[1] and t[0] != t[1]:
	for i in ['a', 'b', 'c']:
		for j in ['a', 'b', 'c']:
			if i == j:
				continue
			for k in ['a', 'b', 'c']:
				if i == k or j == k:
					continue
				st = i + j + k
				if s in st or t in st:
					continue
				else:
					ANS = i + j + k
	print('YES')
	print(ANS[0] * n + ANS[1] * n + ANS[2] * n)
else:
	for i in ['a', 'b', 'c']:
		for j in ['a', 'b', 'c']:
			if i == j:
				continue
			for k in ['a', 'b', 'c']:
				if i == k or j == k:
					continue
				st = i + j + k + i + j + k
				if s in st or t in st:
					continue
				else:
					ANS = i + j + k
	print('YES')
	print(ANS * n)


n = int(input())
l = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cba' * n, 'cab' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'a' * n + 'b' * n + 'c' * n]
s1 = input().strip()
s2 = input().strip()
print('YES')
for x in l:
	if s1 not in x and s2 not in x:
		print(x)
		break


n = int(input())
s = input()
t = input()
import itertools

def selfrepeat(string):
	return string[0] == string[1]

def is_string_ok(cand, str1, str2):
	return str1 not in cand and str2 not in cand

def main(str1, str2, n):
	if selfrepeat(str1) or selfrepeat(str2):
		cand1 = 'abc' * n
		cand2 = 'cba' * n
		if is_string_ok(cand1, str1, str2):
			return cand1
		else:
			return cand2
	else:
		perms = map(''.join, list(itertools.permutations('abc')))
		for perm in perms:
			if is_string_ok(perm, str1, str2):
				return perm[0] * n + perm[1] * n + perm[2] * n
print('YES')
print(main(s, t, n))


from collections import defaultdict as DD
import sys
MOD = pow(10, 9) + 7

def IN(f=0):
	if f == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())

def fnx(e, r):
	t = ['a', 'b', 'c']
	t.remove(e)
	t.remove(r)
	return t[0]

def fnx1(e):
	t = ['a', 'b', 'c']
	t.remove(e)
	return t

def F(q, w, n):
	ans = '-1'
	if q == w:
		if q[0] == q[1]:
			t = fnx1(q[0])
			ans = (q[0] + t[0]) * n + t[1] * n
			return ans
		else:
			ans = q[0] * n + fnx(q[0], q[1]) * n + q[1] * n
			return ans
	elif q[0] == q[1] or w[0] == w[1]:
		if q[0] == q[1] and w[0] == w[1]:
			ans = (q[0] + w[0]) * n + fnx(q[0], w[0]) * n
			return ans
		if q[0] != q[1]:
			(w, q) = (q, w)
		if q[0] == w[0] and q[0] != w[1]:
			ans = (q[0] + fnx(q[0], w[1])) * n + w[1] * n
			return ans
		if q[0] == w[1] and q[0] != w[0]:
			ans = (q[0] + fnx(q[0], w[0])) * n + w[0] * n
			return ans
		if q[0] != w[0] and q[0] != w[1]:
			ans = (q[0] + w[1]) * n + w[0] * n
			return ans
	else:
		if q[0] != w[1] and q[1] == w[0]:
			ans = (q[0] + w[1]) * n + w[0] * n
			return ans
		if q[0] != w[0] and q[1] == w[1]:
			ans = q[1] * n + q[0] * n + w[0] * n
			return ans
		if q[0] == w[1] and q[1] == w[0]:
			ans = q[0] * n + fnx(q[0], q[1]) * n + q[1] * n
			return ans
		if q[0] == w[0] and q[1] != w[1]:
			ans = q[1] * n + w[1] * n + q[0] * n
			return ans
		if q[0] == w[1] and q[1] != w[0]:
			ans = q[1] * n + q[0] * n + w[0] * n
			return ans
	return ans
if 1:
	n = IN(1)
	q = input()
	w = input()
	s = F(q, w, n)
	if s != '-1':
		print('YES')
		print(s)
	else:
		print('NO')


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

def f(x, y):
	abc = ['a', 'b', 'c']
	abc.remove(x)
	abc.remove(y)
	return abc[0]
print('YES')
if s[0] == s[1] == t[0] == t[1]:
	print('abc' * n)
elif s[0] == s[1]:
	if t[0] == s[0]:
		ans = s[0] + f(s[0], t[1]) + t[1]
		print(ans * n)
	elif t[1] == s[0]:
		ans = s[0] + t[0] + f(s[0], t[0])
		print(ans * n)
	elif t[0] == t[1]:
		ans = s[0] + t[0] + f(s[0], t[0])
		print(ans * n)
	else:
		ans = s[0] + t[1] + t[0]
		print(ans * n)
elif t[0] == s[0] and t[1] == s[1]:
	ans = s[0] + f(s[0], s[1]) + s[1]
	print(ans * n)
elif s[0] == t[0] == t[1]:
	ans = s[0] + f(s[0], s[1]) + s[1]
	print(ans * n)
elif t[0] == s[0] and t[1] == f(s[0], s[1]):
	print(s[1] * n + t[1] * n + s[0] * n)
elif s[0] == t[1]:
	print(s[0] * n + f(s[0], s[1]) * n + s[1] * n)
elif s[1] == t[0] and t[0] != t[1]:
	ans = t[1] + s[1] + s[0]
	print(ans * n)
elif s[1] == t[1] and t[0] != t[1]:
	print(s[1] * n + s[0] * n + t[0] * n)
else:
	ans = s[1] + s[0] + f(s[0], s[1])
	print(ans * n)


n = int(input())
a = {'a', 'b', 'c'}
(s, t) = (input(), input())
if t[0] == t[1]:
	(s, t) = (t, s)
print('YES')
if s[0] == s[1]:
	if t[0] == t[1]:
		print('abc' * n)
	elif t[0] == s[0]:
		print((s[0] + next(iter(a - set(t))) + t[1]) * n)
	elif t[1] == s[0]:
		print((s[0] + t[0] + next(iter(a - set(t)))) * n)
	else:
		print((s[0] + t[::-1]) * n)
elif t[0] == s[0]:
	print(''.join(a - {t[0]}) * n + t[0] * n)
elif t[1] == s[1]:
	print(t[1] * n + ''.join(a - {t[1]}) * n)
elif s == t[::-1]:
	print(s[0] * n + next(iter(a - set(s))) * n + s[1] * n)
elif s[1] == t[0]:
	print(t[1] * n + t[0] * n + s[0] * n)
else:
	print(s[1] * n + s[0] * n + t[0] * n)


n = int(input())
s = input()
t = input()
print('YES')
if s[0] == s[1]:
	if t[0] == t[1]:
		print('abc' * n)
	else:
		r = 'c'
		if 'a' not in t:
			r = 'a'
		if 'b' not in t:
			r = 'b'
		print(''.join([r, t[1], t[0]]) * n)
elif t[0] == t[1]:
	r = 'c'
	if 'a' not in s:
		r = 'a'
	if 'b' not in s:
		r = 'b'
	print(''.join([r, s[1], s[0]]) * n)
else:
	r = 'c'
	if 'a' not in s:
		r = 'a'
	if 'b' not in s:
		r = 'b'
	if t != s[1] + r and t != r + s[0]:
		res = [s[1], r, s[0]]
	else:
		res = [r, s[1], s[0]]
	print(res[0] * n + res[1] * n + res[2] * n)


import itertools
n = int(input())
(s, t) = (input(), input())
print('YES')
for a in itertools.permutations('abc'):
	aa = ''.join(a) * 2
	if s not in aa and t not in aa:
		print(''.join(a) * n)
		exit(0)
if s[0] == t[0]:
	(x, y) = (s[0], s[1])
	z = t[1]
	print(y * n + z * n + x * n)
elif s[1] == t[1]:
	(x, y) = (s[0], s[1])
	z = t[0]
	print(y * n + z * n + x * n)
elif s[0] == t[1] and s[1] == t[0]:
	(x, y) = (s[0], s[1])
	for ch in 'abc':
		if ch != x and ch != y:
			z = ch
	print(x * n + z * n + y * n)
else:
	assert 0


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
n = int(input())
s = input()
t = input()
print('YES')
if s == t:
	if s[0] == s[-1]:
		print('abc' * n)
		sys.exit(0)
	e = 'c'
	if 'a' not in s:
		e = 'a'
	if 'b' not in s:
		e = 'b'
	e1 = s[::-1] + e
	print(e1 * n)
	sys.exit(0)
e = ''
k = 0
if s != 'aa' and s != 'bb' and (s != 'cc'):
	if t != 'aa' and t != 'bb' and (t != 'cc'):
		if 'c' not in s and 'c' not in t:
			ans = 'acb' * n
			print(ans[0] * n + ans[1] * n + ans[2] * n)
			sys.exit(0)
		if 'b' not in s and 'b' not in t:
			ans = 'abc' * n
			print(ans[0] * n + ans[1] * n + ans[2] * n)
			sys.exit(0)
		if 'a' not in s and 'a' not in t:
			ans = 'cab' * n
			print(ans[0] * n + ans[1] * n + ans[2] * n)
			sys.exit(0)
		k = 1
		e = s[::-1]
		e1 = t[::-1]
		if e1[0] == e[0]:
			ans = e1[0] + e1[1] + e[1]
		elif e1[-1] == e[-1]:
			ans = e[0] + e1[0] + e[-1]
		elif e1[-1] == e[0]:
			ans = e1 + e[-1]
		else:
			ans = e + e1[-1]
		print(ans[0] * n + ans[1] * n + ans[2] * n)
		sys.exit(0)
if k == 1:
	ans = e[0] * n + e[1] * n + e[2] * n
	print(ans)
	sys.exit(0)
if s == 'aa' or s == 'bb' or s == 'cc':
	if t == 'aa' or t == 'bb' or t == 'cc':
		print('abc' * n)
		sys.exit(0)
if t != 'aa' and t != 'bb' and (t != 'cc'):
	(s, t) = (t, s)
e = 'c'
if 'a' not in s:
	e = 'a'
if 'b' not in s:
	e = 'b'
ans = s[::-1] + e
ans = ans * n
print(ans)


n = int(input())
a = input()
b = input()
arr = ['abc', 'bca', 'cab', 'acb', 'cba', 'bac']
for i in arr:
	x = i + i[0]
	if x.count(a) == 0 and x.count(b) == 0:
		print('YES')
		print(n * i)
		exit()
for i in arr:
	if i[0:2].count(a) == 0 and i[0:2].count(b) == 0 and (i[1:].count(a) == 0) and (i[1:].count(b) == 0):
		print('YES')
		print(n * i[0] + n * i[1] + n * i[2])
		exit()
print('NO')


N = int(input())
s = input()
t = input()
base1 = set(['ab', 'bc', 'ca'])
base2 = set(['ac', 'cb', 'ba'])
print('YES')
if s not in base1 and t not in base1:
	print(''.join(['abc' * N]))
elif s not in base2 and t not in base2:
	print(''.join(['acb' * N]))
elif s[0] == t[0]:
	head = ''.join([f'{s[1]}{t[1]}'] * N)
	tail = ''.join([s[0]] * N)
	print(f'{head}{tail}')
elif s[1] == t[1]:
	head = ''.join([s[1]] * N)
	tail = ''.join([f'{s[0]}{t[0]}'] * N)
	print(f'{head}{tail}')
else:
	head = ''.join([s[0]] * N)
	missing = 'a'
	if 'b' not in s:
		missing = 'b'
	if 'c' not in s:
		missing = 'c'
	middle = ''.join([missing] * N)
	tail = ''.join([s[1]] * N)
	print(f'{head}{middle}{tail}')


n = int(input())
s = input()
t = input()
is_s_same = False
is_t_same = False
if s[0] == s[1]:
	is_s_same = True
if t[0] == t[1]:
	is_t_same = True
print('YES')
if is_s_same and is_t_same:
	ans = 'abc' * n
	print(ans)
	exit()
if is_s_same and s[0] not in t:
	ans = s[0] + t[::-1]
	ans = ans * n
	print(ans)
	exit()
if is_t_same and t[0] not in s:
	ans = t[0] + s[::-1]
	ans = ans * n
	print(ans)
	exit()
if is_s_same:
	if 'a' not in t:
		ans = 'a' + t[::-1]
		ans = ans * n
		print(ans)
		exit()
	if 'b' not in t:
		ans = 'b' + t[::-1]
		ans = ans * n
		print(ans)
		exit()
	if 'c' not in t:
		ans = 'c' + t[::-1]
		ans = ans * n
		print(ans)
		exit()
if is_t_same:
	if 'a' not in s:
		ans = 'a' + s[::-1]
		ans = ans * n
		print(ans)
		exit()
	if 'b' not in s:
		ans = 'b' + s[::-1]
		ans = ans * n
		print(ans)
		exit()
	if 'c' not in s:
		ans = 'c' + s[::-1]
		ans = ans * n
		print(ans)
		exit()
if 'a' not in s or 'a' not in t:
	ans = 'bac'
	if s not in ans and t not in ans:
		ans = ans[0] * n + ans[1] * n + ans[2] * n
		print(ans)
		exit()
	else:
		ans = 'cab'
		ans = ans[0] * n + ans[1] * n + ans[2] * n
		print(ans)
		exit()
if 'b' not in s or 'b' not in t:
	ans = 'abc'
	if s not in ans and t not in ans:
		ans = ans[0] * n + ans[1] * n + ans[2] * n
		print(ans)
		exit()
	else:
		ans = 'cba'
		ans = ans[0] * n + ans[1] * n + ans[2] * n
		print(ans)
		exit()
if 'c' not in s or 'c' not in t:
	ans = 'acb'
	if s not in ans and t not in ans:
		ans = ans[0] * n + ans[1] * n + ans[2] * n
		print(ans)
		exit()
	else:
		ans = 'bca'
		ans = ans[0] * n + ans[1] * n + ans[2] * n
		print(ans)
		exit()


n = int(input())
a = input()
b = input()
if b in ['ab', 'bc', 'ca'] and a in ['ac', 'cb', 'ba']:
	temp = a
	a = b
	b = temp
if a in ['ab', 'bc', 'ca'] and b in ['ac', 'ba', 'cb']:
	if a == 'ab' and b == 'ac':
		print('YES')
		for _ in range(n):
			print('bc', end='')
		for _ in range(n):
			print('a', end='')
	if a == 'ab' and b == 'ba':
		print('YES')
		for _ in range(int(n / 2)):
			print('acbbca', end='')
		for _ in range(n % 2):
			print('acb', end='')
	if a == 'ab' and b == 'cb':
		print('YES')
		for _ in range(n):
			print('b', end='')
		for _ in range(n):
			print('ac', end='')
	if a == 'bc' and b == 'ac':
		print('YES')
		for _ in range(n):
			print('c', end='')
		for _ in range(n):
			print('ab', end='')
	if a == 'bc' and b == 'ba':
		print('YES')
		for _ in range(n):
			print('ac', end='')
		for _ in range(n):
			print('b', end='')
	if a == 'bc' and b == 'cb':
		print('YES')
		for _ in range(int(n / 2)):
			print('baccab', end='')
		for _ in range(n % 2):
			print('bac', end='')
	if a == 'ca' and b == 'ac':
		print('YES')
		for _ in range(int(n / 2)):
			print('cbaabc', end='')
		for _ in range(n % 2):
			print('cba', end='')
	if a == 'ca' and b == 'ba':
		print('YES')
		for _ in range(n):
			print('a', end='')
		for _ in range(n):
			print('bc', end='')
	if a == 'ca' and b == 'cb':
		print('YES')
		for _ in range(n):
			print('ab', end='')
		for _ in range(n):
			print('c', end='')
else:
	print('YES')
	if a in ['ab', 'bc', 'ca'] or b in ['ab', 'bc', 'ca']:
		for _ in range(n):
			print('acb', end='')
	else:
		for _ in range(n):
			print('abc', end='')


from itertools import permutations
n = int(input())
(s1, s2) = input()
(t1, t2) = input()
print('YES')
if s1 == t2 and s2 == t1 and (s1 != s2):
	x3 = list(set('abc') - set([s1, s2]))[0]
	print(s1 * n + x3 * n + s2 * n)
else:
	for (x1, x2, x3) in permutations('abc'):
		possible = True
		for (a1, a2) in [(x1, x2), (x2, x3), (x3, x1)]:
			if a1 == s1 and a2 == s2 or (a1 == t1 and a2 == t2):
				possible = False
				break
		if possible:
			print((x1 + x2 + x3) * n)
			exit()
	if s1 == t1:
		print((s2 + t2) * n + s1 * n)
		exit()
	if s2 == t2:
		print(s2 * n + (s1 + t1) * n)
		exit()


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
n = inp()
l = ['abc' * n, 'acb' * n, 'bca' * n, 'cab' * n, 'bca' * n, 'cba' * n, 'b' * n + 'c' * n + 'a' * n, 'a' * n + 'b' * n + 'c' * n, 'c' * n + 'a' * n + 'b' * n]
a = input().strip()
b = input().strip()
print('YES')
for i in l:
	if a not in i and b not in i:
		print(i)
		break


import sys
input = sys.stdin.readline
n = int(input())
s = list(input().rstrip())
ps = ''.join(s)
t = list(input().rstrip())
pt = ''.join(t)
s.sort()
t.sort()
print('YES')
if s[0] == s[1] and t[0] == t[1]:
	print('abc' * n)
elif s[0] == s[1] or t[0] == t[1]:
	if t[0] == t[1]:
		(s, t) = (t, s)
	if s[0] == 'a':
		if t[0] == 'a':
			if t[1] == 'b':
				print('ac' * n + 'b' * n)
			else:
				print('ab' * n + 'c' * n)
		else:
			print('b' * n + 'ac' * n)
	elif s[0] == 'b':
		if t[0] == 'a':
			if t[1] == 'b':
				print('a' * n + 'cb' * n)
			else:
				print('ab' * n + 'c' * n)
		else:
			print('c' * n + 'ab' * n)
	elif t[0] == 'a':
		if t[1] == 'b':
			print('ac' * n + 'b' * n)
		else:
			print('cb' * n + 'a' * n)
	else:
		print('b' * n + 'ac' * n)
else:
	a = 'a' * n
	b = 'b' * n
	c = 'c' * n
	l = [a + b + c, a + c + b, b + a + c, b + c + a, c + a + b, c + b + a]
	for x in l:
		if not (ps in x or pt in x):
			print(x)
			exit()


n = int(input())
s = input().strip()
t = input().strip()
my_combinations = []
my_str = ''
my_str += 'c' * n + 'a' * n + 'b' * n
my_combinations.append(my_str)
my_str = ''
my_str += 'a' * n + 'b' * n + 'c' * n
my_combinations.append(my_str)
my_str = ''
my_str += 'a' * n + 'c' * n + 'b' * n
my_combinations.append(my_str)
my_str = ''
my_str += 'b' * n + 'a' * n + 'c' * n
my_combinations.append(my_str)
my_str = ''
my_str += 'b' * n + 'c' * n + 'a' * n
my_combinations.append(my_str)
my_str = ''
my_str += 'c' * n + 'b' * n + 'a' * n
my_combinations.append(my_str)
my_combinations.append('abc' * n)
my_combinations.append('acb' * n)
my_combinations.append('bac' * n)
my_combinations.append('bca' * n)
my_combinations.append('cab' * n)
my_combinations.append('cba' * n)
f = False
for i in range(0, len(my_combinations)):
	if not s in my_combinations[i] and (not t in my_combinations[i]):
		print('YES', my_combinations[i], sep='\n')
		f = True
		break
if not f:
	print('NO')


n = int(input())
x = input()
y = input()
l = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
s = []
for i in range(6):
	s.append(n * l[i][0] + n * l[i][1] + n * l[i][2])
for i in range(6):
	s.append(l[i] * n)
for i in range(6):
	s.append(n * l[i][:2] + n * l[i][2:])
for i in range(18):
	if x not in s[i] and y not in s[i]:
		print('YES')
		print(s[i])
		exit(0)
print('NO')


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify
from copy import deepcopy, copy
mod = 10 ** 9 + 7
INF = float('inf')

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

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

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

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

def inpsl(x):
	tmp = sys.stdin.readline()
	return list(tmp[:x])

def err(x):
	print(x)
	exit()
n = inp()
s = input()
t = input()

def pt1(s, t):
	for x in ['ab', 'bc', 'ca']:
		if s == x or t == x:
			return False
	return True

def pt2(s, t):
	for x in ['ac', 'cb', 'ba']:
		if s == x or t == x:
			return False
	return True

def cnt2(s, t):
	cnt = [0, 0, 0]
	for x in s:
		cnt[ord(x) - 97] += 1
	for x in t:
		cnt[ord(x) - 97] += 1
	res = [chr(i + 97) for i in range(3) if cnt[i] == 2]
	return res
res = ''
cnt = cnt2(s, t)
if pt1(s, t):
	res = 'abc' * n
elif pt2(s, t):
	res = 'acb' * n
elif s == t[::-1]:
	for x in ['a', 'b', 'c']:
		if not x in cnt:
			center = x
	res = cnt[0] * n + center * n + cnt[1] * n
elif s[0] == t[0]:
	left = center = ''
	for x in ['a', 'b', 'c']:
		if x != cnt[0]:
			if left == '':
				left = x
			else:
				center = x
	res = left * n + center * n + cnt[0] * n
else:
	left = center = ''
	for x in ['a', 'b', 'c']:
		if x != cnt[0]:
			if left == '':
				left = x
			else:
				center = x
	res = cnt[0] * n + center * n + left * n
print('YES')
print(res)


n = int(input())
s = input()
t = input()
print('YES')
if (s == 'aa' and t == 'bb' or t == 'aa') and s == 'bb' or ((s == 'aa' and t == 'cc' or t == 'aa') and s == 'cc') or (s == 'bb' and t == 'cc') or (t == 'bb' and s == 'cc'):
	print(n * 'abc')
elif (s == 'aa' or s == 'bb' or s == 'cc') and t == 'ab' or ((t == 'aa' or t == 'bb' or t == 'cc') and s == 'ab'):
	print(n * 'bac')
elif (s == 'aa' or s == 'bb' or s == 'cc') and t == 'ac' or ((t == 'aa' or t == 'bb' or t == 'cc') and s == 'ac'):
	print(n * 'cab')
elif (s == 'aa' or s == 'bb' or s == 'cc') and t == 'bc' or ((t == 'aa' or t == 'bb' or t == 'cc') and s == 'bc'):
	print(n * 'bac')
elif (s == 'aa' or s == 'bb' or s == 'cc') and t == 'ba' or ((t == 'aa' or t == 'bb' or t == 'cc') and s == 'ba'):
	print(n * 'abc')
elif (s == 'aa' or s == 'bb' or s == 'cc') and t == 'ca' or ((t == 'aa' or t == 'bb' or t == 'cc') and s == 'ca'):
	print(n * 'acb')
elif (s == 'aa' or s == 'bb' or s == 'cc') and t == 'cb' or ((t == 'aa' or t == 'bb' or t == 'cc') and s == 'cb'):
	print(n * 'cab')
elif s == 'ab' and t == 'bc' or (t == 'ab' and s == 'bc'):
	print('b' * n + 'a' * n + 'c' * n)
elif s == 'ab' and t == 'ac' or (t == 'ab' and s == 'ac'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ab' and t == 'ab' or (t == 'ab' and s == 'ab'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ab' and t == 'ba' or (t == 'ab' and s == 'ba'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ab' and t == 'ca' or (t == 'ab' and s == 'ca'):
	print('c' * n + 'b' * n + 'a' * n)
elif s == 'ab' and t == 'cb' or (t == 'ab' and s == 'cb'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ac' and t == 'cb' or (t == 'ac' and s == 'cb'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ac' and t == 'ca' or (t == 'ac' and s == 'ca'):
	print('a' * n + 'b' * n + 'c' * n)
elif s == 'ac' and t == 'ab' or (t == 'ac' and s == 'ab'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ac' and t == 'ac' or (t == 'ac' and s == 'ac'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ac' and t == 'ba' or (t == 'ac' and s == 'ba'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ac' and t == 'bc' or (t == 'ac' and s == 'bc'):
	print('c' * n + 'a' * n + 'b' * n)
elif s == 'ba' and t == 'ac' or (t == 'ba' and s == 'ac'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ba' and t == 'ab' or (t == 'ba' and s == 'ab'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ba' and t == 'ba' or (t == 'ba' and s == 'ba'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'ba' and t == 'bc' or (t == 'ba' and s == 'bc'):
	print('c' * n + 'a' * n + 'b' * n)
elif s == 'ba' and t == 'ca' or (t == 'ba' and s == 'ca'):
	print('a' * n + 'b' * n + 'c' * n)
elif s == 'ba' and t == 'cb' or (t == 'ba' and s == 'cb'):
	print('b' * n + 'c' * n + 'a' * n)
elif s == 'bc' and t == 'ac' or (t == 'bc' and s == 'ac'):
	print('c' * n + 'a' * n + 'b' * n)
elif s == 'bc' and t == 'ab' or (t == 'bc' and s == 'ab'):
	print('b' * n + 'a' * n + 'c' * n)
elif s == 'bc' and t == 'ba' or (t == 'bc' and s == 'ba'):
	print('c' * n + 'a' * n + 'b' * n)
elif s == 'bc' and t == 'bc' or (t == 'bc' and s == 'bc'):
	print('c' * n + 'a' * n + 'b' * n)
elif s == 'bc' and t == 'ca' or (t == 'bc' and s == 'ca'):
	print('b' * n + 'a' * n + 'c' * n)
elif s == 'bc' and t == 'cb' or (t == 'bc' and s == 'cb'):
	print('b' * n + 'a' * n + 'c' * n)
elif s == 'ca' and t == 'ac' or (t == 'ca' and s == 'ac'):
	print('a' * n + 'b' * n + 'c' * n)
elif s == 'ca' and t == 'ab' or (t == 'ca' and s == 'ab'):
	print('b' * n + 'a' * n + 'c' * n)
elif s == 'ca' and t == 'ba' or (t == 'ca' and s == 'ba'):
	print('a' * n + 'c' * n + 'b' * n)
elif s == 'ca' and t == 'bc' or (t == 'ca' and s == 'bc'):
	print('a' * n + 'c' * n + 'b' * n)
elif s == 'ca' and t == 'ca' or (t == 'ca' and s == 'ca'):
	print('b' * n + 'a' * n + 'c' * n)
elif s == 'ca' and t == 'cb' or (t == 'ca' and s == 'cb'):
	print('b' * n + 'a' * n + 'c' * n)
else:
	print('abc' * n)


n = int(input())
(s1, s2) = (input(), input())
print('Yes')
l = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cab' * n, 'cba' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'c' * n + 'b' * n + 'a' * n]
for i in l:
	if s1 not in i and s2 not in i:
		print(i)
		break


refr = {'ab': 'acb', 'ac': 'abc', 'ba': 'abc', 'bc': 'acb', 'ca': 'acb', 'cb': 'abc'}
n = int(input())
s = input()
t = input()
print('YES')
if s[0] == s[1]:
	if t[0] == t[1]:
		ret = 'abc'
	else:
		ret = refr[t]
	print(ret * n)
else:
	ret = refr[s]
	if t[0] == t[1]:
		print(ret * n)
	elif t[0] == s[0] and t[1] != s[1]:
		print(s[1] * n + t[1] * n + s[0] * n)
	elif t[1] == s[1] and t[0] != s[0]:
		print(s[1] * n + s[0] * n + t[0] * n)
	elif t[0] == s[1] and t[1] == s[0]:
		char = ['a', 'b', 'c']
		char.remove(s[0])
		char.remove(s[1])
		ret = s[0] + char[0] + s[1]
		ret_rev = s[1] + char[0] + s[0]
		print((ret + ret_rev) * (n // 2) + ret * (n % 2))
	else:
		print(ret * n)


n = int(input())
s = input()
t = input()
mylist = []
mylist.append('abc' * n)
mylist.append('a' * n + 'b' * n + 'c' * n)
mylist.append('acb' * n)
mylist.append('a' * n + 'c' * n + 'b' * n)
mylist.append('bac' * n)
mylist.append('b' * n + 'a' * n + 'c' * n)
mylist.append('bca' * n)
mylist.append('b' * n + 'c' * n + 'a' * n)
mylist.append('cab' * n)
mylist.append('c' * n + 'a' * n + 'b' * n)
mylist.append('cba' * n)
mylist.append('c' * n + 'b' * n + 'a' * n)
flag = False
for i in mylist:
	if s not in i and t not in i:
		print('YES')
		print(i)
		flag = True
		break
if not flag:
	print('No')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

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

def iterative(f, stack=[]):

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

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

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

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

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

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

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

def fsep():
	return map(float, inp().split())

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

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

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

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

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	n = N()
	s = inp()
	t = inp()
	potentials = []
	per = permutate('abc', 3)
	for i in per:
		(a, b, c) = i
		temp1 = (a + b + c) * n
		temp2 = a * n + b * n + c * n
		potentials.append(temp1)
		potentials.append(temp2)
	for i in potentials:
		if s not in i and t not in i:
			print('YES')
			print(i)
			return
	print('NO')
solve()


def rm(ch1, ch2):
	if ch1 == 'a' and ch2 == 'b':
		return 'c'
	elif ch1 == 'b' and ch2 == 'a':
		return 'c'
	elif ch1 == 'b' and ch2 == 'c':
		return 'a'
	elif ch1 == 'c' and ch2 == 'b':
		return 'a'
	elif ch1 == 'a' and ch2 == 'c':
		return 'b'
	elif ch1 == 'c' and ch2 == 'a':
		return 'b'
	elif ch1 == 'a' and ch2 == 'a':
		return ['b', 'c']
	elif ch1 == 'c' and ch2 == 'c':
		return ['a', 'b']
	elif ch1 == 'b' and ch2 == 'b':
		return ['a', 'c']

def kk(s, t):
	ans = ''
	if t[0] == t[1]:
		ans = n * 'abc'
	elif t[0] == s[0]:
		ans = n * (s[0] + rm(t[0], t[1]) + t[1])
	elif s[0] == t[1]:
		ans = n * (s[0] + t[0] + rm(t[0], t[1]))
	else:
		ans = n * (t[0] + s[0] + t[1])
	print('YES')
	print(ans)
L = ['aaa', 'aab', 'aac', 'aba', 'abb', 'abc', 'aca', 'acb', 'acc', 'baa', 'bab', 'bac', 'bba', 'bbb', 'bbc', 'bca', 'bcb', 'bcc', 'caa', 'cab', 'cac', 'cba', 'cbb', 'cbc', 'cca', 'ccb', 'ccc']
n = int(input())
s = input()
t = input()
if s[0] == s[1]:
	kk(s, t)
elif t[0] == t[1]:
	kk(t, s)
elif s == t:
	ans = n * (t[0] + rm(t[0], t[1]) + t[1])
	print('YES')
	print(ans)
elif s[0] == t[0] and s[0] != t[1] and (s[0] != s[1]):
	d = rm(s[0], t[0])
	ans = n * d[0] + n * d[1] + n * s[0]
	print('YES')
	print(ans)
elif s == t[::-1]:
	ans = n * s[0] + n * rm(s[0], s[1]) + n * s[1]
	print('YES')
	print(ans)
elif s[1] == t[0] and s[1] != s[0] and (s[1] != t[1]):
	ans = n * (s[0] + t[1] + s[1])
	print('YES')
	print(ans)
elif s[0] == t[1] and s[0] != s[1] and (t[0] != t[1]):
	ans = n * t[1] + n * t[0] + n * s[1]
	print('YES')
	print(ans)
elif s[1] == t[1] and s[0] != s[1] and (t[0] != t[1]):
	ans = n * t[1] + n * t[0] + n * s[0]
	print('YES')
	print(ans)
else:
	ans = 'krupal'
	print('NO')


from sys import stdin
input = stdin.readline
n = int(input())
(s, t) = map(str, stdin.read().split())
res = []
for a in {'a', 'b', 'c'}:
	for b in {'a', 'b', 'c'}:
		for c in {'a', 'b', 'c'}:
			if a != b and a != c and (b != c):
				res.append((a + b + c) * n)
				res.append(a * n + b * n + c * n)
ok = 0
for i in res:
	if not (s in i or t in i):
		ok = 1
		print('YES')
		print(i)
		break
if not ok:
	print('NO')


n = int(input())
s = input()
t = input()
s1 = {'ab', 'bc', 'ca'}
s2 = {'ba', 'ac', 'cb'}
s1n = s1 - {s, t}
s2n = s2 - {s, t}
if len(s1n) == 3:
	print('YES')
	print('abc' * n)
elif len(s2n) == 3:
	print('YES')
	print('bac' * n)
else:
	print('YES')
	ss1 = 'bca' if s == 'ab' or t == 'ab' else 'abc' if s == 'ca' or t == 'ca' else 'cab'
	print(ss1[0] * n + ss1[1] * n + ss1[2] * n)


n = int(input())
s = input()
t = input()
print('YES')
if len(set(s + t)) == 1:
	print('abc' * n)
elif len(set(s + t)) == 2:
	if t[0] == t[1]:
		(s, t) = (t, s)
	if s[0] == s[1]:
		a = s[0]
		b = list(set(s + t) - {a})[0]
		c = list(set('abc') - {a, b})[0]
		if s[0] == t[1]:
			(b, c) = (c, b)
		print((b + a + c) * n)
	else:
		(a, b) = s
		c = list(set('abc') - {a, b})[0]
		print(a * n + c * n + b * n)
else:
	if t[0] == t[1]:
		(s, t) = (t, s)
	if s[0] == s[1]:
		a = s[0]
		(b, c) = t
		print((b + a + c) * n)
	else:
		if s[0] == t[0]:
			(c, a) = s
			b = t[1]
		elif s[1] == t[1]:
			(b, a) = s
			c = t[0]
		elif s[0] == t[1]:
			(c, b) = s
			a = t[0]
		else:
			(b, a) = s
			c = t[1]
		print(a * n + b * n + c * n)


n = int(input())
(s, t) = (input(), input())
res = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
for i in res:
	flag1 = flag2 = 0
	s1 = i * n
	s2 = i[0] * n + i[1] * n + i[2] * n
	if s not in s1:
		if t not in s1:
			flag1 = 1
			print('YES\n', s1)
			break
	if s not in s2:
		if t not in s2:
			flag2 = 1
			print('YES\n', s2)
			break
if flag1 == 0 and flag2 == 0:
	print('NO')


n = int(input())
s = input()
t = input()
c = 'abc'
k = 0
a1 = 0
a2 = 0
ans = ''
for i in c:
	for j in c:
		for k in c:
			if i != j and i != k and (j != k):
				a1 = 0
				a2 = 0
				st1 = (i + j + k) * n
				st2 = i * n + j * n + k * n
				for p in range(3 * n - 1):
					if st1[p:p + 2] == s or st1[p:p + 2] == t:
						a1 = 1
					if st2[p:p + 2] == s or st2[p:p + 2] == t:
						a2 = 1
					if a1 == 1 and a2 == 1:
						break
				if a1 != 1:
					ans = st1
					break
				elif a2 != 1:
					ans = st2
					break
		if ans != '':
			break
	if ans != '':
		break
print('YES')
print(ans)


n = int(input())
s = ''
s1 = input()
s2 = input()
reps = ['abca', 'acba', 'acacb', 'bcaca', 'cacab', 'bacac', 'bcbca', 'abcbc', 'cbcba', 'acbcb', 'ababc', 'cabab', 'babac', 'cbaba']

def v(l):
	for i in range(1, len(reps[l])):
		st = reps[l][i - 1] + reps[l][i]
		if st == s1 or st == s2:
			return False
	return True
s = ''
i = 0
while i < len(reps):
	if v(i):
		if i < 2:
			s = ''
			st = reps[i][:3]
			for j in range(0, n):
				s += st
			break
		elif i % 2 == 0:
			s = ''
			st = ''.join(reps[i][:2])
			for j in range(0, n):
				s += st
			st = reps[i][-1]
			for j in range(0, n):
				s += st
			break
		else:
			s = ''
			st = reps[i][0]
			for j in range(0, n):
				s += st
			st = ''.join(reps[i][-2:])
			for j in range(0, n):
				s += st
			break
	i += 1
if len(s) > 0:
	print('YES')
	print(s)
else:
	print('NO')


permutations = ['abc', 'acb', 'bca', 'bac', 'cba', 'cab']
n = int(input())
s = input()
t = input()
for perm in permutations:
	candidates = [''.join([p * n for p in perm]), ''.join([p for p in perm]) * n]
	for each in candidates:
		if s not in each and t not in each:
			print('YES')
			print(each)
			exit(0)
exit(1)


from itertools import permutations
n = int(input())
s = input()
t = input()
f = 0
for i in permutations('abc'):
	d = ''.join(i) * n
	e = i[0] * n + i[1] * n + i[2] * n
	if s not in d and t not in d:
		print('Yes')
		print(d)
		f = 1
		break
	if s not in e and t not in e:
		print('Yes')
		print(e)
		f = 1
		break
if f == 0:
	print('No')


n = int(input())
s = input()
t = input()
lst = []
lst.append('abc' * n)
lst.append('acb' * n)
lst.append('bca' * n)
lst.append('bac' * n)
lst.append('cab' * n)
lst.append('cba' * n)
lst.append('a' * n + 'b' * n + 'c' * n)
lst.append('a' * n + 'c' * n + 'b' * n)
lst.append('b' * n + 'a' * n + 'c' * n)
lst.append('b' * n + 'c' * n + 'a' * n)
lst.append('c' * n + 'b' * n + 'a' * n)
lst.append('c' * n + 'a' * n + 'b' * n)
for i in lst:
	if i.find(s) == -1 and i.find(t) == -1:
		print('YES')
		print(i)
		break
else:
	print('NO')


from sys import stdin
from copy import deepcopy
from collections import deque, defaultdict
n = int(stdin.readline().strip())
s = stdin.readline().strip()
t = stdin.readline().strip()
ans = ''
if s > t:
	(s, t) = (t, s)
if s not in ['aa', 'bb', 'cc'] and t not in ['aa', 'bb', 'cc']:
	arr = ['aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc']
	if s == 'ab' and t == 'ac':
		ans = 'b' * n + 'c' * n + 'a' * n
	elif s == 'ba' and t == 'bc':
		ans = 'a' * n + 'c' * n + 'b' * n
	elif s == 'ca' and t == 'cb':
		ans = 'a' * n + 'b' * n + 'c' * n
	elif s == 'ab':
		if t == 'ab':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'ba':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'bc':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'ca':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'cb':
			ans = 'b' * n + 'a' * n + 'c' * n
	elif s == 'ac':
		if t == 'ac':
			ans = 'a' * n + 'b' * n + 'c' * n
		elif t == 'ba':
			ans = 'a' * n + 'b' * n + 'c' * n
		elif t == 'bc':
			ans = 'c' * n + 'a' * n + 'b' * n
		elif t == 'ca':
			ans = 'a' * n + 'b' * n + 'c' * n
		elif t == 'cb':
			ans = 'a' * n + 'b' * n + 'c' * n
	if s == 'ba':
		if t == 'ba':
			ans = 'a' * n + 'b' * n + 'c' * n
		elif t == 'bc':
			ans = 'c' * n + 'a' * n + 'b' * n
		elif t == 'ca':
			ans = 'a' * n + 'b' * n + 'c' * n
		elif t == 'cb':
			ans = 'a' * n + 'b' * n + 'c' * n
	if s == 'bc':
		if t == 'bc':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'ca':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'cb':
			ans = 'b' * n + 'a' * n + 'c' * n
	if s == 'ca':
		if t == 'ca':
			ans = 'a' * n + 'c' * n + 'b' * n
		elif t == 'cb':
			ans = 'b' * n + 'a' * n + 'c' * n
	if s == 'cb':
		if t == 'cb':
			ans = 'b' * n + 'a' * n + 'c' * n
	if ans != '':
		print('YES')
		print(ans)
	else:
		print('NO')
else:
	if s == 'aa':
		if t == 'aa':
			ans = 'ab' * n + 'c' * n
		elif t == 'ab':
			ans = 'ac' * n + 'b' * n
		elif t == 'ac':
			ans = 'ab' * n + 'c' * n
		elif t == 'ba':
			ans = 'ac' * n + 'b' * n
		elif t == 'bb':
			ans = 'ab' * n + 'c' * n
		elif t == 'bc':
			ans = 'ac' * n + 'b' * n
		elif t == 'ca':
			ans = 'ab' * n + 'c' * n
		elif t == 'cb':
			ans = 'ab' * n + 'c' * n
		elif t == 'cc':
			ans = 'ac' * n + 'b' * n
	elif s == 'ab':
		if t == 'bb':
			ans = 'bc' * n + 'a' * n
		elif t == 'cc':
			ans = 'ac' * n + 'b' * n
	elif s == 'ac':
		if t == 'bb':
			ans = 'bc' * n + 'a' * n
		elif t == 'cc':
			ans = 'bc' * n + 'a' * n
	elif s == 'ba':
		if t == 'bb':
			ans = 'bc' * n + 'a' * n
		elif t == 'cc':
			ans = 'bc' * n + 'a' * n
	elif s == 'bb':
		if t == 'bb':
			ans = 'ab' * n + 'c' * n
		elif t == 'bc':
			ans = 'ba' * n + 'c' * n
		elif t == 'ca':
			ans = 'ab' * n + 'c' * n
		elif t == 'cb':
			ans = 'ab' * n + 'c' * n
		elif t == 'cc':
			ans = 'bc' * n + 'a' * n
	if s == 'bc':
		if t == 'cc':
			ans = 'ac' * n + 'b' * n
	if s == 'ca':
		if t == 'cc':
			ans = 'cb' * n + 'a' * n
	if s == 'cb':
		if t == 'cc':
			ans = 'ca' * n + 'b' * n
	elif s == 'cc':
		if t == 'cc':
			ans = 'bc' * n + 'a' * n
	if ans != '':
		print('YES')
		print(ans)
	else:
		print('NO')


n = int(input())
a = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cab' * n, 'cba' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'b' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n]
b = input()
c = input()
for i in a:
	if b not in i and c not in i:
		print('YES')
		print(i)
		exit()
print('NO')


n = int(input())
s = input()
t = input()
print('YES')
for st in (s, t):
	if st in 'abca':
		break
else:
	print('abc' * n)
	exit()
for st in (s, t):
	if st in 'acba':
		break
else:
	print('acb' * n)
	exit()
(s1, s2) = s
(t1, t2) = t
for ans in (s2, chr(ord('b') * 3 - ord(s1) - ord(s2)), s1):
	print(end=ans * n)


n = int(input())
s1 = input()
s2 = input()
print('YES')
ans = []
if len(set(s1)) == 1 and len(set(s2)) == 1:
	for i in range(3 * n):
		if i % 3 == 0:
			ans.append('a')
		elif i % 3 == 1:
			ans.append('b')
		else:
			ans.append('c')
	print(''.join(ans))
	exit()
if len(set(s1 + s2)) == 3 or s1 == s2 or s1 == s2[::-1]:
	lo1 = ['a', 'b', 'c']
	lo2 = ['a', 'c', 'b']
	lo3 = ['b', 'c', 'a']
	lo4 = ['b', 'a', 'c']
	lo5 = ['c', 'a', 'b']
	lo6 = ['c', 'b', 'a']
	lo = [lo1, lo2, lo3, lo4, lo5, lo6]
	ka = []
	for i in lo:
		if i[0] + i[1] != s1 and i[0] + i[1] != s2 and (i[1] + i[2] != s1) and (i[1] + i[2] != s2):
			ans = i[0] * n + i[1] * n + i[2] * n
			break
	if len(set(s1)) == 1:
		ka.append(s1[0])
	elif len(set(s2)) == 1:
		ka.append(s2[0])
	if ka == []:
		print(ans)
	else:
		ans = []
		for i in range(2 * n):
			if len(set(s2)) != 1:
				if i % 2 == 0:
					ans.append(ka[0])
				else:
					ans.append(s2[1])
			elif i % 2 == 0:
				ans.append(ka[0])
			else:
				ans.append(s1[1])
		for i in range(n):
			if len(set(s2)) != 1:
				ans.append(s2[0])
			else:
				ans.append(s1[0])
		print(''.join(ans))
	exit()
if 'a' in s1 and 'a' in s2:
	ans.append('a')
	flag = 0
	for i in range(1, 2 * n):
		z1 = ans[-1] + 'a'
		z2 = 'a' + ans[-1]
		if z1 == s1 or z2 == s2:
			flag = 1
			break
		elif i <= n - 1:
			ans.append('a')
		elif 'b' in s1 or 'b' in s2:
			ans.append('b')
		else:
			ans.append('c')
	if flag == 1:
		for i in range(1, 2 * n):
			if i % 2 != 0:
				if 'b' in s1 or 'b' in s2:
					ans.append('c')
				else:
					ans.append('b')
			else:
				ans.append('a')
elif 'c' in s1 and 'c' in s2:
	ans.append('c')
	flag = 0
	for i in range(1, 2 * n):
		z1 = ans[-1] + 'c'
		z2 = 'c' + ans[-1]
		if z1 == s1 or z2 == s2:
			flag = 1
			break
		elif i <= n - 1:
			ans.append('c')
		elif 'b' in s1 or 'b' in s2:
			ans.append('b')
		else:
			ans.append('a')
	if flag == 1:
		for i in range(1, 2 * n):
			if i % 2 != 0:
				if 'b' in s1 or 'b' in s2:
					ans.append('a')
				else:
					ans.append('b')
			else:
				ans.append('c')
elif 'b' in s1 and 'b' in s2:
	ans.append('b')
	flag = 0
	for i in range(1, 2 * n):
		z1 = ans[-1] + 'b'
		z2 = 'b' + ans[-1]
		if z1 == s1 or z2 == s2:
			flag = 1
			break
		elif i <= n - 1:
			ans.append('b')
		elif 'a' in s1 or 'a' in s2:
			ans.append('a')
		else:
			ans.append('c')
	if flag == 1:
		for i in range(1, 2 * n):
			if i % 2 != 0:
				if 'a' in s1 or 'a' in s2:
					ans.append('c')
				else:
					ans.append('a')
			else:
				ans.append('b')
count1 = ans.count('a')
count2 = ans.count('b')
count3 = ans.count('c')
while count1 != n:
	ans.append('a')
	count1 += 1
while count2 != n:
	ans.append('b')
	count2 += 1
while count3 != n:
	ans.append('c')
	count3 += 1
print(''.join(ans))


import sys
input = sys.stdin.readline
N = int(input())
S = input().rstrip()
T = input().rstrip()

def other(P):
	for s in ['a', 'b', 'c']:
		if not s in P:
			return s
if S[0] == S[1]:
	if S == T:
		tmp = S[0]
		for a in ['a', 'b', 'c']:
			if not a in S:
				tmp += a
		ans = tmp * N
	elif T[0] == S[0]:
		ans = (S[0] + other(S + T) + T[1]) * N
	elif T[1] == S[0]:
		ans = (S[0] + T[0] + other(S + T)) * N
	else:
		ans = (S[0] + T[1] + other(S + T[1])) * N
elif T[0] == T[1]:
	if S[0] == T[0]:
		ans = (T[0] + other(S + T) + S[1]) * N
	elif S[1] == T[0]:
		ans = (T[0] + S[0] + other(S + T)) * N
	else:
		ans = (T[0] + S[1] + other(T + S[1])) * N
elif S[0] == T[0]:
	ans = S[1] * N + other(S) * N + S[0] * N
elif S[1] == T[1]:
	ans = S[1] * N + S[0] * N + T[0] * N
elif S[0] == T[1]:
	ans = S[0] * N + other(S) * N + S[1] * N
else:
	ans = T[0] * N + other(T) * N + T[1] * N
print('YES')
print(ans)


import sys
from collections import defaultdict
n = int(sys.stdin.readline())
s = sys.stdin.readline()[:-1]
t = sys.stdin.readline()[:-1]
dic = defaultdict(list)
dic['abc'] = ['ab', 'bc', 'ca']
dic['acb'] = ['ac', 'cb', 'ba']
dic['bac'] = ['ba', 'ac', 'cb']
dic['bca'] = ['bc', 'ca', 'ab']
dic['cab'] = ['ca', 'ab', 'bc']
dic['cba'] = ['cb', 'ba', 'ac']
for x in dic:
	if s not in dic[x] and t not in dic[x]:
		print('YES')
		res = x * n
		print(res)
		sys.exit()
for x in dic:
	if s not in dic[x][:-1] and t not in dic[x][:-1]:
		(a, b, c) = (x[0], x[1], x[2])
		res = a * n + b * n + c * n
		print('YES')
		print(res)
		sys.exit()
print('NO')


def solve(n, s1, s2):
	if s1 not in 'abca' and s2 not in 'abca':
		return 'abc' * n
	if s1 not in 'cbac' and s2 not in 'cbac':
		return 'cba' * n
	if s1[0] == s2[0]:
		return ''.join(set('abc') - {s1[0]}) * n + s1[0] * n
	if s1[1] == s2[1]:
		return s1[1] * n + ''.join(set('abc') - {s1[1]}) * n
	if n == 1:
		return ''
	else:
		other = set('abc') - set(s1)
		k = s1[0] + other.pop()
		return k * n + s1[1] * n
n = int(input())
s1 = input()
s2 = input()
x = solve(n, s1, s2)
if not x:
	print('NO')
else:
	print('YES')
	print(x)


from collections import *
n = int(input())
s = input()
t = input()
l = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
for li in l:
	S = li + li + li
	se = set()
	for i in range(len(S) - 1):
		se.add(S[i:i + 2])
	if s not in se and t not in se:
		print('YES')
		print(li * n)
		break
	se = {li[0] * 2, li[1] * 2, li[2] * 2, li[:2], li[1:3]}
	if s not in se and t not in se:
		print('YES')
		print(li[0] * n + li[1] * n + li[2] * n)
		break
else:
	print('NO')


n = input()
a = input()
b = input()
n = int(n)
first = 'abc'
second = 'bac'
tmp1 = first + first
tmp2 = second + second
firstArr = ['ab', 'bc', 'ca']
secondArr = ['ba', 'cb', 'ac']
arrs = [0, 0]
if a in firstArr or b in firstArr:
	arrs[0] = 1
if a in secondArr or b in secondArr:
	arrs[1] = 1
print('YES')
if arrs[0] != 1:
	res = ''
	for i in range(n):
		res += first
	print(res)
	exit()
if arrs[1] != 1:
	res = ''
	for i in range(n):
		res += second
	print(res)
	exit()

def Method(mystr, a, b, arr):
	c = ''
	if a in arr:
		c = a
	if b in arr:
		c = b
	for i in range(3):
		tmp = ''
		for j in range(3):
			tmp += mystr[(i + j) % 3]
		tmptmp = tmp + tmp
		if c == tmptmp[2:4]:
			return tmp
tmpRes = Method(first, a, b, firstArr)
res = ''
for i in range(n):
	res += tmpRes[0]
for i in range(n):
	res += tmpRes[1]
for i in range(n):
	res += tmpRes[2]
print(res)


import itertools
n = int(input())
(a, b) = input()
(c, d) = input()
right_pattern = ()
short_patterns = list(itertools.permutations(['a', 'b', 'c']))
if n >= 2:
	for i in short_patterns:
		i += i
		right = True
		for j in range(len(i) - 1):
			if (i[j], i[j + 1]) == (a, b) or (i[j], i[j + 1]) == (c, d):
				right = False
		if right:
			right_pattern = i
else:
	for i in short_patterns:
		right = True
		if i[0:2] == (a, b) or i[1:] == (c, d) or i[1:] == (a, b) or (i[0:2] == (c, d)):
			right = False
		if right:
			right_pattern = i
if right_pattern != ():
	print('YES')
	for i in range(n * 3):
		print(right_pattern[i % len(right_pattern)], end='')
	print()
else:
	faith = False
	for i in short_patterns:
		right = True
		if i[0:2] == (a, b) or i[1:] == (c, d) or i[1:] == (a, b) or (i[0:2] == (c, d)):
			right = False
		if right:
			right_pattern = i
			faith = True
	if faith:
		print('YES')
		for i in right_pattern:
			print(*[i for _ in range(n)], sep='', end='')
	else:
		print('NO')


n = int(input())
s = input()
t = input()
us = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
flag = 0
for u in us:
	if s in u or t in u:
		continue
	if n > 1 and (s in u[2] + u[0] or t in u[2] + u[0]):
		continue
	flag = 1
	print('YES')
	print(u * n)
	exit()
if not flag:
	for u in us:
		if s in u or t in u:
			continue
		print('YES')
		print(u[0] * n + u[1] * n + u[2] * n)
		exit()


import queue
n = int(input())
w1 = input()
w2 = input()

def getsuit(ws, sw):
	q = queue.Queue()
	q.put('a')
	q.put('b')
	q.put('c')
	while not q.empty():
		w = q.get()
		if len(w) == 3:
			if sw or w[-1] + w[0] not in ws:
				return w
			else:
				continue
		for c in ['a', 'b', 'c']:
			if c in w:
				continue
			if w[-1] + c in ws:
				continue
			q.put(w + c)
	return 'NO'
ans = getsuit([w1, w2], False)
if ans != 'NO':
	print('YES')
	for i in ans * n:
		print(i, end='')
else:
	ans = getsuit([w1, w2], True)
	if ans != 'NO':
		print('YES')
		for i in ans:
			print(i * n, end='')
	else:
		print('NO')


n = int(input())
s = input()
t = input()
a = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
b = ['a', 'b', 'c']
a[b.index(s[0])][b.index(s[1])] = 1
a[b.index(t[0])][b.index(t[1])] = 1
tr = a[0][0] + a[1][1] + a[2][2]
print('YES')
if s == t:
	if s[0] == s[1]:
		print('abc' * n)
	else:
		i = 0
		while b[i] == s[0] or b[i] == s[1]:
			i += 1
		print(s[0] * n + b[i] * n + s[1] * n)
else:
	max_row_sum = 0
	for i in range(3):
		if a[i][0] + a[i][1] + a[i][2] > max_row_sum:
			max_row_sum = a[i][0] + a[i][1] + a[i][2]
			index = i
	max_col_sum = 0
	for i in range(3):
		if a[0][i] + a[1][i] + a[2][i] > max_col_sum:
			max_col_sum = a[0][i] + a[1][i] + a[2][i]
			index_col = i
	if tr == 2:
		print('abc' * n)
	elif tr == 0 and max_row_sum == 2:
		i = 0
		while i == index:
			i += 1
		j = 0
		while i == j or index == j:
			j += 1
		print(b[i] * n + b[j] * n + b[index] * n)
	elif tr == 1:
		for i in range(3):
			for j in range(3):
				if a[i][j] and i != j:
					for k in range(3):
						if k != i and k != j:
							print((b[j] + b[i] + b[k]) * n)
	elif max_col_sum == 2:
		i = 0
		while i == index_col:
			i += 1
		j = 0
		while i == j or index_col == j:
			j += 1
		print(b[index_col] * n + b[j] * n + b[i] * n)
	elif s[0] == t[1] and s[1] == t[0]:
		i = 0
		while b[i] == s[0] or b[i] == s[1]:
			i += 1
		print(s[0] * n + b[i] * n + s[1] * n)
	else:
		i = 0
		while a[index][i] != 0 or i == index:
			i += 1
		for j in range(3):
			if j != index and j != i:
				print((b[index] + b[i] + b[j]) * n)


n = int(input())
ss = input()
t = input()
s = ['' for i in range(15)]
s[1] = 'abc' * n
s[2] = 'acb' * n
s[3] = 'bac' * n
s[4] = 'bca' * n
s[5] = 'cab' * n
s[6] = 'cba' * n
s[7] = 'a' * n + 'b' * n + 'c' * n
s[8] = 'a' * n + 'c' * n + 'b' * n
s[9] = 'b' * n + 'a' * n + 'c' * n
s[10] = 'b' * n + 'c' * n + 'a' * n
s[11] = 'c' * n + 'a' * n + 'b' * n
s[12] = 'c' * n + 'b' * n + 'a' * n
for i in range(1, 13):
	if ss not in s[i] and t not in s[i]:
		print('YES')
		print(s[i])
		break


n = int(input())
a = input()
b = input()
poss = ('abc', 'acb', 'bac', 'bca', 'cab', 'cba')
for pos in poss:
	a_ = pos * n
	b_ = pos[0] * n + pos[1] * n + pos[2] * n
	if not a in a_ and (not b in a_):
		print('YES')
		print(a_)
		break
	elif not a in b_ and (not b in b_):
		print('YES')
		print(b_)
		break


N = int(input())
pir = input()
ant = input()

def check(s):
	return pir not in s and ant not in s

def good(s):
	print('YES')
	print(s)
	exit(0)
a = 'a' * N
b = 'b' * N
c = 'c' * N
ab = 'ab' * N
ac = 'ac' * N
ba = 'ba' * N
bc = 'bc' * N
ca = 'ca' * N
cb = 'cb' * N
abc = 'abc' * N
acb = 'acb' * N
bac = 'bac' * N
bca = 'bca' * N
cab = 'cab' * N
cba = 'cba' * N
for i in [abc, acb, bac, bca, cab, cba]:
	if check(i):
		good(i)
for i in [a + b + c, a + c + b, b + a + c, b + c + a, c + a + b, c + b + a]:
	if check(i):
		good(i)
for i in [ab + c, c + ab, ac + b, b + ac, ba + c, c + ba, bc + a, a + bc, ca + b, b + ca, cb + a, a + cb]:
	if check(i):
		good(i)
print('NO')


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

def selfrepeat(string):
	return string[0] == string[1]

def main(str1, str2, n):
	if selfrepeat(str1) or selfrepeat(str2):
		cand1 = 'abc' * n
		cand2 = 'cba' * n
		if str1 not in cand1 and str2 not in cand1:
			return cand1
		else:
			return cand2
	else:
		cand1 = 'a' * n + 'b' * n + 'c' * n
		cand2 = 'b' * n + 'a' * n + 'c' * n
		cand3 = 'c' * n + 'b' * n + 'a' * n
		cand4 = 'a' * n + 'c' * n + 'b' * n
		cand5 = 'b' * n + 'c' * n + 'a' * n
		cand6 = 'c' * n + 'a' * n + 'b' * n
		cand = [cand1, cand2, cand3, cand4, cand5, cand6]
		for candi in cand:
			if str1 not in candi:
				if str2 not in candi:
					return candi
print('YES')
print(main(s, t, n))


import itertools
import sys
input = sys.stdin.readline
n = int(input())
s = input().rstrip()
t = input().rstrip()
x = set([s, t])
y = ['a', 'b', 'c']
ans = 'YES'
for p in itertools.permutations(y):
	u = [p[0], p[0], p[1], p[1], p[2], p[2]]
	ok = 1
	for i in range(5):
		if u[i] + u[i + 1] in x:
			ok = 0
			break
	if ok:
		res = p[0] * n + p[1] * n + p[2] * n
		print(ans)
		print(res)
		exit()
	u = [p[0], p[1], p[0], p[1], p[2], p[2]]
	ok = 1
	for i in range(5):
		if u[i] + u[i + 1] in x:
			ok = 0
			break
	if ok:
		res = (p[0] + p[1]) * n + p[2] * n
		print(ans)
		print(res)
		exit()
	u = [p[0], p[0], p[1], p[2], p[1], p[2]]
	ok = 1
	for i in range(5):
		if u[i] + u[i + 1] in x:
			ok = 0
			break
	if ok:
		res = p[0] * n + (p[1] + p[2]) * n
		print(ans)
		print(res)
		exit()
ans = 'NO'
print(ans)


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from itertools import permutations
alls = 'abc'
permlist = [''.join(perms) for perms in list(permutations(alls))]
answer = []
(n, s, t) = (RI(), RW(), RW())
for i in permlist:
	answer.append(i * n)
	curr = ''
	curr = i[0] * n
	curr += i[1] * n
	curr += i[2] * n
	answer.append(curr)
valid = 'NO'
for i in answer:
	if s in i or t in i:
		continue
	else:
		valid = 'YES'
		break
print(valid)
if valid == 'YES':
	print(i)


n = int(input())
s = input()
t = input()
arr = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
print('YES')
flag = 0
for i in range(6):
	arr[i] = arr[i] * n
	if s not in arr[i] and t not in arr[i]:
		print(arr[i])
		flag = 1
		break
if flag == 0:
	s1 = 'a' * n
	s2 = 'b' * n
	s3 = 'c' * n
	arr = [s1 + s2 + s3, s1 + s3 + s2, s2 + s1 + s3, s2 + s3 + s1, s3 + s1 + s2, s3 + s2 + s1]
	for x in arr:
		if s not in x and t not in x:
			print(x)
			break


print('YES\n' + [[q for q in ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cab' * n, 'cba' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'c' * n + 'b' * n + 'a' * n] if s not in q and t not in q][0] for (n, s, t) in [[int(input()), input(), input()]]][0])


n = int(input())
q = input()
w = input()
l = ['abcabc', 'acbacb', 'bacbac', 'bcabca', 'cabcab', 'cbacba']
ans = ''
for t in l:
	if q not in t:
		if w not in t:
			ans += t
			break
if ans == '':
	print('YES')
	p = [q[0], q[1]]
	for g in range(n):
		print(q[1], end='')
	s = 'abc'
	for r in s:
		if r not in p:
			s = r
			break
	for t1 in range(n):
		print(s, end='')
	for tty in range(n):
		print(q[0], end='')
else:
	print('YES')
	pr = ''
	for i in range(3):
		pr += ans[i]
	for j in range(n):
		print(pr, end='')


n = int(input())
s = input()
s1 = input()
p = ['a', 'b', 'c']
if s[0] == s1[0] or s1[1] == s[1]:
	if s == s1:
		for i in range(3):
			for j in range(3):
				for k in range(3):
					ss = p[i] + p[j] + p[k]
					if p[i] != p[j] and p[i] != p[k] and (p[j] != p[k]):
						if s not in ss and s1 not in ss:
							if n == 1:
								print('YES')
								print(ss)
								exit()
							if ss[-1] + ss[0] != s and ss[-1] + ss[0] != s1:
								print('YES')
								print(ss * n)
								exit()
		print('NO')
		exit()
	else:
		if s[0] == s[1] or s1[0] == s1[1]:
			if s[0] == s[1]:
				k = ['a', 'b', 'c']
				k.pop(k.index(s1[0]))
				k.pop(k.index(s1[1]))
				print('YES')
				print((s1[0] + k[0] + s1[1]) * n)
			else:
				k = ['a', 'b', 'c']
				k.pop(k.index(s[0]))
				k.pop(k.index(s[1]))
				print('YES')
				print((s[0] + k[0] + s[1]) * n)
			exit()
		print('YES')
		if s[0] == s1[0]:
			print(s[1] * n + s1[1] * n + s[0] * n)
		else:
			print(s[1] * n + s[0] * n + s1[0] * n)
		exit()
if s == s1[::-1]:
	print('YES')
	p.pop(p.index(s[0]))
	p.pop(p.index(s[1]))
	k = s[0] + p[0] + s[1]
	for i in range(n):
		if i % 2:
			print(k[::-1], end='')
		else:
			print(k, end='')
	exit()
for i in range(3):
	for j in range(3):
		for k in range(3):
			ss = p[i] + p[j] + p[k]
			if p[i] != p[j] and p[i] != p[k] and (p[j] != p[k]):
				if s not in ss and s1 not in ss:
					if n == 1:
						print('YES')
						print(ss)
						exit()
					if ss[-1] + ss[0] != s and ss[-1] + ss[0] != s1:
						print('YES')
						print(ss * n)
						exit()


from itertools import permutations

def good(s, t, r):
	for i in range(len(s) - 1):
		pa = s[i:i + 2]
		if pa == t or pa == r:
			return False
	return True
n = int(input())
s = input()
t = input()
l = []
for p in permutations('abc'):
	l.append(p[0] * n + p[1] * n + p[2] * n)
	l.append((p[0] + p[1] + p[2]) * n)
print('YES')
for x in l:
	if good(x, s, t):
		print(x)
		exit()


from sys import stdin, stdout
input = stdin.readline
t = 1
for _ in range(t):
	n = int(input())
	s = input()[:-1]
	t = input()[:-1]
	if s != 'ab' and s != 'bc' and (s != 'ca') and (t != 'ab') and (t != 'bc') and (t != 'ca'):
		print('YES')
		for i in range(n):
			stdout.write('abc')
		stdout.write('\n')
		continue
	d = {'ab', 'bc', 'ca'}
	if s not in d:
		(s, t) = (t, s)
	print('YES')
	if s == 'ab':
		if t == 'aa':
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('ac')
			stdout.write('\n')
			continue
		if t == 'ab':
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('ac')
			stdout.write('\n')
			continue
		if t == 'ac':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('a')
			stdout.write('\n')
			continue
		if t == 'ba':
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('a')
			stdout.write('\n')
			continue
		if t == 'bb':
			for i in range(n):
				stdout.write('bc')
			for i in range(n):
				stdout.write('a')
			stdout.write('\n')
			continue
		if t == 'bc':
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'ca':
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'cb':
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'cc':
			for i in range(n):
				stdout.write('bc')
			for i in range(n):
				stdout.write('a')
			stdout.write('\n')
			continue
	if s == 'bc':
		if t == 'aa':
			for i in range(n):
				stdout.write('ca')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'ab':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'ac':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'ba':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'bb':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('ab')
			stdout.write('\n')
			continue
		if t == 'bc':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('ba')
			stdout.write('\n')
			continue
		if t == 'ca':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('a')
			stdout.write('\n')
			continue
		if t == 'cb':
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'cc':
			for i in range(n):
				stdout.write('ca')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
	if s == 'ca':
		if t == 'aa':
			for i in range(n):
				stdout.write('ab')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'ab':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'ac':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'ba':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'bb':
			for i in range(n):
				stdout.write('ab')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'bc':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'ca':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('c')
			for i in range(n):
				stdout.write('b')
			stdout.write('\n')
			continue
		if t == 'cb':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('b')
			for i in range(n):
				stdout.write('c')
			stdout.write('\n')
			continue
		if t == 'cc':
			for i in range(n):
				stdout.write('a')
			for i in range(n):
				stdout.write('bc')
			stdout.write('\n')
			continue


n = int(input())
l = ['ab', 'ac', 'ba', 'bc', 'ca', 'cb', 'aa', 'bb', 'cc']
s = input().rstrip()
t = input().rstrip()
G = 0
if n == 1:
	for i in range(0, len(l) - 3):
		if l[i] != s and l[i] != t:
			if 1:
				if i == 0:
					if 'bc' != s and 'bc' != t:
						print('YES')
						print(l[i] * n, end='')
						print('c' * n)
						G = 1
						break
				if i == 1:
					if 'cb' != s and 'cb' != t:
						print('YES')
						print(l[i] * n, end='')
						print('b' * n)
						G = 1
						break
				if i == 2:
					if 'ac' != s and 'ac' != t:
						print('YES')
						print(l[i] * n, end='')
						print('c' * n)
						G = 1
						break
				if i == 3:
					if 'ca' != s and 'ca' != t:
						print('YES')
						print(l[i] * n, end='')
						print('a' * n)
						G = 1
						break
				if i == 4:
					if 'ab' != s and 'ab' != t:
						print('YES')
						print(l[i] * n, end='')
						print('b' * n)
						G = 1
						break
				if i == 5:
					if 'ba' != s and 'ba' != t:
						print('YES')
						print(l[i] * n, end='')
						print('a' * n)
						G = 1
						break
	if G == 0:
		print('NO')
else:
	G = 0
	for i in range(0, len(l)):
		if l[i] != s and l[i] != t:
			T = list(l[i])
			T.reverse()
			C = ''.join(T)
			if C != s and C != t:
				if i == 0:
					if 'bc' != s and 'bc' != t and ('cc' != s) and ('cc' != t):
						print('YES')
						print(l[i] * n, end='')
						print('c' * n)
						G = 1
						break
				if i == 1:
					if 'cb' != s and 'cb' != t and ('bb' != s) and ('bb' != t):
						print('YES')
						print(l[i] * n, end='')
						print('b' * n)
						G = 1
						break
				if i == 2:
					if 'ac' != s and 'ac' != t and ('cc' != s) and ('cc' != t):
						print('YES')
						print(l[i] * n, end='')
						print('c' * n)
						G = 1
						break
				if i == 3:
					if 'ca' != s and 'ca' != t and ('aa' != s) and ('aa' != t):
						print('YES')
						print(l[i] * n, end='')
						print('a' * n)
						G = 1
						break
				if i == 4:
					if 'ab' != s and 'ab' != t and ('bb' != s) and ('bb' != t):
						print('YES')
						print(l[i] * n, end='')
						print('b' * n)
						G = 1
						break
				if i == 5:
					if 'ba' != s and 'ba' != t and ('aa' != s) and ('aa' != t):
						print('YES')
						print(l[i] * n, end='')
						print('a' * n)
						G = 1
						break
				if i == 6:
					if 'aa' != s and 'aa' != t:
						if 'ab' != s and 'ab' != t and ('bc' != s) and ('bc' != t):
							print('YES')
							print('a' * n, end='')
							print('b' * n, end='')
							print('c' * n)
							G = 1
							break
						elif 'ac' != s and 'ac' != t and ('cb' != s) and ('cb' != t):
							print('YES')
							print('a' * n, end='')
							print('c' * n, end='')
							print('b' * n)
							G = 1
							break
				if i == 7:
					if 'bb' != s and 'bb' != t:
						if 'ba' != s and 'ba' != t and ('ac' != s) and ('ac' != t):
							print('YES')
							print('b' * n, end='')
							print('a' * n, end='')
							print('c' * n)
							G = 1
							break
						elif 'bc' != s and 'bc' != t and ('ca' != s) and ('ca' != t):
							print('YES')
							print('b' * n, end='')
							print('c' * n, end='')
							print('a' * n)
							G = 1
							break
				if i == 8:
					if 'cc' != s and 'cc' != t:
						if 'ca' != s and 'ca' != t and ('ab' != s) and ('ab' != t):
							print('YES')
							print('c' * n, end='')
							print('a' * n, end='')
							print('b' * n)
							G = 1
							break
						elif 'cb' != s and 'cb' != t and ('ba' != s) and ('ba' != t):
							print('YES')
							print('c' * n, end='')
							print('b' * n, end='')
							print('a' * n)
							G = 1
							break
	if G == 0:
		print('sNO')


from sys import stdin, stdout
from collections import defaultdict
from collections import deque
import math
import copy
N = int(input())
s1 = input()
s2 = input()
valid = []
candidate = ['a', 'b', 'c']
for i in range(3):
	for j in range(3):
		if i == j:
			continue
		else:
			s = candidate[i] + candidate[j]
			if s == s1 or s == s2:
				continue
			valid.append(s)
c = ['abca', 'acba', 'bacb', 'bcab', 'cabc', 'cbac']
v = [1] * 6
if N == 1:
	for i in range(6):
		s = c[i]
		for j in range(2):
			tmp = c[i][j] + c[i][j + 1]
			if tmp not in valid:
				v[i] = 0
				break
	for i in range(6):
		if v[i] == 1:
			print('YES')
			print(c[i][:3])
			quit()
	print('NO')
	quit()
for i in range(6):
	s = c[i]
	for j in range(3):
		tmp = c[i][j] + c[i][j + 1]
		if tmp not in valid:
			v[i] = 0
			break
idx = -1
for i in range(6):
	if v[i] == 1:
		print('YES')
		idx = i
		break
if idx == -1:
	if s1[0] == s2[0] and s1[1] != s2[1]:
		print('YES')
		print(s1[1] * N, s2[1] * N, s1[0] * N, sep='')
	elif s1[1] == s2[1] and s1[0] != s2[0]:
		print('YES')
		print(s1[1] * N, s1[0] * N, s2[0] * N, sep='')
	elif s1[0] == s2[1] and s1[1] == s2[0]:
		middle = -1
		print('YES')
		for i in range(3):
			if candidate[i] != s1[0] and candidate[i] != s1[1]:
				middle = i
				break
		print(s1[0] * N, candidate[middle] * N, s1[1] * N, sep='')
	else:
		print('NO')
	quit()
ans = ''
for i in range(N):
	ans += c[idx][:3]
print(ans)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 1000000007
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
have = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
n = Int()
given = [input(), input()]
for i in have:
	ok = True
	if i[:2] not in given and i[1:] not in given and (i[-1] + i[0] not in given):
		print('YES')
		print(i * n, sep='')
		exit()
	if i[0:2] not in given and i[1:3] not in given:
		for j in 'abc':
			if j + j in given:
				ok = False
		if ok:
			print('YES')
			print(i[0] * n, i[1] * n, i[2] * n, sep='')
			exit()
print('NO')


import sys
n = int(input())
s = sys.stdin.readline().strip()
t = sys.stdin.readline().strip()

def fifi(n, s, t):
	yo = set('abc')
	prexises = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
	if n == 1:
		for prexis in prexises:
			if s not in prexis and t not in prexis:
				print('YES')
				print(prexis)
				return
	else:
		for prexis in prexises:
			if s not in prexis * 2 and t not in prexis * 2:
				print('YES')
				print(prexis * n)
				return
	if s[0] == t[0]:
		rest_element = yo - set(s[0])
		print('YES')
		print(rest_element.pop() * n + rest_element.pop() * n + s[0] * n)
		return
	elif s[1] == t[1]:
		rest_element = yo - set(s[1])
		print('YES')
		print(s[1] * n + rest_element.pop() * n + rest_element.pop() * n)
		return
	elif s[1] == t[0] and s[0] == t[1]:
		rest_element = yo - set(s)
		print('YES')
		print(s[0] * n + rest_element.pop() * n + s[1] * n)
	else:
		print('NO')
		return
fifi(n, s, t)


import itertools as it

def f(s, t, n):
	if len(set(s + t)) >= 3:
		if s[0] == t[0] and s[1] != t[1]:
			return n * (s[1] + t[1]) + s[0] * n
		if s[1] == t[1] and s[0] != t[0]:
			return s[1] * n + n * (s[0] + t[0])
	if s[0] == t[1] and s[1] == t[0] and (s[0] != s[1]):
		return n * t[0] + n * (set('abc') - set(s)).pop() + n * t[1]
	for a in it.permutations('abc', 3):
		a = ''.join(a)
		a = a + a
		if s not in a and t not in a:
			return a[:3] * n
	return None
n = int(input())
s = input()
t = input()
r = f(s, t, n)
assert s not in r
assert t not in r
assert r.count('a') == r.count('b') == r.count('c')
print('YES')
print(r)


def other(a, b):
	temp = (a, b)
	if not 'a' in temp:
		return 'a'
	elif not 'b' in temp:
		return 'b'
	elif not 'c' in temp:
		return 'c'
n = int(input())
a = input()
b = input()
type0 = a[0] == a[1]
type1 = b[0] == b[1]
print('YES')
if a == b and type0:
	print('abc' * n)
elif type0 == type1 and type0:
	c = a[0] + b[1]
	c *= n
	print(c + other(a[0], b[1]) * n)
elif type0 == type1 and (not type0):
	poss = ('abc', 'acb', 'bac', 'bca', 'cab', 'cba')
	for pos in poss:
		if not a in pos and (not b in pos):
			print(pos[0] * n + pos[1] * n + pos[2] * n)
			break
else:
	if type1:
		temp = b
		b = a
		a = temp
	if not a[0] in b:
		c = b[0] + a[0]
		c *= n
		print(c + other(a[0], b[0]) * n)
	elif a[0] == b[0]:
		c = a[0] + other(a[0], b[1])
		c *= n
		print(c + b[1] * n)
	else:
		c = a[0] + other(a[0], b[0])
		c *= n
		print(c + b[0] * n)


import math
n = int(input())
symbs = ['a', 'b', 'c']
x = input()
y = input()
cur_ans = []
if x[0] != x[1] and y[0] != y[1]:
	for a in range(0, 3):
		for b in range(0, 3):
			if a == b:
				continue
			c = 3 - a - b
			u = str()
			u += symbs[a]
			u += symbs[b]
			u += symbs[c]
			ok = True
			for t in range(0, 2):
				if u[t] == x[0] and u[t + 1] == x[1]:
					ok = False
				if u[t] == y[0] and u[t + 1] == y[1]:
					ok = False
			if ok:
				for i in range(0, n):
					cur_ans.append(symbs[a])
				for i in range(0, n):
					cur_ans.append(symbs[b])
				for i in range(0, n):
					cur_ans.append(symbs[c])
				print('YES')
				print(''.join((x for x in cur_ans)))
				exit(0)
for i in range(0, n):
	for a in range(0, 3):
		if len(cur_ans) > 3 * i:
			break
		for b in range(0, 3):
			if len(cur_ans) > 3 * i:
				break
			if a == b:
				continue
			c = 3 - a - b
			u = str()
			u += symbs[a]
			u += symbs[b]
			u += symbs[c]
			ok = True
			for t in range(0, 2):
				if u[t] == x[0] and u[t + 1] == x[1]:
					ok = False
				if u[t] == y[0] and u[t + 1] == y[1]:
					ok = False
				if i > 0 and cur_ans[-1] == x[0] and (u[0] == x[1]):
					ok = False
				if i > 0 and cur_ans[-1] == y[0] and (u[0] == y[1]):
					ok = False
			if ok:
				for c in u:
					cur_ans.append(c)
				break
print('YES')
print(''.join((x for x in cur_ans)))


n = int(input())
s = input()
t = input()
f = ['abc', 'acb', 'bca', 'bac', 'cab', 'cba']
for i in f:
	if s not in 2 * i and t not in 2 * i:
		print('YES')
		print(i * n)
		exit()
	elif s not in i[0] * 2 + i[1] * 2 + i[2] * 2 and t not in i[0] * 2 + i[1] * 2 + i[2] * 2:
		print('YES')
		print(i[0] * n + i[1] * n + i[2] * n)
		exit()
print('NO')


n = int(input())
s = input()
t = input()
list = [['a', 'b', 'c'] for i in range(3)]
if s != t:
	if s[0] == 'a':
		list[0].remove(s[1])
	elif s[0] == 'b':
		list[1].remove(s[1])
	else:
		list[2].remove(s[1])
	if t[0] == 'a':
		if t[1] in list[0]:
			list[0].remove(t[1])
	elif t[0] == 'b':
		if t[1] in list[1]:
			list[1].remove(t[1])
	elif t[1] in list[2]:
		list[2].remove(t[1])
	print('YES')
	if list[0] == ['a']:
		print('bc' * n + 'a' * n)
	elif list[1] == ['b']:
		print('ac' * n + 'b' * n)
	elif list[2] == ['c']:
		print('ab' * n + 'c' * n)
	elif list[0] == ['b']:
		print('abc' * n)
	elif list[0] == ['c']:
		print('acb' * n)
	elif list[1] == ['a']:
		print('bac' * n)
	elif list[1] == ['c']:
		print('bca' * n)
	elif list[2] == ['a']:
		print('cab' * n)
	elif list[2] == ['b']:
		print('cba' * n)
	elif len(list[0]) == 3:
		if 'a' not in list[1] and 'a' not in list[2]:
			print('a' * n + 'bc' * n)
		elif 'a' not in list[1] and 'b' not in list[2]:
			print('abc' * n)
		elif 'a' not in list[1] and 'c' not in list[2]:
			print('abc' * n)
		elif 'b' not in list[1] and 'a' not in list[2]:
			print('acb' * n)
		elif 'b' not in list[1] and 'b' not in list[2]:
			print('abc' * n)
		elif 'b' not in list[1] and 'c' not in list[2]:
			print('abc' * n)
		elif 'c' not in list[1] and 'a' not in list[2]:
			print('acb' * n)
		elif 'c' not in list[1] and 'b' not in list[2]:
			if n % 2 == 0:
				print('bbacca' * (n // 2))
			else:
				print('bbacca' * (n // 2) + 'bac')
		else:
			print('acb' * n)
	elif len(list[1]) == 3:
		if 'a' not in list[0] and 'a' not in list[2]:
			print('bac' * n)
		elif 'a' not in list[0] and 'b' not in list[2]:
			print('abc' * n)
		elif 'a' not in list[0] and 'c' not in list[2]:
			print('abc' * n)
		elif 'b' not in list[0] and 'a' not in list[2]:
			print('acb' * n)
		elif 'b' not in list[0] and 'b' not in list[2]:
			print('b' * n + 'ac' * n)
		elif 'b' not in list[0] and 'c' not in list[2]:
			print('acb' * n)
		elif 'c' not in list[0] and 'a' not in list[2]:
			if n % 2 == 0:
				print('aabccb' * (n // 2))
			else:
				print('aabccb' * (n // 2) + 'abc')
		elif 'c' not in list[0] and 'b' not in list[2]:
			print('abc' * n)
		else:
			print('abc' * n)
	elif 'a' not in list[1] and 'a' not in list[0]:
		print('abc' * n)
	elif 'a' not in list[1] and 'b' not in list[0]:
		if n % 2 == 0:
			print('aacbbc' * (n // 2))
		else:
			print('aacbbc' * (n // 2) + 'acb')
	elif 'a' not in list[1] and 'c' not in list[0]:
		print('abc' * n)
	elif 'b' not in list[1] and 'a' not in list[0]:
		print('abc' * n)
	elif 'b' not in list[1] and 'b' not in list[0]:
		print('acb' * n)
	elif 'b' not in list[1] and 'c' not in list[0]:
		print('abc' * n)
	elif 'c' not in list[1] and 'a' not in list[0]:
		print('acb' * n)
	elif 'c' not in list[1] and 'b' not in list[0]:
		print('acb' * n)
	else:
		print('c' * n + 'ab' * n)
else:
	print('YES')
	if s == 'aa':
		print('abc' * n)
	elif s == 'ab':
		print('acb' * n)
	elif s == 'ac':
		print('abc' * n)
	elif s == 'ba':
		print('abc' * n)
	elif s == 'bb':
		print('abc' * n)
	elif s == 'bc':
		print('acb' * n)
	elif s == 'ca':
		print('acb' * n)
	elif s == 'cb':
		print('abc' * n)
	else:
		print('abc' * n)


from itertools import permutations
import sys
n = int(input())
s = input()
t = input()
for p in permutations('abc', 3):
	a = n * ''.join(p)
	b = ''.join((n * c for c in p))
	if s not in a and t not in a:
		print('YES')
		print(a)
		sys.exit()
	elif s not in b and t not in b:
		print('YES')
		print(b)
		sys.exit()
print('NO')


import itertools
items = 'abc'
n = int(input())
s = input()
t = input()
string = ''
for per in itertools.permutations(items, 3):
	string = ''.join(per)
	if s not in string and t not in string and (string[-1] + string[0] not in [s, t]):
		print('YES\n{}'.format(string * n))
		break
else:
	print('YES')
	if s[-1] == t[-1]:
		if 'a' not in s:
			print(s[-1] * n + s[0] * n + 'a' * n)
		elif 'b' not in s:
			print(s[-1] * n + s[0] * n + 'b' * n)
		else:
			print(s[-1] * n + s[0] * n + 'c' * n)
	elif 'a' not in s:
		print(s[-1] * n + 'a' * n + s[0] * n)
	elif 'b' not in s:
		print(s[-1] * n + 'b' * n + s[0] * n)
	else:
		print(s[-1] * n + 'c' * n + s[0] * n)


n = int(input())
s = input()
t = input()
l = list()
l.append('abc' * n)
l.append('bca' * n)
l.append('cab' * n)
l.append('cba' * n)
l.append('bac' * n)
l.append('acb' * n)
l.append('a' * n + 'b' * n + 'c' * n)
l.append('a' * n + 'c' * n + 'b' * n)
l.append('b' * n + 'a' * n + 'c' * n)
l.append('b' * n + 'c' * n + 'a' * n)
l.append('c' * n + 'a' * n + 'b' * n)
l.append('c' * n + 'b' * n + 'a' * n)
found = False
for item in l:
	if s not in item and t not in item:
		print('YES\n' + item)
		found = True
		break
if not found:
	print('NO')


n = int(input())
a = input()
b = input()
arr = list()
arr.append('abc' * n)
arr.append('acb' * n)
arr.append('a' * n + 'b' * n + 'c' * n)
arr.append('a' * n + 'c' * n + 'b' * n)
arr.append('b' * n + 'a' * n + 'c' * n)
arr.append('b' * n + 'c' * n + 'a' * n)
arr.append('c' * n + 'a' * n + 'b' * n)
arr.append('c' * n + 'b' * n + 'a' * n)
flag = False
for s in arr:
	if s.find(a) == -1 and s.find(b) == -1:
		print('YES')
		print(s)
		flag = True
		break
if not flag:
	print('NO')


n = int(input())
a = n
s1 = input()
s2 = input()
print('YES')

def solver(x, n, r):
	s1 = ''
	s2 = ''
	for i in range(n):
		s1 += x
		s2 += r[0]
		s2 += r[1]
	print(s1 + s2, end='')
	exit(0)

def rolver(x, s1, s2, n):
	if x == 'a':
		r = 'bc'
	if x == 'b':
		r = 'ca'
	if x == 'c':
		r = 'ab'
	if r == s1 or r == s2:
		r = r[::-1]
	x1 = ''
	g1 = ''
	for i in range(n):
		x1 += x
		g1 += r
	if str(r[1] + x) != s1 and str(r[1] + x) != s2:
		print(g1 + x1)
		exit(0)
	print(x1 + g1)
	exit(0)
g1 = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
if s1[0] != s1[1] and s2[0] != s2[1]:
	for i in range(6):
		t = g1[i]
		if s1 not in t and s2 not in t:
			for x in range(3):
				for j in range(n):
					print(g1[i][x], end='')
			exit(0)
for i in range(6):
	t = g1[i] + g1[i]
	if s1 not in t and s2 not in t:
		for j in range(n):
			print(g1[i], end='')
		exit(0)


n = int(input())
s = input()
t = input()
let = {'a', 'b', 'c'}
if s[0] == s[1]:
	if t[0] == t[1]:
		print('YES')
		print('abc' * n)
	else:
		other = list(let - set(t))[0]
		print('YES')
		print((t[1] + t[0] + other) * n)
elif t[0] == t[1]:
	other = list(let - set(s))[0]
	print('YES')
	print((s[1] + s[0] + other) * n)
elif s[0] == t[0]:
	other = list(let - set(s))[0]
	print('YES')
	print(s[1] * n + other * n + s[0] * n)
elif s[1] == t[1]:
	other = list(let - set(s))[0]
	print('YES')
	print(s[1] * n + other * n + s[0] * n)
elif s == t[::-1]:
	if n == 1:
		other = list(let - set(s))[0]
		print('YES')
		print(s[0] + other + s[1])
	else:
		print('YES')
		other = list(let - set(s))[0]
		s1 = s[0] + other + s[1]
		s2 = s[1] + other + s[0]
		print((s1 + s2) * (n // 2) + s1 * (n % 2))
else:
	s2 = s[1] + s[0]
	other = list(let - set(s))[0]
	if other + s2[0] != t:
		print('YES')
		print((other + s2) * n)
	else:
		print('YES')
		print((s2 + other) * n)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
n = ri(1)
s = input()
t = input()
a = 'abc'
for i in pp(a):
	new = ''.join(i)
	one = new * n
	two = new[0] * n + new[1] * n + new[2] * n
	if s not in one and t not in one:
		print('YES')
		print(one)
		sys.exit(0)
	if s not in two and t not in two:
		print('YES')
		print(two)
		sys.exit(0)
print('NO')


n = int(input())
s = input()
t = input()
characters = ['a', 'b', 'c']
print('YES')
if s[0] == s[1] and t[0] == t[1]:
	x = 'abc'
	print(x * n)
elif s[0] == s[1]:
	if 'a' not in t:
		x = t[0] + 'a' + t[1]
	elif 'b' not in t:
		x = t[0] + 'b' + t[1]
	else:
		x = t[0] + 'c' + t[1]
	print(x * n)
elif t[0] == t[1]:
	if 'a' not in s:
		x = s[0] + 'a' + s[1]
	elif 'b' not in s:
		x = s[0] + 'b' + s[1]
	else:
		x = s[0] + 'c' + s[1]
	print(x * n)
elif s[1] == t[1] or s[0] == t[0]:
	if s[1] == t[1]:
		characters.remove(s[1])
		print(s[1] * n + ''.join(characters) * n)
	else:
		characters.remove(s[0])
		print(''.join(characters) * n + s[0] * n)
elif s[0] == t[1] and s[1] == t[0]:
	characters.remove(s[0])
	characters.remove(s[1])
	print(s[0] * n + characters[0] * n + s[1] * n)
else:
	if 'a' not in s:
		x = s[0] + 'a' + s[1]
	elif 'b' not in s:
		x = s[0] + 'b' + s[1]
	else:
		x = s[0] + 'c' + s[1]
	print(x * n)


from itertools import permutations
n = int(input())
s = input()
t = input()
print('YES')
if s[0] == s[1] and t[0] == t[1]:
	print(('a' + 'b' + 'c') * n)
elif s[0] == s[1] or t[0] == t[1]:
	if s[0] == s[1]:
		(s, t) = (t, s)
	print((s[1] + s[0] + (set(('a', 'b', 'c')) - set((s[0], s[1]))).pop()) * n)
else:
	q = 'abc'
	for i in permutations([0, 1, 2]):
		string = q[i[0]] + q[i[1]] + q[i[2]]
		if not s in string and (not t in string):
			print(q[i[0]] * n + q[i[1]] * n + q[i[2]] * n)
			break


import sys
from itertools import permutations as prm, product
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = 1
uu = t
mini = 10 ** 18
while t > 0:
	t -= 1
	n = fi()
	b = ['a', 'b', 'c']
	p = prm(b)
	aa = []
	for a in p:
		s = a[0] * n + a[1] * n + a[2] * n
		aa.append(s)
		s = (a[0] + a[1]) * n + a[2] * n
		aa.append(s)
	p = ii()
	q = ii()
	for s in aa:
		flag = 0
		for j in range(len(s) - 1):
			if s[j:j + 2] in [p, q]:
				flag = 1
				break
		if flag == 0:
			print('YES')
			print(s)
			exit(0)
	print('NO')


from sys import stdin
inp = stdin.readline
n = int(inp().strip())
(s, t) = (inp().strip(), inp().strip())
abc = ['a', 'b', 'c']
for i in abc:
	for j in abc:
		if i != j:
			for k in abc:
				if i != j and j != k and (i != k):
					ans = ''.join([i, j, k])
					ans = ans * n
					if s not in ans and t not in ans:
						print('YES')
						print(ans)
						exit()
					ans2 = ''.join([i] * n + [j] * n + [k] * n)
					if s not in ans2 and t not in ans2:
						print('YES')
						print(ans2)
						exit()
print('NO')
exit()


n = int(input())
s = input()
t = input()
perms = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
ans = []
for cycle in perms:
	ans.append(n * cycle)
	ans.append(n * cycle[0] + n * cycle[1] + n * cycle[2])
for a in ans:
	for i in range(3 * n - 1):
		if a[i:i + 2] == s or a[i:i + 2] == t:
			break
	else:
		print('YES')
		print(a)
		break


def solve(N, S, T):

	def check(cand):
		return S not in cand and T not in cand
	if check('abcabc'):
		return 'abc' * N
	if check('cbacba'):
		return 'cba' * N
	if check('bbccaa'):
		return 'b' * N + 'c' * N + 'a' * N
	if check('ccaabb'):
		return 'c' * N + 'a' * N + 'b' * N
	if check('aabbcc'):
		return 'a' * N + 'b' * N + 'c' * N
n = int(input())
a = input()
b = input()
print('YES')
print(solve(n, a, b))


import sys
in_file = sys.stdin
n = int(in_file.readline().strip())
s = list(map(lambda x: ord(x) - ord('a'), in_file.readline().strip()))
t = list(map(lambda x: ord(x) - ord('a'), in_file.readline().strip()))
A = [set([i for i in range(3)]) for j in range(3)]
A[s[0]].remove(s[1])
if s != t:
	A[t[0]].remove(t[1])
if 1 in A[0] and 2 in A[1] and (0 in A[2]):
	sys.stdout.write('YES\n' + 'abc' * n)
elif 2 in A[0] and 0 in A[1] and (1 in A[2]):
	sys.stdout.write('YES\n' + 'acb' * n)
else:
	s.reverse()
	if s != t:
		L = list(zip(map(len, A), [0, 1, 2]))
		L.sort()
		L.reverse()
		sys.stdout.write('YES\n')
		for (x, y) in L:
			sys.stdout.write(chr(ord('a') + y) * n)
	else:
		L = list(zip(map(len, A), [0, 1, 2]))
		L.sort()
		L = L[1:] + L[:1]
		sys.stdout.write('YES\n')
		for (x, y) in L:
			sys.stdout.write(chr(ord('a') + y) * n)
sys.stdout.flush()


n = int(input())
s = input()
t = input()
print('YES')
if s[0] != s[1] and t[0] != t[1]:
	x = ['abc', 'bca', 'cab', 'cba', 'acb', 'bac']
	k = ''
	for z in x:
		if not s in z and (not t in z):
			k = z
	print(k[0] * n + k[1] * n + k[2] * n)
else:
	x = ['abca', 'cbac']
	for z in x:
		if not s in z and (not t in z):
			k = z
	print(k[:3] * n)


n = int(input())
s = input().strip()
t = input().strip()
if s[0] == s[1] and t[0] == t[1]:
	type = 1
elif s[0] == s[1] and t[0] != t[1] or (s[0] != s[1] and t[0] == t[1]):
	type = 2
elif s[0] != s[1] and t[0] != t[1]:
	type = 3
print('YES')
if type == 1:
	print('abc' * n)
elif type == 2:
	if s[0] != s[1]:
		(s, t) = (t, s)
	w = {'a', 'b', 'c'}
	c = list(w - set(t) - set(s))
	if len(c) == 1:
		c1 = list(set(t) - set(s))[0]
		ans = (s[0] + c[0]) * n + c1 * n
	else:
		ans = t[1] * n + (t[0] + s[0]) * n
	print(ans)
else:
	w = {'a', 'b', 'c'}
	c = list(w - set(s) - set(t))
	if len(c) == 1:
		print(s[0] * n + c[0] * n + s[1] * n)
	else:
		c = list(set(s) & set(t))[0]
		if s[1] == c and t[1] == c:
			print(c * n + s[0] * n + t[0] * n)
		elif s[0] == c and t[0] == c:
			print(s[1] * n + t[1] * n + c * n)
		else:
			if s[1] == c:
				(s, t) = (t, s)
			print(s[1] * n + c * n + t[0] * n)


n = int(input())
s = input()
t = input()
a = []
from itertools import permutations
permList = permutations('abc')
for perm in list(permList):
	a.append(''.join(perm) * n)
	a.append(perm[0] * n + perm[1] * n + perm[2] * n)
for i in a:
	if s not in i and t not in i:
		print('YES')
		print(i)
		exit()
print('NO')


N = int(input())
s = input()
t = input()
abc2 = 'abcabc'
cba2 = 'cbacba'

def chk(s, t, S):
	if s in S:
		return 0
	if t in S:
		return 0
	return 1

def gen(abc, k):
	return abc[0] * k + abc[1] * k + abc[2] * k

def solve(s, t, N):
	for i in range(3):
		abc = abc2[i:i + 3]
		if chk(s, t, abc * 2):
			return abc * N
		if chk(s, t, gen(abc, 2)):
			return gen(abc, N)
	for i in range(3):
		cba = cba2[i:i + 3]
		if chk(s, t, cba * 2):
			return cba * N
		if chk(s, t, gen(cba, 2)):
			return gen(cba, N)
	return None
res = solve(s, t, N)
if res is None:
	print('NO')
else:
	print('YES')
	print(res)


n = int(input())
s = input()
t = input()
std = [s, t]
print('YES')
st = set('abc')
fin = set('abc')
st.discard(s[0])
st.discard(t[0])
fin.discard(s[1])
fin.discard(t[1])
z = st.pop()
y = fin.pop()
if z == y:
	if st:
		z = st.pop()
	elif fin:
		y = fin.pop()
	else:
		h = set('abc') - {y}
		(a, b) = (h.pop(), h.pop())
		if a + b not in std:
			print(y * n + (a + b) * n)
		else:
			print(a * n + y * n + b * n)
		exit(0)
g = (set('abc') - {y, z}).pop()
if g + z not in std:
	print((g + z) * n + y * n)
elif g + g not in std:
	print(z * n + g * n + y * n)
else:
	print((g + y) * n + z * n)


def bf(candidate, record, all_record, depth):
	if depth == 3:
		all_record.append(''.join(record + [record[0]]))
	else:
		for i in range(len(candidate)):
			if candidate[i]:
				record.append(chr(ord('a') + i))
				candidate[i] = False
				bf(candidate, record, all_record, depth + 1)
				candidate[i] = True
				record.pop()
all_record = []
bf([True, True, True], [], all_record, 0)
n = int(input())
first = input().strip()
second = input().strip()
print('YES')
has_ans = False
for cand in all_record:
	if first not in cand and second not in cand:
		print(cand[:3] * n)
		has_ans = True
		break
if not has_ans:
	if first[0] == second[0]:
		print(first[1] * n + second[1] * n + first[0] * n)
	elif first[1] == second[1]:
		print(first[1] * n + second[0] * n + first[0] * n)
	else:
		for c in 'abc':
			if c not in first:
				break
		print(first[0] * n + c * n + first[1] * n)


n = int(input())
(s1, s2) = (input(), input())
print('YES')
if s1[0] != s1[1] and s1 == s2[::-1]:
	print(s1[0] * n + ({'a', 'b', 'c'} - set(s1)).pop() * n + s1[1] * n)
	exit()
if s1[0] != s1[1] and s2[0] != s2[1]:
	if s1[1] == s2[0]:
		print(s2[1] * n + s2[0] * n + ({'a', 'b', 'c'} - set(s2)).pop() * n)
	elif s1[0] == s2[1]:
		print(s1[1] * n + s1[0] * n + ({'a', 'b', 'c'} - set(s1)).pop() * n)
	elif s1[0] == s2[0]:
		print(s1[1] * n + ({'a', 'b', 'c'} - set(s1)).pop() * n + s1[0] * n)
	else:
		print(s1[1] * n + s1[0] * n + ({'a', 'b', 'c'} - set(s1)).pop() * n)
	exit()
if s1[0] == s1[1] and s2[0] == s2[1]:
	print('abc' * n)
	exit()
if s1[0] == s1[1]:
	s = s2[::-1]
else:
	s = s1[::-1]
s += ({'a', 'b', 'c'} - set(s)).pop()
print(s * n)


n = int(input())
(f1, f2) = (input(), input())
variants = {'abc', 'acb', 'bac', 'bca', 'cab', 'cba'}
for variant in variants:
	if f1 not in variant and f2 not in variant:
		res = ''
		if f1[0] == f1[1] and f2[0] == f2[1]:
			res = (variant[0] + variant[1] + variant[2]) * n
		elif f1[0] == f1[1] or f2[0] == f2[1]:
			res = (variant[0] + variant[1] + variant[2]) * n
		else:
			res = variant[0] * n + variant[1] * n + variant[2] * n
		if f1 not in res and f2 not in res:
			print('YES')
			print(res)
			exit()
print('NO')


import sys

def main():
	n = int(sys.stdin.readline().strip())
	s1 = sys.stdin.readline().strip()
	s2 = sys.stdin.readline().strip()
	for c1 in 'abc':
		for c2 in 'abc':
			for c3 in 'abc':
				if len(set(c1 + c2 + c3)) != 3:
					continue
				ss = (c1 + c2 + c3) * n
				if s1 in ss or s2 in ss:
					continue
				print('YES')
				print(ss)
				return
	for c1 in 'abc':
		for c2 in 'abc':
			for c3 in 'abc':
				if len(set(c1 + c2 + c3)) != 3:
					continue
				ss = c1 * n + c2 * n + c3 * n
				if s1 in ss or s2 in ss:
					continue
				print('YES')
				print(ss)
				return
	print('NO')
main()


from sys import stdin, stdout, setrecursionlimit
input = stdin.readline
inf = float('inf')
from functools import cmp_to_key
from collections import defaultdict as dd
from collections import Counter, deque
from heapq import *
import math
from math import floor, ceil, sqrt

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

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

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

def getls():
	return list(map(str, input().strip().split()))

def gets():
	return input().strip()

def geta():
	return int(input())

def print_s(s):
	stdout.write(s + '\n')
from itertools import permutations as perm

def solve():
	n = geta()
	s = gets()
	t = gets()
	if len(set(s)) == 1 or len(set(t)) == 1:
		if len(set(t)) == len(set(s)):
			ans = 'abc' * n
			print('YES')
			print(ans)
			return
		if len(set(s)) != 1:
			(s, t) = (t, s)
		if t[0] != s[0] and len(set(t)) != 1:
			if t[1] != s[0]:
				ans = (t[0] + s[0]) * n
				ans += t[1] * n
			else:
				for i in 'abc':
					if i not in t:
						char = i
						break
				ans = (s[0] + char) * n
				ans += t[0] * n
			print('YES')
			print(ans)
			return
		if s[0] == t[0] and len(set(t)) != 1:
			for i in 'abc':
				if i not in t:
					char = i
					break
			ans = (s[0] + char) * n
			ans += t[1] * n
			print('YES')
			print(ans)
			return
	for now in perm('abc'):
		i = ''.join(now)
		if not s in i and (not t in i):
			print('YES')
			ans = i[0] * n + i[1] * n + i[2] * n
			print(ans)
			return
	print('NO')
solve()


n = int(input())
s = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cba' * n, 'cab' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'a' * n + 'b' * n + 'c' * n]
s1 = input().strip()
s2 = input().strip()
print('YES')
for x in s:
	if s1 not in x and s2 not in x:
		print(x)
		exit(0)


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

def res1(x):
	print('YES')
	print(x * n)

def res2(x):
	print('YES')
	print(x[0] * n + x[1] * n + x[2] * n)

def add(x):
	al = 'abc'
	return x + al[3 - al.index(x[0]) - al.index(x[1])]
if s[0] == s[1] and t[0] == t[1]:
	res1('abc')
elif s[0] == s[1]:
	res1(add(t[1] + t[0]))
elif t[0] == t[1]:
	res1(add(s[1] + s[0]))
else:
	for v in ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']:
		if s not in v and t not in v:
			res2(v)
			break


n = int(input())
s = input()
t = input()
if n >= 2:
	l = ['abcabc', 'acbacb', 'bacbac', 'bcabca', 'cabcab', 'cbacba', 'aabbcc', 'bbccaa', 'ccaabb', 'aaccbb', 'bbaacc', 'ccbbaa']
	for i in l:
		string = ''
		if s in i or t in i:
			continue
		else:
			string = i
			break
	if string == '':
		print('NO')
	elif string not in ['aabbcc', 'bbccaa', 'ccaabb', 'aaccbb', 'bbaacc', 'ccbbaa']:
		temp = string[0:3]
		print('YES')
		print(temp * n)
	else:
		first = string[0]
		second = string[2]
		third = string[4]
		print('YES')
		print(first * n + second * n + third * n)
else:
	l = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
	for i in l:
		string = ''
		if s in i or t in i:
			continue
		else:
			string = i
			break
	if string == '':
		print('NO')
	else:
		print('YES')
		print(string)


n = int(input())
s = [input(), input()]
for i in range(3):
	for j in range(3):
		for k in range(3):
			if i == j or i == k or j == k:
				continue
			c = [chr(97 + i), chr(97 + j), chr(97 + k)]
			tmp = [c[0] + c[1], c[1] + c[0], c[1] + c[2], c[2] + c[2]]
			if not (s[0] in tmp or s[1] in tmp):
				print('YES')
				print(tmp[0] * n + c[2] * n)
				exit(0)
			tmp = [c[0] + c[0], c[0] + c[1], c[1] + c[2], c[2] + c[1]]
			if not (s[0] in tmp or s[1] in tmp):
				print('YES')
				print(c[0] * n + tmp[2] * n)
				exit(0)
print('NO')


def good(s, t, r):
	for i in range(len(s) - 1):
		pa = s[i:i + 2]
		if pa == t or pa == r:
			return False
	return True
n = int(input())
s = input()
t = input()
l = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cab' * n, 'cba' * n]
l.append('a' * n + 'b' * n + 'c' * n)
l.append('a' * n + 'c' * n + 'b' * n)
l.append('b' * n + 'a' * n + 'c' * n)
l.append('b' * n + 'c' * n + 'a' * n)
l.append('c' * n + 'a' * n + 'b' * n)
l.append('c' * n + 'b' * n + 'a' * n)
print('YES')
for x in l:
	if good(x, s, t):
		print(x)
		exit()


for _ in range(1):
	n = int(input())
	s = input()
	t = input()
	s = list(s)
	t = list(t)
	if len(s) == len(set(s)) and len(t) == len(set(t)):
		lol = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
		flag = -1
		i = 0
		while i < 6:
			if lol[i][0] == s[0] and lol[i][1] == s[1] or (lol[i][0] == t[0] and lol[i][1] == t[1]):
				i += 1
			elif lol[i][1] == s[0] and lol[i][2] == s[1] or (lol[i][1] == t[0] and lol[i][2] == t[1]):
				i += 1
			else:
				flag = i
				break
		if flag == -1:
			print('NO')
		else:
			print('YES')
			print(lol[flag][0] * n + lol[flag][1] * n + lol[flag][2] * n)
	else:
		st = 'abc' * n
		st = list(st)
		while True:
			for i in range(3 * n - 1):
				if st[i] == s[0] and st[i + 1] == s[1] or (st[i] == t[0] and st[i + 1] == t[1]):
					(st[i], st[i + 1]) = (st[i + 1], st[i])
			flag = 0
			for i in range(3 * n - 1):
				if st[i] == s[0] and st[i + 1] == s[1] or (st[i] == t[0] and st[i + 1] == t[1]):
					flag = 1
			if flag == 0:
				break
		if flag == 0:
			print('YES')
			print(''.join(st))
		else:
			print('NO')


n = int(input())
s = input()
t = input()
print('YES')
a = ['abc' * n, 'acb' * n, 'bac' * n, 'bca' * n, 'cba' * n, 'cab' * n]
a = a + ['b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'a' * n + 'b' * n + 'c' * n]
for i in range(len(a)):
	if s not in a[i] and t not in a[i]:
		print(a[i])
		break


Same = ['aa', 'bb', 'cc']
Diff = ['ab', 'ac', 'ba', 'bc', 'ca', 'cb']
n = int(input())
s = input()
t = input()
print('Yes')
if s in Same and t in Same:
	print('abc' * n)
elif s in Diff and t in Diff:
	(s, t) = sorted([s, t])
	if s == t:
		for i in ['a', 'b', 'c']:
			if i in s:
				continue
			else:
				Missing = i
				break
		print(s[0] * n + Missing * n + t[1] * n)
	elif s[0] == t[0]:
		print(s[1] * n + t[1] * n + s[0] * n)
	elif s[1] == t[1]:
		print(s[1] * n + s[0] * n + t[0] * n)
	elif s == t[::-1]:
		for i in ['a', 'b', 'c']:
			if i in s:
				continue
			else:
				Missing = i
				break
		print(s[0] * n + Missing * n + s[1] * n)
	elif s[1] == t[0]:
		print(t[1] * n + s[1] * n + s[0] * n)
	elif s[0] == t[1]:
		print(s[1] * n + s[0] * n + t[0] * n)
else:
	if len(set(s)) == 1:
		Repeated = s
		Nonrepeat = t
	else:
		Repeated = t
		Nonrepeat = s
	if Repeated[0] in Nonrepeat:
		for i in ['a', 'b', 'c']:
			if i in Nonrepeat:
				continue
			else:
				Missing = i
				break
		for i in ['a', 'b', 'c']:
			if i == Repeated[0] or i == Missing:
				continue
			else:
				bachGaya = i
				break
		print((Repeated[0] + Missing) * n + bachGaya * n)
	else:
		print((Repeated[0] + Nonrepeat[::-1]) * n)


import math
import sys
from collections import defaultdict
rt = lambda : map(int, input().split())
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))

def main():
	n = ri()
	s = input()
	t = input()
	trios = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
	if n == 1:
		found = None
		for trio in trios:
			if s not in trio and t not in trio:
				found = trio
				break
		if found:
			print('YES')
			print(found)
		else:
			print('NO')
	else:
		found = None
		for t1 in trios:
			x = t1 + t1
			if s not in x and t not in x:
				found = t1
				break
		if found:
			print('YES')
			print(found * n)
		else:
			rem = {'a': 'bc', 'b': 'ac', 'c': 'ab'}
			if s[0] == t[0]:
				print('YES')
				f = s[0]
				print(f'{rem[f][0] * n}{rem[f][1] * n}{f * n}')
			elif s[1] == t[1]:
				print('YES')
				last = s[1]
				print(f'{last * n}{rem[last][0] * n}{rem[last][1] * n}')
			elif s[0] == t[1] and s[1] == t[0]:
				x1 = s[0]
				x2 = s[1]
				if x1 != 'a' and x2 != 'a':
					x3 = 'a'
				if x1 != 'b' and x2 != 'b':
					x3 = 'b'
				if x1 != 'c' and x2 != 'c':
					x3 = 'c'
				print('YES')
				print(f'{x1 * n}{x3 * n}{x2 * n}')
			else:
				print('NO')
main()


n = int(input())
a = input()
b = input()
strings = []

def add1(n):
	l = []
	for i in range(2 * n):
		l.append('a' if i % 2 == 0 else 'b')
	for i in range(n):
		l.append('c')
	strings.append(''.join(l))

def add2(n):
	l = []
	for i in range(2 * n):
		l.append('a' if i % 2 == 0 else 'c')
	for i in range(n):
		l.append('b')
	strings.append(''.join(l))

def add3(n):
	l = []
	for i in range(n):
		l.append('c')
	for i in range(n):
		l.append('b')
	for i in range(n):
		l.append('a')
	strings.append(''.join(l))
	l = []
	for i in range(n):
		l.append('b')
	for i in range(n):
		l.append('c')
	for i in range(n):
		l.append('a')
	strings.append(''.join(l))
	l = []
	for i in range(n):
		l.append('a')
	for i in range(n):
		l.append('b')
	for i in range(n):
		l.append('c')
	strings.append(''.join(l))
	l = []
	for i in range(n):
		l.append('c')
	for i in range(n):
		l.append('a')
	for i in range(n):
		l.append('b')
	strings.append(''.join(l))

def add4(n):
	l = []
	for i in range(n):
		l.append('abc')
	strings.append(''.join(l))
	l = []
	for i in range(n):
		l.append('bac')
	strings.append(''.join(l))
	l = []
	for i in range(n):
		l.append('bca')
	strings.append(''.join(l))

def solve(n, a, b):
	for x in strings:
		ok = True
		for i in range(3 * n - 1):
			if x[i] == a[0] and x[i + 1] == a[1]:
				ok = False
			if x[i] == b[0] and x[i + 1] == b[1]:
				ok = False
		if ok:
			return x
	return None
add1(n)
add2(n)
add3(n)
add4(n)
print('YES')
print(solve(n, a, b))


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
n = int(input())
s = input()
t = input()
ch = 1
a = [s, t]
r = []
if 'aa' in a and 'bb' in a or ('aa' in a and 'cc' in a) or ('cc' in a and 'bb' in a):
	print('YES')
	print('abc' * n)
elif 'aa' not in a and 'bb' not in a and ('cc' not in a):
	print('YES')
	if 'ab' in a and 'bc' in a:
		print('a' * n + 'c' * n + 'b' * n)
	elif 'ab' in a:
		if 'ca' not in a:
			print('b' * n + 'c' * n + 'a' * n)
		else:
			print('a' * n + 'c' * n + 'b' * n)
	elif 'bc' in a:
		if 'ca' not in a:
			print('c' * n + 'a' * n + 'b' * n)
		else:
			print('b' * n + 'a' * n + 'c' * n)
	else:
		print('a' * n + 'b' * n + 'c' * n)
elif 'ab' in a or 'bc' in a or 'ca' in a:
	print('YES')
	print('acb' * n)
else:
	print('YES')
	print('abc' * n)


from itertools import permutations
n = int(input())
fir = input()
sec = input()
ans = ''
woo = ['a', 'b', 'c']
check = False
if fir[0] == fir[1] or sec[0] == sec[1]:
	check = True
for _ in range(1):
	if fir[0] == sec[0] and check == False:
		part = woo.index(fir[0])
		ans = woo[part - 2] * n + woo[part - 1] * n + woo[part] * n
		continue
	if fir[1] == sec[1] and check == False:
		part = woo.index(fir[1])
		ans = woo[part] * n + woo[part - 1] * n + woo[part - 2] * n
		continue
	if fir[0] == sec[1] and check == False:
		it = fir[0]
		that = fir[1]
		heh = ''.join([x for x in woo if x != it and x != that])
		ans = it * n + heh * n + that * n
		continue
	if sec[0] == fir[1] and check == False:
		it = sec[0]
		that = sec[1]
		heh = ''.join([x for x in woo if x != it and x != that])
		ans = it * n + heh * n + that * n
		continue
	for item in list(permutations(woo)):
		item = ''.join(item) * 2
		if fir not in item and sec not in item:
			hm = int(len(item) / 2)
			ans = item[:hm] * n
			break
if ans == '':
	print('NO')
else:
	print('YES')
	print(ans)


from itertools import permutations
n = int(input())
s = input()
t = input()
p = permutations('abc')
v = []
for i in p:
	v.append(''.join((k for k in i)) * n)
	v.append(''.join((k * n for k in i)))
for word in v:
	if word.find(s) == -1 and word.find(t) == -1:
		print('YES')
		print(word)
		break
else:
	print('NO')


n = int(input())
m = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
s = input()
t = input()
r = [s, t]
string = ''
print('YES')
if s not in ['aa', 'bb', 'cc'] and t not in ['aa', 'bb', 'cc']:
	q = [['ab', 'ab'], ['ab', 'ac'], ['ab', 'ba'], ['ab', 'bc'], ['ab', 'cb'], ['ab', 'ca'], ['ba', 'ab'], ['ba', 'ac'], ['ba', 'ba'], ['ba', 'bc'], ['ba', 'cb'], ['ba', 'ca'], ['ac', 'ab'], ['ac', 'ac'], ['ac', 'ba'], ['ac', 'bc'], ['ac', 'cb'], ['ac', 'ca'], ['ca', 'ab'], ['ca', 'ac'], ['ca', 'ba'], ['ca', 'bc'], ['ca', 'cb'], ['ca', 'ca'], ['bc', 'ab'], ['bc', 'ac'], ['bc', 'ba'], ['bc', 'bc'], ['bc', 'cb'], ['bc', 'ca'], ['cb', 'ab'], ['cb', 'ac'], ['cb', 'ba'], ['cb', 'bc'], ['cb', 'cb'], ['cb', 'ca']]
	ans = ['1acb', '1cba', '1acb', '1acb', '1bac', '1cba', '1bca', '1bca', '1bca', '1cab', '1abc', '1acb', '1bca', '1bca', '1bca', '1cba', '1abc', '1cba', '1cba', '1cba', '1acb', '1acb', '1abc', '1abc', '1bac', '1cba', '1cab', '1cab', '1cab', '1acb', '1bac', '1bca', '1cab', '1bac', '1cab', '1abc']
	i = 0
	while q[i] != r:
		i += 1
	string = ans[i]
else:
	q = [['aa', 'ab'], ['aa', 'ac'], ['aa', 'ba'], ['aa', 'bc'], ['aa', 'cb'], ['aa', 'ca'], ['aa', 'aa'], ['aa', 'bb'], ['aa', 'cc'], ['bb', 'ab'], ['bb', 'ac'], ['bb', 'ba'], ['bb', 'bc'], ['bb', 'cb'], ['bb', 'ca'], ['bb', 'aa'], ['bb', 'bb'], ['bb', 'cc'], ['cc', 'ab'], ['cc', 'ac'], ['cc', 'ba'], ['cc', 'bc'], ['cc', 'cb'], ['cc', 'ca'], ['cc', 'aa'], ['cc', 'bb'], ['cc', 'cc']]
	if s not in ['aa', 'bb', 'cc']:
		r = r[::-1]
		(s, t) = (t, s)
	ans = ['0acb', '0abc', '0abc', '0acb', '0abc', '0acb', '0abc', '0abc', '0abc', '0bac', '0bca', '0bca', '0bac', '0abc', '0bac', '0bac', '0bac', '0bac', '0cba', '0cab', '0cab', '0cba', '0abc', '0cba', '0cba', '0cba', '0cba']
	i = 0
	while q[i] != r:
		i += 1
	string = ans[i]
if string[0] == '0':
	print(n * string[1:])
else:
	print(n * string[1] + n * string[2] + n * string[3])


n = int(input())
a = list(input())
b = list(input())
arr = []
if a[0] != a[1]:
	x = a[0]
	y = a[1]
	x1 = b[0]
	y1 = b[1]
elif b[0] != b[1]:
	x = b[0]
	y = b[1]
	x1 = a[0]
	y1 = a[1]
else:
	x = a[0]
	y = a[0]
	x1 = b[1]
	y1 = b[1]
if x1 == x:
	if y1 == x:
		for i in range(n):
			arr.append('x')
			arr.append('z')
			arr.append('y')
	else:
		for i in range(n):
			arr.append('z')
		for i in range(n):
			arr.append('y')
		for i in range(n):
			arr.append('x')
elif x1 == y:
	if y1 == x:
		for i in range(n):
			arr.append('y')
		for i in range(n):
			arr.append('z')
		for i in range(n):
			arr.append('x')
	else:
		for i in range(n):
			arr.append('x')
			arr.append('z')
			arr.append('y')
elif y1 == y:
	for i in range(n):
		arr.append('y')
	for i in range(n):
		arr.append('x')
	for i in range(n):
		arr.append('z')
else:
	for i in range(n):
		arr.append('x')
		arr.append('z')
		arr.append('y')
answer = ''
if x == 'a' and y == 'b' or (x == 'b' and y == 'a'):
	z = 'c'
elif x == 'a' and y == 'c' or (x == 'c' and y == 'a'):
	z = 'b'
elif x == y:
	x = 'a'
	y = 'b'
	z = 'c'
else:
	z = 'a'
for item in arr:
	if item == 'x':
		answer += x
	elif item == 'y':
		answer += y
	else:
		answer += z
print('YES')
print(answer)


def main():
	Lcheck = ['abca', 'acba', 'bacb', 'bcab', 'cabc', 'cbac']
	n = int(input())
	str1 = input()
	str2 = input()
	repeat = 0
	for i in Lcheck:
		if i.find(str1) == -1 and i.find(str2) == -1:
			repeat = i[0:3]
			break
	if repeat:
		print('YES')
		print(repeat * n)
	elif str1[0] == str2[0] and str1[1] != str2[1]:
		print('YES')
		print(str1[1] * n + str2[1] * n + str2[0] * n)
	elif str1[1] == str2[1] and str1[0] != str2[0]:
		print('YES')
		print(str1[1] * n + str1[0] * n + str2[0] * n)
	elif str1[0] == str2[1] and str1[1] == str2[0]:
		L = ['a', 'b', 'c']
		for i in range(3):
			if str1[0] == L[i] or str1[1] == L[i]:
				pass
			else:
				keep = L[i]
		print('YES')
		print(str1[0] * n + keep * n + str1[1] * n)
	else:
		print('NO')
main()


n = int(input())
s1 = input()
s2 = input()
flag = 0
l1 = []
l = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
for i in l:
	l1.append(i * n)
	l1.append(i[0] * n + i[1] * n + i[2] * n)
for i in l1:
	if s1 not in i and s2 not in i:
		print('YES')
		print(i)
		flag = 1
		break
if flag == 0:
	print('NO')


poss = ['abc', 'acb', 'bca', 'bac', 'cba', 'cab']
n = int(input())
w1 = input()
w2 = input()
ws = [w1, w2]
abc = {'a', 'b', 'c'}

def main():
	lb = -1
	if n == 1:
		lb = 0
	for pos in poss:
		bd = False
		for i in range(lb, 2):
			bad = pos[i] + pos[i + 1]
			if bad in ws:
				bd = True
				break
		if not bd:
			print('YES')
			print(pos * n)
			return 0
	print('NO')
	return 0
if w1[0] != w1[1] and w1[0] == w2[1] and (w1[1] == w2[0]):
	abc.remove(w1[0])
	abc.remove(w1[1])
	oth = abc.pop()
	print('YES')
	print((w1[0] * 2 + oth + w1[1] * 2 + oth) * (n // 2) + (w1[0] + oth + w1[1]) * (n % 2))
elif w1[0] == w2[0] and w1[0] != w1[1] and (w2[0] != w2[1]):
	abc.remove(w1[0])
	a = abc.pop()
	b = abc.pop()
	print('YES')
	print(a * n + b * n + w1[0] * n)
elif w1[1] == w2[1] and w1[0] != w1[1] and (w2[0] != w2[1]):
	abc.remove(w1[1])
	a = abc.pop()
	b = abc.pop()
	print('YES')
	print(w1[1] * n + a * n + b * n)
else:
	main()


n = int(input())
s = input()
t = input()
print('YES')
if s not in 'abca' and t not in 'abca':
	print('abc' * n)
elif s not in 'acba' and t not in 'acba':
	print('acb' * n)
else:
	lastChar = 'a'
	if 'b' not in s:
		lastChar = 'b'
	elif 'c' not in s:
		lastChar = 'c'
	answer = s[1] * n + lastChar * n + s[0] * n
	print(answer)


BASES = {'ab': 'acb', 'ac': 'abc', 'ba': 'abc', 'bc': 'acb', 'ca': 'acb', 'cb': 'abc'}

def main():
	n = int(input())
	s = input()
	t = input()
	print('YES')
	print(solve(n, s, t))

def solve(n, s, t):
	if s[0] == s[1]:
		if t[0] == t[1]:
			base = 'abc'
		else:
			base = BASES[t]
		return base * n
	else:
		base = BASES[s]
		if t[0] == t[1]:
			return base * n
		elif t[0] == s[0] and t[1] != s[1]:
			return s[1] * n + t[1] * n + s[0] * n
		elif t[1] == s[1] and t[0] != s[0]:
			return s[1] * n + s[0] * n + t[0] * n
		elif t[0] == s[1] and t[1] == s[0]:
			letters = ['a', 'b', 'c']
			letters.remove(s[0])
			letters.remove(s[1])
			base = s[0] + letters[0] + s[1]
			baser = s[1] + letters[0] + s[0]
			return (base + baser) * (n // 2) + base * (n % 2)
		else:
			return base * n
main()


def find(x, d):
	if d == 2:
		arr.append(x)
		return
	for c in g[x[-1]]:
		find(x + c, d + 1)
g = {'a': ['a', 'b', 'c'], 'b': ['a', 'b', 'c'], 'c': ['a', 'b', 'c']}
n = int(input())
(a, b) = (input(), input())
g[a[0]].remove(a[1])
if b != a:
	g[b[0]].remove(b[1])
arr = []
for c in g:
	find(c, 0)
choose = []
for s in arr:
	if s[0] != s[1] and s[1] != s[2] and (s[2] != s[0]):
		choose.append(s)
num = (a[0] == a[1]) + (b[0] == b[1])
ans = None
if num == 2:
	ans = ''.join([choose[0] for _ in range(n)])
elif num == 1:
	s1 = choose[0] + choose[0]
	if a in s1 or b in s1:
		choose = choose[1]
	else:
		choose = choose[0]
else:
	choose = choose[0]
	ans = ''.join([choose[0] for _ in range(n)]) + ''.join([choose[1] for _ in range(n)]) + ''.join([choose[2] for _ in range(n)])
if ans is None:
	ans = ''.join([choose for _ in range(n)])
print('YES')
print(ans)


n = int(input())
s = input()
t = input()
import sys
print('YES')
string = 'abc' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'acb' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'bac' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'bca' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'cab' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'cba' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'a' * n + 'b' * n + 'c' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'a' * n + 'c' * n + 'b' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'b' * n + 'a' * n + 'c' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'b' * n + 'c' * n + 'a' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'c' * n + 'b' * n + 'a' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)
string = 'c' * n + 'a' * n + 'b' * n
for i in range(3 * n - 1):
	if string[i:i + 2] == s:
		break
	if string[i:i + 2] == t:
		break
	if i == 3 * n - 2:
		print(string)
		sys.exit(0)


n = int(input())
(s, t) = (input(), input())
a = [{'aa', 'ac', 'ba', 'bb', 'cb', 'cc'}, {'aa', 'ab', 'bb', 'bc', 'ca', 'cc'}, {'ac', 'ba', 'ca', 'cb'}, {'ab', 'ba', 'bc', 'ca'}, {'ab', 'bc', 'ca', 'cb'}, {'ab', 'ac', 'ba', 'cb'}, {'ac', 'ba', 'bc', 'cb'}, {'ab', 'ac', 'bc', 'ca'}]
b = ['abc' * n, 'acb' * n, 'a' * n + 'b' * n + 'c' * n, 'a' * n + 'c' * n + 'b' * n, 'b' * n + 'a' * n + 'c' * n, 'b' * n + 'c' * n + 'a' * n, 'c' * n + 'a' * n + 'b' * n, 'c' * n + 'b' * n + 'a' * n]
print('YES')
for i in range(8):
	if s in a[i] and t in a[i]:
		print(b[i])
		break


n = int(input())
s = input()
t = input()
for i in 'abc':
	if i not in s and i not in t:
		l = i
if t[0] == t[1]:
	(s, t) = (t, s)
print('YES')
if s[0] == s[1]:
	if t[0] == t[1]:
		print('abc' * n)
	elif s[0] in t:
		x = t[0]
		if x in s:
			x = t[1]
		print((s[0] + l) * n + x * n)
	else:
		print((t[0] + s[0] + t[1]) * n)
elif s == t:
	print((s[0] + l + s[1]) * n)
elif s[-1::-1] == t:
	print((s[0] + l) * n + s[1] * n)
elif s[1] == t[0]:
	print((s[1] + s[0] + t[1]) * n)
elif t[1] == s[0]:
	print((t[0] + s[1] + t[1]) * n)
elif s[1] == t[1]:
	print(s[1] * n + s[0] * n + t[0] * n)
elif s[0] == t[0]:
	print(s[1] * n + t[1] * n + t[0] * n)


def missing_func(arr):
	for i in ['a', 'b', 'c']:
		if i not in arr:
			return i
n = int(input())
s = input()
t = input()
print('YES')
if s == t:
	if s[0] == s[1]:
		print(n * 'abc')
	else:
		print(n * (s[::-1] + missing_func(s)))
elif s[0] == t[0] and s[0] == s[1]:
	print(n * (t[::-1] + missing_func(t)))
elif s[0] == t[1] and s[0] == s[1]:
	print(n * (t[::-1] + missing_func(t)))
elif s[0] == s[1] and s[0] != t[0] and (s[0] != t[1]) and (t[0] != t[1]):
	print(n * (missing_func(t) + t[::-1]))
elif t[0] == s[0] and t[0] == t[1]:
	print(n * (s[::-1] + missing_func(s)))
elif t[0] == s[1] and t[0] == t[1]:
	print(n * (s[::-1] + missing_func(s)))
elif t[0] == t[1] and s[0] != t[0] and (t[0] != s[1]) and (s[0] != s[1]):
	print(n * (s[::-1] + missing_func(s)))
elif s[0] == s[1] and t[0] == t[1]:
	print(n * 'abc')
elif s == t[::-1]:
	print(n * s[0] + n * missing_func(s) + n * s[1])
elif s[1] == t[0] and s[0] != t[1]:
	print(n * (s[0] + t[1] + s[1]))
elif t[1] == s[0] and t[0] != s[1]:
	print(n * (t[0] + s[1] + t[1]))
elif s[0] == t[0] and s[0] != s[1] and (t[0] != t[1]):
	print(n * s[1] + n * t[1] + n * s[0])
elif s[1] == t[1] and s[0] != s[1] and (t[0] != t[1]):
	print(n * s[1] + n * s[0] + n * t[0])


a = ['aabbcc', 'aaccbb', 'bbaacc', 'bbccaa', 'ccaabb', 'ccbbaa']
b = ['abcabc', 'acbacb', 'bacbac', 'bcabca', 'cabcab', 'cbacba']
n = int(input())
s1 = input()
s2 = input()
if s1[0] == s1[1] or s2[0] == s2[1]:
	for i in b:
		if i.count(s1) == 0 and i.count(s2) == 0:
			print('YES')
			for j in range(n // 2):
				print(i, end='')
			if n % 2 == 1:
				print(i[0], end='')
				print(i[1], end='')
				print(i[2], end='')
			exit()
else:
	for i in a:
		if i.count(s1) == 0 and i.count(s2) == 0:
			print('YES')
			k = [0, 2, 4]
			for ii in k:
				for j in range(n):
					print(i[ii], end='')
			exit()
print('NO')