Nikolay got a string $s$ of even length $n$, which consists only of lowercase Latin letters 'a' and 'b'. Its positions are numbered from $1$ to $n$.

He wants to modify his string so that every its prefix of even length has an equal amount of letters 'a' and 'b'. To achieve that, Nikolay can perform the following operation arbitrary number of times (possibly, zero): choose some position in his string and replace the letter on this position with the other letter (i.e. replace 'a' with 'b' or replace 'b' with 'a'). Nikolay can use no letters except 'a' and 'b'.

The prefix of string $s$ of length $l$ ($1 \le l \le n$) is a string $s[1..l]$.

For example, for the string $s=$"abba" there are two prefixes of the even length. The first is $s[1\dots2]=$"ab" and the second $s[1\dots4]=$"abba". Both of them have the same number of 'a' and 'b'.

Your task is to calculate the minimum number of operations Nikolay has to perform with the string $s$ to modify it so that every its prefix of even length has an equal amount of letters 'a' and 'b'.


-----Input-----

The first line of the input contains one even integer $n$ $(2 \le n \le 2\cdot10^{5})$ — the length of string $s$.

The second line of the input contains the string $s$ of length $n$, which consists only of lowercase Latin letters 'a' and 'b'.


-----Output-----

In the first line print the minimum number of operations Nikolay has to perform with the string $s$ to modify it so that every its prefix of even length has an equal amount of letters 'a' and 'b'.

In the second line print the string Nikolay obtains after applying all the operations. If there are multiple answers, you can print any of them.


-----Examples-----
Input
4
bbbb

Output
2
abba

Input
6
ababab

Output
0
ababab

Input
2
aa

Output
1
ba



-----Note-----

In the first example Nikolay has to perform two operations. For example, he can replace the first 'b' with 'a' and the last 'b' with 'a'. 

In the second example Nikolay doesn't need to do anything because each prefix of an even length of the initial string already contains an equal amount of letters 'a' and 'b'.

Difficulty: EASY
Tags: String algorithms

Starter code:

Solutions:
n = input()
s = input()
r = 0
q = ''
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		r += 1
		q += 'ab'
	else:
		q += s[i]
		q += s[i + 1]
print(r)
print(q)


(n, s) = (int(input()), input())
(ans, i) = (0, 0)
t = list(s)
while i < n:
	if i + 1 == n:
		break
	if s[i] == s[i + 1]:
		ans += 1
		t[i] = 'a' if s[i] == 'b' else 'b'
	i += 2
print(ans)
print(''.join(t))


n = input()
s = input()
letters = list(s)
count = 0
for i in range(0, len(letters), 2):
	if letters[i] == letters[i + 1]:
		if letters[i] == 'a':
			letters[i] = 'b'
		elif letters[i] == 'b':
			letters[i] = 'a'
		count += 1
print(count)
print(''.join(letters))


n = int(input())
s = list(input())
count = 0
for i in range(0, len(s) - 1, 2):
	if s[i] == 'a' and s[i + 1] == 'b' or (s[i] == 'b' and s[i + 1] == 'a'):
		continue
	else:
		count += 1
		if s[i] == 'a':
			s[i + 1] = 'b'
		else:
			s[i + 1] = 'a'
print(count)
print(''.join(s))


input()
s = input()
ans = 0
t = ''
for (x, y) in zip(s[::2], s[1::2]):
	if x == y:
		ans += 1
	t += x + 'ab'[x < 'b']
print(ans)
print(t)


n = int(input())
s = input()
ans = 0
for i in range(1, n, 2):
	if s[i] == s[i - 1]:
		ans = ans + 1
print(ans)
for i in range(1, n, 2):
	print(s[i - 1], end='')
	if s[i - 1] == s[i]:
		if s[i] == 'a':
			print('b', end='')
		else:
			print('a', end='')
	else:
		print(s[i], end='')


n = int(input())
lis = list(input())
c = 0
for i in range(0, n, 2):
	if lis[i] + lis[i + 1] not in ('ab', 'ba'):
		c += 1
		lis[i] = 'a'
		lis[i + 1] = 'b'
print(c)
print(''.join(lis))


q = int(input())
z = 0
Q = list(input())
for i in range(q // 2):
	if Q[2 * i] == 'a' and Q[2 * i + 1] == 'a':
		Q[2 * i] = 'b'
		z += 1
	elif Q[2 * i] == 'b' and Q[2 * i + 1] == 'b':
		Q[2 * i] = 'a'
		z += 1
print(z)
for i in Q:
	print(i, end='')


n = int(input())
s = [c for c in input()]
conta = 0
contb = 0
t = 0
for i in range(n):
	if s[i] == 'a':
		conta += 1
	if s[i] == 'b':
		contb += 1
	if (i + 1) % 2 == 0:
		t += abs(conta - contb) // 2
		if conta > contb:
			s[i] = 'b'
			conta -= 1
			contb += 1
		if conta < contb:
			s[i] = 'a'
			conta += 1
			contb -= 1
print(t)
print(''.join(s))


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')
n = int(input())
s = input()
ans = 0
l = []
for i in range(0, n - 1, 2):
	if s[i] == s[i + 1]:
		ans += 1
		l.append('ab')
	else:
		l.append(s[i])
		l.append(s[i + 1])
print(ans)
print(''.join(l))


n = int(input())
s = str(input())
ans = 0
a_count = 0
b_count = 0
ss = list(s)
for i in range(len(s)):
	if s[i] == 'a':
		a_count += 1
	else:
		b_count += 1
	if i % 2 != 0:
		if not a_count:
			ss[i] = 'a'
			ans += 1
		elif not b_count:
			ss[i] = 'b'
			ans += 1
		a_count = 0
		b_count = 0
print(int(ans))
print(''.join(ss))


n = int(input())
a = input()
ans = ''
count = 0
for i in range(0, n, 2):
	if a[i] == 'a' and a[i + 1] == 'b':
		ans = ans + 'ab'
	elif a[i] == 'b' and a[i + 1] == 'a':
		ans = ans + 'ba'
	elif a[i] == a[i + 1]:
		ans = ans + 'ab'
		count += 1
print(count)
print(ans)


n = int(input())
string = list(input())
steps = 0
for i in range(0, n, 2):
	if string[i:i + 2] == ['a'] * 2:
		string[i] = 'b'
		steps += 1
	elif string[i:i + 2] == ['b'] * 2:
		string[i] = 'a'
		steps += 1
print(steps)
print(''.join(string))


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline()
arr = []
for i in range(n):
	arr.append(s[i])
c_a = 0
c_b = 0
min_op = 0
a_ind = 0
b_ind = 0
for i in range(n):
	if s[i] == 'a':
		c_a += 1
		a_ind = i
	elif s[i] == 'b':
		c_b += 1
		b_ind = i
	if i % 2 == 1:
		if c_a > c_b:
			min_op += 1
			arr[a_ind] = 'b'
			c_a -= 1
			c_b += 1
		elif c_b > c_a:
			min_op += 1
			arr[b_ind] = 'a'
			c_b -= 1
			c_a += 1
print(min_op)
print(''.join(arr))


import collections
n = int(input())
a = input()
a = list(a)
i = 1
count = 0
while i < n:
	if a[i] == a[i - 1]:
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
		count += 1
	i += 2
print(count)
print(*a, sep='')


n = int(input())
f = input()
s = list(f)
cnt = 0
for i in range(len(s)):
	if (i + 1) % 2 == 0:
		if f[i - 1:i + 1] == 'aa':
			s[i] = 'b'
			cnt += 1
		elif f[i - 1:i + 1] == 'bb':
			s[i] = 'a'
			cnt += 1
print(cnt)
print(''.join(s))


input()
s = list(input().strip())
n = 0
for i in range(1, len(s), 2):
	if s[i - 1] == s[i]:
		(s[i], n) = ('a' if s[i] == 'b' else 'b', n + 1)
print(n)
print(''.join(s))


N = int(input())
s = input()
c = 0
r = ''
a = 0
b = 0
for n in range(N):
	if s[n] == 'a':
		a += 1
	else:
		b += 1
	if n % 2 == 0:
		r = r + s[n]
	elif a == b:
		r = r + s[n]
	else:
		c = c + 1
		if a > b:
			r = r + 'b'
			b = b + 1
			a = a - 1
		else:
			r = r + 'a'
			a = a + 1
			b = b - 1
print(c)
print(r)


n = int(input())
s = input()
ans = 0
arr = []
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		ans += 1
		if s[i] == 'a':
			arr.append('ba')
		else:
			arr.append('ab')
	else:
		arr.append(s[i] + s[i + 1])
print(ans)
print(''.join(arr))


n = int(input())
s = list(input())
i = 0
ans = 0
while i < len(s):
	if s[i] == s[i + 1] == 'a':
		s[i] = 'b'
		ans += 1
	elif s[i] == s[i + 1] == 'b':
		s[i] = 'a'
		ans += 1
	i += 2
print(ans)
print(''.join(s))


n = int(input())
str = list(input())
count = 0
for i in range(0, n, 2):
	if str[i] == 'a' and str[i + 1] == 'a':
		str[i + 1] = 'b'
		count += 1
	elif str[i] == 'b' and str[i + 1] == 'b':
		str[i] = 'a'
		count += 1
print(count)
for x in str:
	print(x, end='')
print()


n = int(input())
s = list(input())
a = b = 0
an = 0
for i in range(n):
	if s[i] == 'a':
		a += 1
	else:
		b += 1
	if i % 2 == 1:
		if a > b:
			an += 1
			s[i] = 'b'
			b += 1
			a -= 1
		elif b > a:
			an += 1
			s[i] = 'a'
			b -= 1
			a += 1
print(an)
print(''.join(s))


from sys import stdin, stdout
input()
S = list(input())
ct = 0
for i in range(0, len(S), 2):
	if S[i] == S[i + 1]:
		ct += 1
		if S[i] == 'a':
			S[i] = 'b'
		else:
			S[i] = 'a'
print(ct)
print(''.join(S))


(n, s) = (int(input()), list(input()))
ans = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		s[i] = chr(1 - ord(s[i]) + 2 * ord('a'))
		ans += 1
print(ans)
print(''.join(s))


l = int(input())
s = input()
output = ''
contatore = 0
for x in range(0, l, 2):
	controllo = s[x:x + 2]
	if controllo[0] == controllo[1]:
		output = output + 'ba'
		contatore += 1
	else:
		output = output + controllo
print(contatore)
print(output)


gi = lambda : list(map(int, input().split()))
(n,) = gi()
s = list(input())
ans = 0
for k in range(0, n, 2):
	if ''.join(s[k:k + 2]) == 'bb' or ''.join(s[k:k + 2]) == 'aa':
		ans += 1
		s[k] = 'b' if s[k] == 'a' else 'a'
print(ans)
print(''.join(s))


from sys import stdin

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

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

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

def si():
	return stdin.readline()
n = ii()
a = si()
a = list(a)
a.pop()
p = 0
for i in range(1, n, 2):
	if a[i] == a[i - 1]:
		p += 1
		a[i] = 'a'
		if a[i - 1] == 'a':
			a[i] = 'b'
print(p)
print(*a, sep='')


n = int(input())
s = list(input())
ca = 0
cb = 0
count = 0
for i in range(len(s)):
	if s[i] is 'a':
		ca += 1
	else:
		cb += 1
	if i % 2 is 1:
		if ca > cb:
			if s[i] is 'a':
				s[i] = 'b'
			else:
				s[i - 1] = 'b'
			ca -= 1
			cb += 1
			count += 1
		elif cb > ca:
			if s[i] is 'b':
				s[i] = 'a'
			else:
				s[i - 1] = 'a'
			ca += 1
			cb -= 1
			count += 1
print(count)
print(''.join(s))


n = int(input())
s = input()
l = list(s)
c = 0
for i in range(0, n, 2):
	if l[i] == 'a' and l[i + 1] == 'a':
		l[i] = 'b'
		c += 1
	if l[i] == 'b' and l[i + 1] == 'b':
		l[i] = 'a'
		c += 1
print(c)
print(''.join(l))


n = int(input())
L = input()
c = 0
S = ''
for i in range(n // 2):
	if L[2 * i:2 * i + 2] != 'ab' and L[2 * i:2 * i + 2] != 'ba':
		c += 1
		S += 'ab'
	else:
		S += L[2 * i:2 * i + 2]
print(c)
print(S)


def ain():
	return map(int, input().split())
n = int(input())
s = input()
s = list(s)
c = 0
for i in range(n):
	if i % 2 == 0 and i < n - 1:
		if s[i] == 'a' and s[i + 1] == 'a' or (s[i] == 'b' and s[i + 1] == 'b'):
			s[i] = 'a'
			s[i + 1] = 'b'
			c += 1
print(c)
for x in s:
	print(x, end='')
print()


n = int(input())
string = list(input())
count = 0
chage = 0
for i in range(0, n, 2):
	if string[i] == string[i + 1]:
		if string[i] == 'a':
			string[i] = 'b'
			chage += 1
		else:
			string[i] = 'a'
			chage += 1
print(chage)
print(''.join(string))


S = int(input())
sab = ''
M = list(map(str, input()))
m = 0
c = 0
st = ''
while m < len(M):
	if (M[m] == 'a' and M[m + 1] == 'b' or (M[m] == 'b' and M[m + 1] == 'a')) == False:
		if M[m] == 'a':
			M[m] = 'b'
			st += 'ba'
		else:
			M[m] = 'a'
			st += 'ab'
		c += 1
	else:
		st += M[m] + M[m + 1]
	m += 2
print(c)
print(st)


x = int(input())
string = input()
steps = 0
a = 0
b = 0
lstr = []
for (i, s) in enumerate(string):
	if s == 'a':
		a += 1
	elif s == 'b':
		b += 1
	if i % 2 == 0:
		lstr.append(s)
	elif i % 2 == 1:
		if a > b:
			a -= 1
			b += 1
			lstr.append('b')
			steps += 1
		elif b > a:
			a += 1
			b -= 1
			lstr.append('a')
			steps += 1
		else:
			lstr.append(s)
nstring = ''.join(lstr)
print(steps)
print(nstring)


n = int(input())
s = list(input())
numa = 0
numb = 0
ans = 0
for i in range(1, n + 1, 2):
	if s[i - 1] == 'b':
		numb += 1
	else:
		numa += 1
	if s[i] == 'b':
		numb += 1
	else:
		numa += 1
	d = numa - numb
	if d > 0:
		ans += d // 2
		numa -= d // 2
		numb += d // 2
		s[i] = 'b'
	elif d < 0:
		ans += -d // 2
		numa -= d // 2
		numb += d // 2
		s[i] = 'a'
print(ans)
print(''.join(s))


n = int(input())
s = input()
o = ''
out = 0
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		out += 1
		if s[i] == 'a':
			o += 'ba'
		else:
			o += 'ab'
	else:
		o += s[i:i + 2]
print(out)
print(o)


(n, st, c) = (int(input()), input(), 0)
s = [str(i) for i in st]
for i in range(0, n, 2):
	if s[i] + s[i + 1] == 'ab' or s[i] + s[i + 1] == 'ba':
		pass
	else:
		c += 1
		(s[i], s[i + 1]) = ('a', 'b')
print(c)
print(''.join(s))


def main():
	n = int(input())
	s = input()
	s = list(s)
	cool = 0
	for i in range(0, n, 2):
		k = s[i:i + 2]
		if not ('a' in k and 'b' in k):
			cool += 1
			s[i:i + 2] = ['a', 'b']
	print(cool)
	print(''.join(s))
	return
main()


n = int(input())
s = input()
a = []
count = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		count += 1
		a.append(s[i])
		if s[i] == 'a':
			a.append('b')
		else:
			a.append('a')
	else:
		a.append(s[i])
		a.append(s[i + 1])
print(count)
print(''.join((str(x) for x in a)))


try:
	from string_source import string_source
	source = string_source('6\nababab')
except ImportError:
	source = input

def prefixes(s):
	original = list(s)
	modified = list(s)
	count = 0
	for i in range(1, len(s), 2):
		if original[i - 1] != original[i]:
			pass
		elif original[i - 1] == 'a':
			modified[i] = 'b'
			count += 1
		elif original[i - 1] == 'b':
			modified[i] = 'a'
			count += 1
		else:
			raise ValueError('invalid %s' % original[i - 1])
	return (count, ''.join(modified))
source()
(count, new_string) = prefixes(source())
print(count)
print(new_string)
if False:
	prefixes('ababab')
	prefixes('bbbb')
	prefixes('aa')


import collections
import itertools
import sys
from bisect import bisect_left
from collections import defaultdict, Counter
from math import sqrt, ceil
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def pr(a):
	r = sqrt(a)
	for i in range(2, int(r) + 1):
		if a % i == 0:
			return i
	return None

def res(param):
	(a, b) = (0, 0)
	for c in param:
		if c == 'a':
			a += 1
		else:
			b += 1
	return (a, b)

def main():
	n = inp()
	v = input()
	r = []
	c = 0
	for i in range(0, n, 2):
		s = v[i:i + 2]
		a = len([r for r in s if r == 'a'])
		b = 2 - a
		if a != b:
			if a > b:
				r += 'ba'
				c += 1
			else:
				r += 'ab'
				c += 1
		else:
			r.append(s)
	print(c)
	print(''.join(r))
main()


input()
s = input()
l = list(s)
c = 0
i = 0
(a, b) = (0, 0)
while i < len(l):
	if l[i] == 'a':
		a += 1
	else:
		b += 1
	if i % 2 == 1:
		if a != b:
			if l[i] == 'a':
				l[i] = 'b'
				a -= 1
				b += 1
			else:
				l[i] = 'a'
				a += 1
				b -= 1
			c += 1
	i += 1
print(c)
for i in l:
	print(i, end='')


n = int(input())
a = input()
b = list(a)
(ac, bc) = (0, 0)
y = 0
for i in range(0, n, 2):
	ac += b[i:i + 2].count('a')
	bc += b[i:i + 2].count('b')
	if ac == bc:
		continue
	y += 1
	if ac > bc:
		b[i] = 'b'
		ac -= 1
		bc += 1
	else:
		b[i] = 'a'
		bc -= 1
		ac += 1
print(y)
for i in b:
	print(i, end='')
print()


n = int(input())
a = list(input())
counter = 0
for i in range(0, n, 2):
	if a[i] == a[i + 1]:
		a[i] = 'ab'[a[i] == 'a']
		counter += 1
print(counter, '\n', *a, sep='')


n = int(input())
s = input()
new = []
count = 0
for i in range(1, len(s), 2):
	if s[i] == s[i - 1] and s[i] == 'a':
		count += 1
		new.append(s[i - 1])
		new.append('b')
	elif s[i] == s[i - 1] and s[i] == 'b':
		count += 1
		new.append(s[i - 1])
		new.append('a')
	else:
		new.append(s[i - 1:i + 1])
print(count)
for i in new:
	print(i, end='')


n = int(input())
s = input()
an = []
count = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		count += 1
		an.append(s[i])
		if s[i] == 'a':
			an.append('b')
		else:
			an.append('a')
	else:
		an.append(s[i])
		an.append(s[i + 1])
print(count)
for i in an:
	print(i, end='')


n = int(input())
s = list(input())
cnt = 0
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'a':
		cnt += 1
		s[i] = 'b'
	elif s[i] == 'b' and s[i + 1] == 'b':
		cnt += 1
		s[i] = 'a'
print(cnt)
print(''.join(s))


(length, s) = (int(input()), input())
(count, mod_s) = (0, '')
for i in range(0, length - 1, 2):
	if s[i] == s[i + 1]:
		count += 1
		mod_s += 'ab'
	elif s[i] != s[i + 1]:
		mod_s += s[i] + s[i + 1]
print(count, mod_s, sep='\n')


while True:
	try:
		n = int(input(''))
		ls = input('')
	except:
		break
	ls = list(ls)
	ans = 0
	for i in range(0, n, 2):
		if ls[i] == ls[i + 1]:
			if ls[i] == 'a':
				ls[i] = 'b'
			else:
				ls[i] = 'a'
			ans += 1
		else:
			continue
	print(ans)
	for i in range(0, len(ls)):
		print('%c' % ls[i], end='')
	break


input()
s = input()
r = 0
t = ''
for i in range(0, len(s), 2):
	x = s[i]
	r += x == s[i + 1]
	t += x + 'ab'[x < 'b']
print(r)
print(t)


n = int(input())
string = input()
newstring = []
ans = 0
for i in range(0, n, 2):
	mystr = string[i:i + 2]
	if mystr == 'aa':
		ans += 1
		newstring.append('ba')
	elif mystr == 'bb':
		ans += 1
		newstring.append('ab')
	else:
		newstring.append(mystr)
print(ans)
for i in newstring:
	print(i, end='')
print()


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
(n,) = I()
s = list(input())
ans = 0
for i in range(0, n, 2):
	if s[i] + s[i + 1] not in ('ab', 'ba'):
		ans += 1
		if s[i] == 'a':
			s[i + 1] = 'b'
		else:
			s[i + 1] = 'a'
print(ans)
print(''.join(s))


n = int(input())
arr = input()
count = 0
arr2 = ''
for i in range(0, n, 2):
	if arr[i:i + 2] == 'aa':
		arr2 += 'ab'
		count += 1
	elif arr[i:i + 2] == 'bb':
		arr2 += 'ba'
		count += 1
	else:
		arr2 += arr[i:i + 2]
print(count)
print(arr2)


n = int(input())
s = list(input())
c = 0
ans = 0
for i in range(n):
	if s[i] == 'a':
		c += 1
	else:
		c -= 1
	if c == 2:
		ans += 1
		s[i] = 'b'
		c = 0
	elif c == -2:
		ans += 1
		s[i] = 'a'
		c = 0
print(ans)
print(*s, sep='')


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
import re
pattern = '0+'
n = int(input())
s = list(input())
tot = 0
ans = []
for i in range(0, len(s), 2):
	if ''.join(s[i:i + 2]) not in ['ab', 'ba']:
		tot += 1
		ans.append('ab')
	else:
		ans.append(''.join(s[i:i + 2]))
print(tot)
print(''.join(ans))


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

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

def si():
	return input()

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

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

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

def getKey(item):
	return item[0]

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

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

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

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

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

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

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

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

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

def main():
	n = ii()
	s = list(si())
	if n % 2 == 1:
		nn = n - 1
	else:
		nn = n
	c = 0
	for i in range(0, nn, 2):
		if s[i] == 'a' and s[i + 1] == 'b' or (s[i] == 'b' and s[i + 1] == 'a'):
			continue
		c += 1
		if s[i] == 'a':
			s[i + 1] = 'b'
		else:
			s[i + 1] = 'a'
	print(c)
	print(''.join(s))
	exit()
	a = 0
	b = 0
	for i in range(n):
		if i % 2 == 0:
			if s[i] == 'a':
				b += 1
		elif s[i] == 'b':
			a += 1
	a1 = 0
	b1 = 0
	for i in range(n):
		if i % 2 == 1:
			if s[i] == 'a':
				b1 += 1
		elif s[i] == 'b':
			a1 += 1
	print(min(a + b, a1 + b1))
	if a + b < a1 + b1:
		x = ''
		for i in range(n):
			if i % 2 == 0:
				x += 'b'
			else:
				x += 'a'
		print(x)
	else:
		x = ''
		for i in range(n):
			if i % 2 == 0:
				x += 'a'
			else:
				x += 'b'
		print(x)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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


from collections import deque
import sys

def inp():
	return sys.stdin.readline().strip()
n = int(inp())
s = inp()
ct = 0
a = []
for i in s:
	if i == 'a':
		a.append(0)
	else:
		a.append(1)
for i in range(0, len(a), 2):
	if i + 1 < len(a):
		if a[i] == a[i + 1]:
			a[i + 1] = a[i + 1] ^ 1
			ct += 1
res = []
for i in a:
	if i == 0:
		res.append('a')
	else:
		res.append('b')
res = ''.join(res)
print(ct)
print(res)


n = int(input())
s = list(str(input()))
count = 0
for i in range(0, n, 2):
	if s[i] != s[i + 1]:
		continue
	else:
		s[i] = 'a'
		s[i + 1] = 'b'
		count += 1
print(count)
print(*s, sep='')


n = int(input())
s = input()
c = 0
t = ''
for i in range(n // 2):
	f1 = s[2 * i] == 'a'
	f2 = s[2 * i] == 'b'
	f3 = s[2 * i + 1] == 'a'
	f4 = s[2 * i + 1] == 'b'
	if f1 and f3 or (f2 and f4):
		c += 1
		t += 'ab'
	else:
		t += s[2 * i:2 * i + 2]
print(c)
print(t)


n = int(input())
palavra = ' ' + input()
troca = {'a': 'b', 'b': 'a'}
cont = 0
nova = ''
for i in range(1, n // 2 + 1):
	if palavra[2 * i - 1] == palavra[2 * i]:
		cont += 1
		nova += palavra[2 * i - 1] + troca[palavra[2 * i]]
	else:
		nova += palavra[2 * i - 1] + palavra[2 * i]
print(cont)
print(nova)


import sys
input = sys.stdin.readline
n = int(input())
s = input()
res = ''
ans = 0
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'a':
		ans += 1
		res += 'ab'
	elif s[i] == 'b' and s[i + 1] == 'b':
		ans += 1
		res += 'ba'
	else:
		res += s[i] + s[i + 1]
print(ans)
print(res)


T = int(input())
t = ''
F = list(map(str, input()))
f = 0
n = 0
b = ''
while f < len(F):
	if (F[f] == 'a' and F[f + 1] == 'b' or (F[f] == 'b' and F[f + 1] == 'a')) == False:
		if F[f] == 'a':
			F[f] = 'b'
			b += 'ba'
		else:
			F[f] = 'a'
			b += 'ab'
		n += 1
	else:
		b += F[f] + F[f + 1]
	f += 2
print(n)
print(b)


n = int(input())
a = list(input())
a_count = 0
b_count = 0
count = 0
b = []
for i in range(n):
	if a[i] == 'a':
		a_count += 1
	else:
		b_count += 1
	if i % 2 == 1:
		if b_count > a_count:
			b_count -= 1
			a_count += 1
			count += 1
			a[i] = 'a'
		elif a_count > b_count:
			a_count -= 1
			b_count += 1
			a[i] = 'b'
			count += 1
out = ''
print(count)
print(out.join(a))


from sys import stdout
n = int(input())
(a, b) = 'ab'
cnt = 0
s = list(input())
for i in range(1, n, 2):
	if s[i] == s[i - 1]:
		cnt += 1
		if s[i] == a:
			s[i] = b
		else:
			s[i] = a
s = ''.join(s)
print(cnt)
stdout.write(s)


input()
s = input()
ctr = 0
res = ''
for c in range(0, len(s), 2):
	if s[c] == s[c + 1]:
		res += 'ab'
		ctr += 1
	else:
		res += s[c:c + 2]
print(ctr)
print(res)


n = int(input())
s = input()
pref = [0] * n
for i in range(n):
	if s[i] == 'b':
		pref[i] = -1
	else:
		pref[i] = 1
temp = [0] * n
temp[0] = pref[0]
summ = pref[0]
for i in range(1, n):
	summ += pref[i]
	if i % 2 != 0:
		temp[i] = summ
		summ = 0
count = 0
temp1 = list(s)
for i in range(1, n, 2):
	if temp[i] != 0:
		count += 1
		if s[i] == 'a':
			temp1[i] = 'b'
		elif s[i] == 'b':
			temp1[i] = 'a'
print(count)
for i in range(n):
	print(temp1[i], end='')
print('')


n = int(input())
s = [x for x in input()]
c = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		c += 1
print(c)
print(''.join(s))


n = int(input())
inp = list(input())
res = 0
for i in range(0, n, 2):
	if i + 1 < n:
		if inp[i] == inp[i + 1]:
			res += 1
			if inp[i] == 'a':
				inp[i] = 'b'
			else:
				inp[i] = 'a'
print(res)
print(''.join(inp))


n = int(input())
s = list(str(input()))
p = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		if s[i + 1] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		p += 1
print(p)
print(''.join(s))


a = int(input())
st = str(input())
l = []
d = ''
c = 0
for i in range(0, a, 2):
	s = st[i:i + 2]
	if s == 'ab' or s == 'ba':
		l.append(s)
	else:
		l.append('ab')
		c += 1
print(c)
print(d.join(l))


n = int(input())
arrx = list(input())
cunta = 0
cuntb = 0
loopy = len(arrx) - 1
while loopy >= 0:
	if arrx[loopy] == arrx[loopy - 1]:
		if arrx[loopy] == 'a':
			arrx[loopy] = 'b'
		else:
			arrx[loopy] = 'a'
		cunta += 1
	loopy -= 2
print(cunta)
print(*arrx, sep='')


n = int(input())
s = input()
(a, b) = (0, 0)
s1 = []
for i in range(n):
	s1.append(s[i])
c = 0
for i in range(n):
	if s1[i] == 'a':
		a += 1
	else:
		b += 1
	if i % 2:
		if a == b:
			pass
		elif a > b:
			s1[i] = 'b'
			c += 1
			a -= 1
			b += 1
		else:
			s1[i] = 'a'
			c += 1
			b -= 1
			a += 1
print(c)
for i in range(n):
	print(s1[i], end='')


n = int(input())
s = list(input())
s1 = ''
i = 0
c = 0
while i < n - 1:
	if s[i] == s[i + 1]:
		c += 1
		s[i] = 'a'
		s[i + 1] = 'b'
	i += 2
print(str(c) + '\n' + ''.join(s))


n = input()
s1 = str(input())
s = []
b = 'b'
a = 'a'
for i in range(len(s1)):
	s.append(s1[i])
count = 0
i = 0
if s[0] == 'a' or s[0] == 'b':
	while i < len(s1) - 1:
		if s[i] == s[i + 1]:
			if s[i] == b:
				s[i + 1] = a
			else:
				s[i + 1] = b
			count += 1
			i += 2
		else:
			i += 2
s2 = ''
s2 = ''.join(s)
print(count)
print(s2)


n = int(input())
s = list(str(input()))
count = 0
i = 0
while i < n - 1:
	if s[i] == 'a' and s[i + 1] == 'a':
		s[i + 1] = 'b'
		count += 1
	elif s[i] == 'b' and s[i + 1] == 'b':
		s[i + 1] = 'a'
		count += 1
	i += 2
print(count)
print(''.join(map(str, s)))


def main():
	T = int(input().strip())
	s = str(input().strip())
	s = list(s)
	ans = 0
	num_A = 0
	num_B = 0
	for i in range(len(s)):
		if s[i] == 'a':
			num_A += 1
		if s[i] == 'b':
			num_B += 1
		if (i + 1) % 2 == 0 and num_A != num_B:
			if num_A > num_B:
				s[i] = 'b'
			if num_B > num_A:
				s[i] = 'a'
			ans += 1
			(num_A, num_B) = ((i + 1) // 2, (i + 1) // 2)
	print(ans)
	print(''.join(s))
main()


num = int(input())
s = input()
n = ''
t = 0
for i in range(0, num, 2):
	if s[i] == s[i + 1]:
		t += 1
		n += 'ab'
	else:
		n += s[i:i + 2]
print(t)
print(n)


n = int(input())
string = list(input())
ans = 0
for i in range(0, n, 2):
	l1 = string[i]
	l2 = string[i + 1]
	if l1 == l2:
		ans += 1
		if l1 == 'b':
			string[i] = 'a'
		else:
			string[i] = 'b'
print(ans)
print(''.join(string))


input()
s = input()
r = 0
t = ''
for (x, y) in zip(s[::2], s[1::2]):
	r += x == y
	t += x + 'ab'[x < 'b']
print(r)
print(t)


n = int(input())
s = input().strip()
list_s = list(s)
count = 0
i = 0
while i < n:
	if s[i] == 'a' and s[i + 1] != 'b':
		count += 1
		list_s[i + 1] = 'b'
	elif s[i] == 'b' and s[i + 1] != 'a':
		count += 1
		list_s[i + 1] = 'a'
	i += 2
print(count)
print(''.join(list_s))


n = int(input())
s = input()
r = 0
t = ''
for i in range(0, n, 2):
	x = s[i]
	r += x == s[i + 1]
	t += x + 'ab'[x < 'b']
print(r)
print(t)


from collections import Counter
length = int(input())
word = list(input())
prefixes = int(length / 2)
ops = 0
for i in range(prefixes):
	if word[2 * i] == word[2 * i + 1]:
		ops += 1
		if word[2 * i] == 'a':
			word[2 * i] = 'b'
		else:
			word[2 * i] = 'a'
print(ops)
print(''.join(word))


n = int(input())
s = input()
count = aa = bb = pa = pb = 0
arr = []
st = ''
for i in range(n):
	if s[i] == 'a':
		aa += 1
		pa = i
	else:
		bb += 1
		pb = i
	arr.append(s[i])
	if i % 2 == 1:
		if aa > bb:
			aa -= 1
			bb += 1
			arr[pa] = 'b'
			count += 1
		elif aa < bb:
			aa += 1
			bb -= 1
			arr[pb] = 'a'
			count += 1
for i in arr:
	st += i
print(count)
print(st)


n = int(input())
s = input()
s1 = 0
p = ''
for i in range(0, len(s) - 1, 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			p += 'a'
			p += 'b'
			s1 += 1
		else:
			p += 'b'
			p += 'a'
			s1 += 1
	else:
		p += s[i]
		p += s[i + 1]
print(s1)
print(p)


n = int(input())
(string, res, count) = (input(), '', 0)
for i in range(0, n, 2):
	if string[i:i + 2] == 'aa' or string[i:i + 2] == 'bb':
		res = res + 'ab'
		count += 1
	else:
		res = res + string[i:i + 2]
print(count, res, sep='\n')


n = int(input())
cadena = list(input())
movimientos = 0
for pos in range(0, n, 2):
	if cadena[pos] == cadena[pos + 1]:
		if cadena[pos] == 'a':
			cadena[pos] = 'b'
		else:
			cadena[pos] = 'a'
		movimientos += 1
print(movimientos)
print(''.join(cadena))


def solver(st):
	pass
q = input()
q = input()
tot = 0
x = []
for f in range(len(q) // 2):
	i = f * 2
	if q[i] != q[i + 1]:
		x.append(q[i])
		x.append(q[i + 1])
	else:
		if q[i] == 'a':
			x.append('b')
			x.append('a')
		else:
			x.append('a')
			x.append('b')
		tot += 1
print(tot)
print(''.join(x))


n = int(input())
s = input()
i = 0
mainlist = list()
while i < n:
	mainlist.append(s[i:i + 2])
	i = i + 2
sm = len(mainlist)
count = 0
for i in range(0, sm):
	if mainlist[i] == 'aa':
		mainlist[i] = 'ab'
		count = count + 1
	elif mainlist[i] == 'bb':
		mainlist[i] = 'ba'
		count = count + 1
str1 = ''
print(count)
print(str1.join(mainlist))


n = int(input())
string = input()
prefix = list(string)
counter = 0
for i in range(0, n - 1, 2):
	last = prefix[i]
	next = prefix[i + 1]
	if last == 'a' and next == 'a':
		prefix[i] = 'b'
		counter += 1
	if last == 'b' and next == 'b':
		prefix[i] = 'a'
		counter += 1
print(counter)
print(''.join(prefix))


l = int(input())
s = [char for char in input()]
cc = 0
other_char = {'a': 'b', 'b': 'a'}
for i in range(0, l, 2):
	if s[i] == s[i + 1]:
		cc += 1
		s[i] = other_char[s[i]]
print(cc)
print(''.join(s))


n = int(input())
s = input()
t = []
for i in s:
	t.append(i)
s = t
count = 0
for i in range(1, n // 2 + 1):
	if not (s[2 * i - 2:2 * i] == ['a', 'b'] or s[2 * i - 2:2 * i] == ['b', 'a']):
		if s[2 * i - 2] == 'a':
			s[2 * i - 2] = 'b'
			count += 1
		else:
			s[2 * i - 2] = 'a'
			count += 1
print(count)
print(''.join(s))


n = int(input())
s = input()
c = 0
string = ''
for i in range(0, len(s), 2):
	temp = s[i:i + 2]
	if temp[0] == temp[1]:
		c += 1
		string += 'ab'
	else:
		string += temp
print(c)
print(string)


n = int(input())
s = input()
i = 0
c = 0
k = ''
for i in range(0, n, 2):
	a = s[i:i + 2]
	if s[i] == 'a' and s[i + 1] == 'a':
		c1 = 2
		c2 = 0
	elif s[i] == 'b' and s[i + 1] == 'b':
		c2 = 2
		c1 = 0
	else:
		c1 = 1
		c2 = 1
	if c1 == 2:
		c += 1
		k = k + 'ab'
	elif c2 == 2:
		c += 1
		k = k + 'ab'
	elif c1 == 1 and c2 == 1:
		k = k + a
print(c)
print(k)


ln = int(input())
s = str(input())
l = list(s)
acnt = 0
bcnt = 0
totcnt = 0
i = 0
while i < len(s):
	if s[i] == 'b':
		bcnt += 1
	else:
		acnt += 1
	if i % 2 == 1:
		if acnt != bcnt:
			if acnt > bcnt:
				acnt -= 1
				bcnt += 1
				l[i] = 'b'
			else:
				bcnt -= 1
				acnt += 1
				l[i] = 'a'
			totcnt += 1
	i += 1
print(totcnt)
print(''.join(l))


n = int(input())
s = list(input())
cnt = 0
new_str = ''
for i in range(0, n - 1, 2):
	cur_add = s[i:i + 2]
	cur_add = cur_add[0] + cur_add[1]
	if cur_add == 'aa':
		cnt += 1
		new_str += 'ab'
	elif cur_add == 'bb':
		cnt += 1
		new_str += 'ab'
	else:
		new_str += cur_add[0] + cur_add[1]
print(cnt)
print(new_str)


n = int(input())
s = input()
ans = list(s)
count = 0
for i in range(0, n, 2):
	if ans[i] != ans[i + 1]:
		continue
	else:
		count += 1
		if ans[i] == 'b':
			ans[i + 1] = 'a'
		elif ans[i] == 'a':
			ans[i + 1] = 'b'
print(count)
print(''.join(ans))


input()
line = list(input())
cnt = 0
x = line.count
for i in range(0, len(line), 2):
	if line[i] == line[i + 1]:
		cnt += 1
		if line[i] == 'a':
			line[i] = 'b'
		else:
			line[i] = 'a'
print(cnt)
print(*line, sep='')


n = int(input())
s = list(input())
c = 0
for i in range(0, n, 2):
	if s[i:i + 2] == ['b', 'a'] or s[i:i + 2] == ['a', 'b']:
		pass
	else:
		s[i:i + 2] = ['a', 'b']
		c += 1
print(c)
print(''.join(s))


def main():
	n = int(input())
	s = [ch for ch in input().strip()]
	a = [0] * n
	b = [0] * n
	for i in range(0, n, 2):
		if s[i] == 'a':
			a[i + 1] += 1
		else:
			b[i + 1] += 1
		if s[i + 1] == 'a':
			a[i + 1] += 1
		else:
			b[i + 1] += 1
	changes = 0
	for i in range(1, n, 2):
		if a[i] != b[i]:
			if a[i] > b[i]:
				s[i] = 'b'
			else:
				s[i - 1] = 'a'
			changes += 1
	print(changes)
	print(''.join(s))
main()


n = int(input())
s = [*input()]
c = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		c += 1
		s[i:i + 2] = 'ab'
print(c)
print(''.join(s))


tamS = int(input())
s = list(input())
aux = 0
op = 0
for i in range(tamS // 2):
	if s[aux] == 'a' and s[aux + 1] != 'b':
		s[aux + 1] = 'b'
		op += 1
	elif s[aux] == 'b' and s[aux + 1] != 'a':
		s[aux + 1] = 'a'
		op += 1
	aux += 2
print(op)
print(''.join(s))


a = int(input())
c = input()
b = []
for i in range(len(c)):
	b.append(c[i])
f = 0
if a % 2 != 0:
	a -= 1
for i in range(0, len(b), 2):
	if b[i] == b[i + 1] and b[i] == 'a':
		f += 1
		b[i] = 'b'
	if b[i] == b[i + 1] and b[i] == 'b':
		f += 1
		b[i] = 'a'
print(f)
for i in range(len(b)):
	print(b[i], end='')


size = int(input())
s = list(input())
changes = 0
for i in range(0, size, 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		changes += 1
print(changes)
print(''.join(s))


n = int(input())
a = list(input())
(l1, l2) = (0, 0)
m = ''
ans = 0
for i in range(1, n, 2):
	m = a[i - 1:i + 1]
	if m == ['a', 'a']:
		a[i] = 'b'
		ans += 1
	if m == ['b', 'b']:
		a[i] = 'a'
		ans += 1
print(ans)
print(*a, sep='')


q = int(input())
s = list(input())
count = 0
count1 = 0
count2 = 0
for i in range(q):
	if s[i] == 'a':
		count1 = count1 + 1
	elif s[i] == 'b':
		count2 = count2 + 1
	if i % 2 == 1:
		if count1 > count2:
			count = count + 1
			count2 = count2 + 1
			count1 = count1 - 1
			s[i] = 'b'
		elif count2 > count1:
			count = count + 1
			count2 = count2 - 1
			count1 = count1 + 1
			s[i] = 'a'
s1 = ''
print(count)
print(s1.join(s))


n = int(input())
str_old = list(input())
str_new = [None] * n
counter = 0
for i in range(0, len(str_old), 2):
	str_new[i] = str_old[i]
	if str_old[i] == str_old[i + 1]:
		str_new[i + 1] = 'b' if str_old[i] == 'a' else 'a'
		counter += 1
	else:
		str_new[i + 1] = str_old[i + 1]
print(counter)
print(''.join(str_new))


length = int(input())
word = input()
num_changes = 0
result = ''
for i in range(0, length - 1, 2):
	chunk = word[i:i + 2]
	if chunk == 'ab' or chunk == 'ba':
		result += chunk
	else:
		num_changes += 1
		result += 'ab'
print(num_changes)
print(result)


n = int(input())
s = input()
res = 0
l = []
for i in range(n // 2):
	if s[2 * i] == s[2 * i + 1]:
		res += 1
		l.append('ab')
	else:
		l.append(s[2 * i:2 * i + 2])
print(res)
print(''.join(l))


n = int(input())
s = str(input())
counter = 0
new_str = ''
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		new_str += s[i]
		new_str += 'a' if s[i + 1] == 'b' else 'b'
		counter += 1
	else:
		new_str += s[i]
		new_str += s[i + 1]
print(counter)
print(new_str)


n = int(input())
arr = input()
counta = 0
countb = 0
ans = 0
ansstr = []
for i in range(n):
	if arr[i] == 'a':
		counta += 1
		ansstr.append('a')
	else:
		countb += 1
		ansstr.append('b')
	if i & 1:
		if counta == countb:
			pass
		else:
			ans += 1
			if counta > countb:
				countb += 1
				counta -= 1
				if ansstr[i] == 'a':
					ansstr[i] = 'b'
				else:
					ansstr[i - 1] = 'b'
			else:
				counta += 1
				countb -= 1
				if ansstr[i] == 'b':
					ansstr[i] = 'a'
				else:
					ansstr[i - 1] = 'a'
print(ans)
print(''.join(ansstr))


n = int(input())
s = input()
count = 0
new = ''
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		new = new + 'a' + 'b'
		count += 1
	else:
		new = new + s[i] + s[i + 1]
print(count)
print(new)


from sys import stdin, stdout
from math import gcd, sqrt, floor, ceil
from collections import defaultdict
import random
input = stdin.readline

def list_inp(x):
	return list(map(x, input().split()))

def map_inp(x):
	return map(x, input().split())

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
s = input().strip('\n')
s = list(s)
cnt = 0
for i in range(0, n, 2):
	if (s[i], s[i + 1]) == ('a', 'b') or (s[i], s[i + 1]) == ('b', 'a'):
		continue
	else:
		s[i] = 'a'
		s[i + 1] = 'b'
		cnt += 1
print(cnt)
print(''.join(s))


tam = int(input())
string = string = [x for x in input()]
contador = 0
i = 2
while i <= tam:
	quant_a = string[i - 2:i].count('a')
	quant_b = string[i - 2:i].count('b')
	if quant_a != quant_b:
		contador += 1
		if quant_a > quant_b:
			string[i - 2] = 'b'
		else:
			string[i - 1] = 'a'
	i += 2
string = ''.join(string)
print(contador)
print(string)


n = int(input())
s = list(input())
ans = []
count = 0
count1 = 0
final = 0
ans1 = []
for i in range(n):
	if s[i] == 'a':
		count1 += 1
	else:
		count += 1
	if (i + 1) % 2 == 0:
		if count1 > count:
			s[i] = 'b'
			final += 1
			count += 1
			count1 -= 1
		if count > count1:
			s[i] = 'a'
			final += 1
			count1 += 1
			count -= 1
print(final)
print(''.join(s))


n = int(input())
s = input()
ab = ba = 0
k = 0
for i in range(2, len(s) + 1, 2):
	if s[i - 2:i] not in ['ab', 'ba']:
		k += 1
print(k)
for i in range(2, len(s) + 1, 2):
	if s[i - 2:i] not in ['ab', 'ba']:
		print('ab', end='')
	else:
		print(s[i - 2:i], end='')
print()


n = int(input())
s = list(input())
x = 0
a = s[0:1].count('a')
b = s[0:1].count('b')
for i in range(0, n, 2):
	if s[i:i + 2].count('a') == 0:
		s[i] = 'a'
		x += 1
	elif s[i:i + 2].count('b') == 0:
		s[i] = 'b'
		x += 1
print(x)
print(''.join(s))


n = int(input())
s = list(str(input()))
sl = list(set(s))
countA = 0
countB = 0
countChanges = 0
if len(sl) == 1:
	print(n // 2)
	for i in range(n):
		if i % 2 == 0:
			print('a', end='')
		else:
			print('b', end='')
else:
	i = 0
	j = 1
	while j < n:
		if s[i] == s[j]:
			if s[i] == 'a':
				s[i] = 'b'
				countChanges += 1
			else:
				s[i] = 'a'
				countChanges += 1
		i += 2
		j += 2
	print(countChanges)
	for i in range(n):
		print(s[i], end='')


n = int(input())
l = input()
ans = 0
k = []
for i in range(0, n, 2):
	if l[i] == l[i + 1]:
		k.append('ab')
		ans += 1
	else:
		k.append(l[i])
		k.append(l[i + 1])
print(ans)
for i in k:
	print(i, end='')


n = int(input())
s = input()
s1 = []
a = 1
b = 0
while a <= n - 1:
	if s[a - 1] == s[a]:
		s1.append('a')
		s1.append('b')
		b = b + 1
	else:
		s1.append(s[a - 1])
		s1.append(s[a])
	a = a + 2
print(b)
s2 = ''.join(map(str, s1))
print(s2)


pairLen = int(int(input()) / 2)
strList = list(input())
count = 0
for i in range(pairLen):
	if strList[i * 2] == strList[i * 2 + 1]:
		count = count + 1
		if strList[i * 2] == 'a':
			strList[i * 2] = 'b'
		else:
			strList[i * 2] = 'a'
print(count)
print(''.join(strList))


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial

def binNumber(n, size=1):
	return bin(n)[2:].zfill(size)

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

def ini():
	return int(input())

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

def instr():
	return str(input())
n = ini()
s = instr()
a = 0
b = 0
c = 0
ans = []
for ch in s:
	if ch == 'a':
		if a == b + 1:
			ans.append('b')
			c += 1
			b += 1
		else:
			ans.append('a')
			a += 1
	elif b == a + 1:
		ans.append('a')
		c += 1
		a += 1
	else:
		b += 1
		ans.append('b')
ss = ''.join(ans)
print(c)
print(ss)


import sys
sin = sys.stdin
n = int(sin.readline())
st = list(sin.readline())
count = 0
for i in range(1, len(st), 2):
	if st[i] == st[i - 1]:
		if st[i] == 'a':
			st[i - 1] = 'b'
		else:
			st[i - 1] = 'a'
		count += 1
print(count)
print(''.join(st)[:-1])


n = int(input())
s = input()
ans = ''
cnt = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		ans += 'ab'
		cnt += 1
	else:
		ans += s[i] + s[i + 1]
print(cnt)
print(ans)


N = int(input())
L = list(input())
count = 0
for i in range(0, N, 2):
	if L[i] == L[i + 1]:
		count += 1
		if L[i] == 'a':
			L[i] = 'b'
		else:
			L[i] = 'a'
print(count)
L = ''.join(L)
print(L)


size = int(input())
row = input()
new_row = ''
moves = 0
for index in range(0, size, 2):
	pair = row[index:index + 2]
	if pair[0] == pair[1]:
		if pair[0] == 'a':
			new_row += 'b'
		else:
			new_row += 'a'
		moves += 1
		new_row += pair[1]
	else:
		new_row += pair[0]
		new_row += pair[1]
print(moves)
print(new_row)


def roplace(n, list, old, new, count):
	r = n - 2
	c = 0
	while r < n:
		if list[r] == old:
			list[r] = new
			c = c + 1
			if c == count:
				break
		r = r + 1
	return list
a = int(input())
b = [char for char in input()]
r = 2
c = 0
while r <= a:
	m = b[r - 2:r].count('a')
	n = b[r - 2:r].count('b')
	if m != n:
		if m > n:
			c = c + (m - n) / 2
			b = roplace(r, b, 'a', 'b', (m - n) / 2)
		else:
			c = c + (n - m) / 2
			b = roplace(r, b, 'b', 'a', (n - m) / 2)
	r = r + 2
print(int(c))
print(''.join((char for char in b)))


def main():
	input()
	s = list(input())
	res = 0
	for i in range(0, len(s), 2):
		x = s[i:i + 2]
		if x == ['a', 'a'] or x == ['b', 'b']:
			res += 1
			s[i] = 'a'
			s[i + 1] = 'b'
	print(res)
	print(''.join(s))
main()


i = input
(_, a) = (i(), i())
(r, b) = (0, '')
for (x, y) in zip(a[::2], a[1::2]):
	r += x == y
	b += 'ba'[y > 'a'] + y
print(r, b, sep='\n')


import sys

def get_ints():
	return map(int, I().split())

def get_list():
	return list(map(int, I().split()))

def I():
	return sys.stdin.readline().strip()
n = int(I())
a = I()
L = list(a)
count = 0
for i in range(0, n, 2):
	if a[i] == a[i + 1]:
		count += 1
		L[i] = 'a'
		L[i + 1] = 'b'
print(count)
print(''.join(L))


def doit(word):
	chng = 0
	temp = ''
	res = ''
	i = 0
	while i < len(word):
		if temp == word[i]:
			chng += 1
			res += 'ab'
			if i + 1 < len(word):
				i += 1
		elif temp != '' and temp == word[i]:
			res += 'ab'
			chng += 1
		elif temp != '':
			res += temp + '' + word[i]
			if i + 1 < len(word):
				i += 1
		temp = word[i]
		i += 1
	print(chng)
	print(res)

def main():
	n = input()
	word = input()
	word = word.lower()
	doit(word)
main()


n = int(input())
lista = list(map(str, input()))
cont = 0
for i in range(0, n, 2):
	if lista[i] == 'a' and lista[i + 1] == 'a':
		lista[i + 1] = 'b'
		cont += 1
	elif lista[i] == 'b' and lista[i + 1] == 'b':
		lista[i] = 'a'
		cont += 1
print(cont)
for i in lista:
	print(i, end='')


n = int(input())
s = input()
p = ''
count = 0
for i in range(n // 2):
	if s[i * 2:i * 2 + 2] != 'ab' and s[i * 2:i * 2 + 2] != 'ba':
		count += 1
		p += 'ab'
	else:
		p += s[i * 2:i * 2 + 2]
print(count)
print(p)


n = int(input())
s = input()
count = 0
ans = ''
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		count += 1
		c = 'ab'
	else:
		c = s[i] + s[i + 1]
	ans += c
print(count)
print(ans)


N = int(input())
S = list(map(str, input()))
s = 0
c = 0
sm = ''
while s < len(S):
	if (S[s] == 'a' and S[s + 1] == 'b' or (S[s] == 'b' and S[s + 1] == 'a')) == False:
		if S[s] == 'a':
			S[s] = 'b'
			sm += 'ba'
		else:
			S[s] = 'a'
			sm += 'ab'
		c += 1
	else:
		sm += S[s] + S[s + 1]
	s += 2
print(c)
print(sm)


n = int(input())
s = input()
s = list(s)
r = 2
l = 0
moves = 0
while r <= len(s):
	if s[l] != s[r - 1]:
		pass
	elif s[l] == s[r - 1] == 'a':
		s[l] = 'b'
		moves += 1
	elif s[l] == s[r - 1] == 'b':
		s[l] = 'a'
		moves += 1
	l += 2
	r += 2
print(moves)
print(''.join(s))


n = int(input())
a = list(map(lambda x: 0 if x == 'a' else 1, input()))
bal = 0
for i in range(1, n, 2):
	if a[i] == a[i - 1]:
		bal += 1
		a[i] = (a[i - 1] + 1) % 2
print(bal)
print(''.join(('a' if a[i] == 0 else 'b' for i in range(n))))


n = int(input())
string = input()
ans = 0
new_string = ''
for i in range(0, n, 2):
	if string[i:i + 2] == 'ab' or string[i:i + 2] == 'ba':
		new_string += string[i:i + 2]
	else:
		if string[i:i + 2] == 'aa':
			new_string += 'ab'
		else:
			new_string += 'ba'
		ans += 1
if ans:
	print(ans)
	print(new_string)
else:
	print(ans)
	print(string)


n = int(input())
s = list(input())
ans = 0
for i in range(0, n - 1, 2):
	first = s[i]
	sec = s[i + 1]
	if first == sec:
		ans += 1
		if first == 'b':
			s[i + 1] = 'a'
		else:
			s[i + 1] = 'b'
print(ans)
print(''.join(s))


N = int(input())
s = list(input())
num = 0
for i in range(N // 2):
	if s[2 * i] == s[2 * i + 1]:
		num += 1
		(s[2 * i], s[2 * i + 1]) = ('a', 'b')
print(num)
print(''.join(s))


(n, s, x, r) = (int(input()), input(), 0, '')
for i in range(0, n - 1, 2):
	if s[i] == s[i + 1]:
		x += 1
		r += 'ab'
	else:
		r += s[i] + s[i + 1]
print(x, r, sep='\n')


def prefix(s, n):
	s = list(s)
	a = 0
	b = 0
	c = 0
	for i in range(n):
		if i % 2 == 0:
			if s[i] == 'a':
				a += 1
			else:
				b += 1
		else:
			if s[i] == 'a':
				a += 1
			else:
				b += 1
			if a != b:
				if a > b:
					c += 1
					if s[i] == 'a':
						s[i] = 'b'
					else:
						s[i - 1] = 'b'
				else:
					c += 1
					if s[i] == 'b':
						s[i] = 'a'
					else:
						s[i - 1] = 'a'
			a = i / 2
			b = i / 2
	return [c, ''.join(s)]
n = int(input())
s = input()
z = prefix(s, n)
print(z[0])
print(z[1])


def notab(x):
	return 'b' if x == 'a' else 'a'

def main():
	input()
	s = input().strip()
	ans = 0
	res = []
	for i in range(0, len(s), 2):
		res.append(s[i])
		if s[i] == s[i + 1]:
			ans += 1
			res.append(notab(s[i + 1]))
		else:
			res.append(s[i + 1])
	print(ans)
	print(''.join(res))
main()


n = int(input())
s = list(input())
count = 0
for i in range(0, n + 1, 2):
	if s[i:i + 2] == ['a', 'a'] or s[i:i + 2] == ['b', 'b']:
		s[i:i + 2] = ['a', 'b']
		count += 1
print(count, ''.join(s), sep='\n')


n = int(input())
s = input()
c = 0
sr = ''
for x in range(0, n, 2):
	if s[x] == 'a' and s[x + 1] == 'b' or (s[x] == 'b' and s[x + 1] == 'a'):
		sr += s[x]
		sr += s[x + 1]
		continue
	sr += 'a' if s[x + 1] == 'b' else 'b'
	sr += s[x + 1]
	c += 1
print(c)
print(sr)


n = int(input())
s = list(input())
c = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		c += 1
res = ''
for i in s:
	res += i
print(c)
print(res)


import sys
import os
from io import IOBase, BytesIO
import math
import collections
mod = 10 ** 9 + 7
pie = 3.1415926536

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

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

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

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

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	lst = []
	for p in range(n + 1):
		if prime[p]:
			lst.append(p)
	return lst

def nCr(n, r):
	a = 1
	b = 1
	c = 1
	for i in range(1, n + 1):
		c *= i
	for i in range(1, r + 1):
		b *= i
	for i in range(1, n - r + 1):
		a *= i
	return c // (a * b)

def sieveOfEratosthenes1(N, s):
	prime = [False] * (N + 1)
	for i in range(2, N + 1, 2):
		s[i] = 2
	for i in range(3, N + 1, 2):
		if prime[i] == False:
			s[i] = i
			for j in range(i, int(N / i) + 1, 2):
				if prime[i * j] == False:
					prime[i * j] = True
					s[i * j] = i

def generatePrimeFactors(N):
	s = [0] * (N + 1)
	sieveOfEratosthenes1(N, s)
	curr = s[N]
	cnt = 1
	factors = []
	power = []
	while N > 1:
		N //= s[N]
		if curr == s[N]:
			cnt += 1
			continue
		factors.append(curr)
		power.append(cnt)
		curr = s[N]
		cnt = 1
	return (factors, power)

def main():
	n = int(sin())
	s = sin()
	res = list(s)
	ans = 0
	for i in range(0, n - 1, 2):
		if s[i] == s[i + 1]:
			ans += 1
			if s[i] == 'a':
				res[i] = 'b'
			else:
				res[i] = 'a'
	print(ans)
	print(*res, sep='')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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))

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


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 6 + 1
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
n = int(input())
s = '.' + input()
ans = 0
s = [i for i in s]
for i in range(2, n + 1, 2):
	if i % 2 == 0:
		if s[i] == s[i - 1]:
			if s[i] == 'a':
				s[i - 1] = 'b'
			else:
				s[i - 1] = 'a'
			ans += 1
print(ans)
print(''.join(s[1:]))


n = int(input())
s = list(input())
s1 = ''
count = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		count += 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
print(count)
print(''.join(s))


n = int(input())
s = input().strip()
z = 0
ans = 0
a = dict()
for i in range(1, n):
	if (i + 1) % 2 == 0:
		if s[i] == s[i - 1]:
			ans += 1
			if s[i] == 'a':
				a[i] = 'b'
			else:
				a[i] = 'a'
print(ans)
for i in range(len(s)):
	if i in a:
		print(a[i], end='')
	else:
		print(s[i], end='')


n = int(input())
s = str(input())
l = list(s)
count = 0
for i in range(0, n - 1, 2):
	if l[i] == 'a' and l[i + 1] == 'a':
		l[i] = 'b'
		count += 1
	elif l[i] == 'b' and l[i + 1] == 'b':
		l[i] = 'a'
		count += 1
print(count)
print(''.join(l))


n = int(input())
a = list(str(input()))
c = 0
for i in range(0, n, 2):
	if a[i] == 'a':
		if a[i + 1] == 'b':
			continue
		else:
			a[i + 1] = 'b'
			c += 1
	elif a[i + 1] == 'a':
		continue
	else:
		a[i + 1] = 'a'
		c += 1
print(c)
print(''.join(a))


le = int(input())
ans = list(input())
changes = 0
for i in range(0, le, 2):
	if ans[i] == ans[i + 1]:
		changes += 1
		if ans[i] == 'a':
			ans[i] = 'b'
		else:
			ans[i] = 'a'
print(changes)
print(''.join(ans))


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

def rints():
	return list(map(int, input().split()))
n = rint()
s = list(input())
ch = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		s[i] = 'a' if s[i + 1] == 'b' else 'b'
		ch += 1
print(ch)
print(''.join(s))


import sys
n = int(sys.stdin.readline())
string = list(sys.stdin.readline().strip())
cnt = 0
(a, b) = (0, 0)
for i in range(n):
	if i % 2 == 0:
		(a, b) = (0, 0)
	if string[i] == 'a':
		a += 1
	elif string[i] == 'b':
		b += 1
	if i % 2 != 0:
		if a == 1 and b == 1:
			pass
		elif a == 2:
			string[i] = 'b'
			cnt += 1
		elif b == 2:
			string[i] = 'a'
			cnt += 1
print(cnt)
for j in string:
	print(j, end='')


def main(n, a):
	x = n / 2
	index = 0
	map1 = {'a': 0, 'b': 0}
	while index < n:
		if a[index] == 'a':
			map1['a'] = map1['a'] + 1
		else:
			map1['b'] = map1['b'] + 1
		index = index + 1
	a = list(a)
	y = check(a, x)
	a = ''.join(map(str, a))
	return [y, a]

def check(arr, a):
	index = 0
	x = 0
	i = 0
	while x < a:
		if arr[index] == 'a':
			if arr[index + 1] == 'b':
				index = index + 2
				x = x + 1
				continue
			else:
				arr[index + 1] = 'b'
				i = i + 1
		elif arr[index] == 'b':
			if arr[index + 1] == 'a':
				index = index + 2
				x = x + 1
				continue
			else:
				arr[index + 1] = 'a'
				i = i + 1
		index = index + 2
		x = x + 1
	return i
n = int(input())
a = input()
res = main(n, a)
i = 0
q = len(res)
while i < q:
	print(res[i])
	i = i + 1


n = int(input())
s = list(input())
ca = 0
cb = 0
count = 0
for i in range(n):
	if s[i] == 'a':
		ca += 1
	if s[i] == 'b':
		cb += 1
	if i % 2 == 1:
		if ca != cb:
			count += abs(ca - (ca + cb) // 2)
			if s[i] == 'b' and ca < cb:
				s[i] = 'a'
			elif s[i] == 'b' and cb < ca:
				s[i - 1] = 'a'
			elif s[i] == 'a' and ca < cb:
				s[i - 1] = 'a'
			elif s[i] == 'a' and cb < ca:
				s[i] = 'b'
			ca = 0
			cb = 0
print(count)
print(''.join(s))


n = int(input())
st = list(input())
nst = ''
ops = 0
for i in range(0, len(st), 2):
	if st[i] + st[i + 1] == 'ab' or st[i] + st[i + 1] == 'ba':
		nst += st[i] + st[i + 1]
	elif st[i] + st[i + 1] == 'aa' or st[i] + st[i + 1] == 'bb':
		nst += 'ab'
		ops += 1
print(ops)
print(nst)


letters = int(input())
word = list(input())
total = 0
for prefix in range(int(letters / 2)):
	if word[prefix * 2] == 'a' and word[prefix * 2 + 1] == 'a':
		total = total + 1
		word[prefix * 2] = 'b'
	if word[prefix * 2] == 'b' and word[prefix * 2 + 1] == 'b':
		total = total + 1
		word[prefix * 2] = 'a'
print(total)
print(''.join(word))


n = int(input())
s = list(input())
ans = 0
opp = {'a': 'b', 'b': 'a'}
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		s[i] = opp[s[i]]
		ans += 1
print(ans)
print(''.join(s))


n = int(input())
a = input()
c = 0
a = list(a)
for i in range(0, len(a), 2):
	if a[i] == a[i + 1]:
		if a[i] == 'a':
			a[i] = 'b'
			c = c + 1
		elif a[i] == 'b':
			a[i] = 'a'
			c = c + 1
print(c)
for i in a:
	print(i, end='')


import sys
import math
n = int(input())
a = list(input())
cnt = 0
a_cnt = 0
b_cnt = 0
for i in range(n):
	if a[i] == 'a':
		a_cnt += 1
	elif a[i] == 'b':
		b_cnt += 1
	if i != 0 and i % 2 == 1:
		if a_cnt != b_cnt:
			if a[i] == 'a':
				a[i] = 'b'
				b_cnt += 1
				a_cnt -= 1
				cnt += 1
			elif a[i] == 'b':
				a[i] = 'a'
				b_cnt -= 1
				a_cnt += 1
				cnt += 1
print(cnt)
print(''.join(a))
pass


from typing import List
from math import ceil, sqrt, floor, sqrt
from collections import defaultdict, Counter, deque
from collections import defaultdict, deque
n = int(input())
s = list(input())
res = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		res += 1
		s[i] = 'a' if s[i] == 'b' else 'b'
print(res)
print(''.join(s))


a = int(input())
str = input()
answer = 0
news = ''
for i in range(0, a, 2):
	if str[i] == str[i + 1]:
		answer += 1
		news += str[i]
		if str[i] == 'a':
			news += 'b'
		else:
			news += 'a'
	else:
		news += str[i]
		news += str[i + 1]
print(answer)
print(news)


n = int(input())
s = list(input())
cnt = 0
res = ''
for i in range(0, n, 2):
	if s[i:i + 2].count('a') > s[i:i + 2].count('b'):
		res += ''.join(s[i:i + 2]).replace('a', 'b', 1)
		cnt = cnt + 1
	elif s[i:i + 2].count('a') < s[i:i + 2].count('b'):
		res += ''.join(s[i:i + 2]).replace('b', 'a', 1)
		cnt = cnt + 1
	else:
		res += ''.join(s[i:i + 2])
print(cnt)
print(res)


n = int(input())
s = input()
r = 0
s1 = ''
for i in range(n // 2):
	if s[2 * i] == s[2 * i + 1]:
		r += 1
		s1 += chr((ord(s[2 * i]) - 97 + 1) % 2 + 97) + s[2 * i + 1]
	else:
		s1 += s[2 * i] + s[2 * i + 1]
print(r)
print(s1)


n = int(input())
arr = list(input())
count = 0
for i in range(0, n, 2):
	if i != n - 1:
		if arr[i] == arr[i + 1]:
			count += 1
			arr[i] = 'a'
			arr[i + 1] = 'b'
print(count)
print(''.join(map(str, arr)))


n = int(input())
s = input()
r = []
(x, y) = (0, 0)
for i in range(n):
	r.append(s[i])
	if s[i] == 'a':
		x += 1
	else:
		x -= 1
	if i % 2 == 1:
		if x == 2:
			y += 1
			r.pop()
			r.append('b')
		elif x == -2:
			y += 1
			r.pop()
			r.append('a')
		x = 0
print(y)
print(''.join(r))


length = int(input())
s = str(input())
counter = 0
string = []
string.extend(s)
for i in range(0, len(string) - 1, 2):
	if string[i] == string[i + 1]:
		if string[i] == 'a':
			string[i] = 'b'
			counter += 1
		elif string[i] == 'b':
			string[i] = 'a'
			counter += 1
		else:
			pass
print(counter)
for j in string:
	print(j, end='')


n = int(input())
a = input()
k = 0
b = ''
for i in range(0, n, 2):
	if a[i] == 'a' and a[i + 1] == 'a' or (a[i] == 'b' and a[i + 1] == 'b'):
		b += 'ab'
		k += 1
	else:
		b += a[i] + a[i + 1]
print(k)
print(b)


n = int(input())
s = [i for i in input()]
temp = ''
ans = 0
for (i, j) in enumerate(s):
	if i % 2:
		if temp == 'a':
			if j == 'a':
				ans += 1
			s[i] = 'b'
		else:
			if j == 'b':
				ans += 1
			s[i] = 'a'
	else:
		temp = j
print(ans)
print(''.join(s))


input()
s = input()
n = 0
result = []
for i in range(0, len(s), 2):
	if s[i] != s[i + 1]:
		result.extend(s[i:i + 2])
		continue
	result.append(s[i])
	n += 1
	if s[i] == 'a':
		result.append('b')
	else:
		result.append('a')
print(n)
print(''.join(result))


size = int(input())
inChar = list(input())
opNumber = 0
for i in range(0, len(inChar), 2):
	if inChar[i] == inChar[i + 1]:
		opNumber += 1
		if inChar[i] == 'a':
			inChar[i] = 'b'
		else:
			inChar[i] = 'a'
print(opNumber)
print(''.join(inChar))


n = int(input())
a = input()
ans = 0
lol = ''
for i in range(1, n, 2):
	if a[i] == a[i - 1]:
		ans += 1
		lol += 'ab'
	else:
		lol += a[i - 1] + a[i]
print(ans)
print(lol)


n = int(input())
s = list(input())
ans = 0
for i in range(1, n + 1, 2):
	if s[i] == 'a' and s[i - 1] == 'a':
		ans += 1
		s[i] = 'b'
	elif s[i] == 'b' and s[i - 1] == 'b':
		ans += 1
		s[i] = 'a'
print(ans)
for i in range(len(s)):
	print(s[i], end='')


from sys import stdin, stdout
import math
n = int(stdin.readline())
s = list(stdin.readline())
l = 0
r = 1
ans = 0
while r < n:
	if s[l] == s[r]:
		ans += 1
		if s[l] == 'a':
			s[l] = 'b'
		else:
			s[l] = 'a'
	l += 2
	r += 2
print(ans)
print(''.join(s))


a = int(input())
letters = input()
count = 0
k = list(letters)
for i in range(0, a - 1, 2):
	if k[i] == k[i + 1] == 'a':
		count += 1
		k[i + 1] = 'b'
	elif k[i] == k[i + 1] == 'b':
		count += 1
		k[i + 1] = 'a'
print(count)
kk = ''.join([str(elem) for elem in k])
print(kk)


n = int(input())
s = list(input())
count = 0
for i in range(0, len(s) - 1, 2):
	if s[i] == s[i + 1] == 'b':
		s[i] = 'a'
		count += 1
	elif s[i] == s[i + 1] == 'a':
		s[i] = 'b'
		count += 1
print(count)
print(*s, sep='')


n = int(input())
d = list(input())
di = {'a': 'b', 'b': 'a'}
x = 0
for i in range(0, n, 2):
	if d[i] == d[i + 1]:
		d[i] = di[d[i]]
		x += 1
print(x)
print(*d, sep='')


n = int(input())
s = input()
c = list(s)
i = 0
wyn = 0
while i < n:
	if c[i] == c[i + 1]:
		if c[i + 1] == 'a':
			c[i + 1] = 'b'
		else:
			c[i + 1] = 'a'
		wyn += 1
	i += 2
print(wyn)
for i in c:
	print(i, end='')


n = int(input())
s = [*input()]
ans = 0
for i in range(0, n, 2):
	if s[i] + s[i + 1] in ['ab', 'ba']:
		continue
	if s[i] + s[i + 1] == 'aa':
		s[i] = 'b'
	else:
		s[i] = 'a'
	ans += 1
print(ans, ''.join(s), sep='\n')


n = int(input())
s = list(input())
i = -1
cnt = 0
while i != n - 1:
	i += 2
	if s[i - 1] == 'a' and s[i] == 'a':
		s[i] = 'b'
		cnt += 1
	elif s[i - 1] == 'b' and s[i] == 'b':
		s[i] = 'a'
		cnt += 1
print(cnt)
print(''.join(s))


n = int(input())
x = input()
i = 0
count = 0
s = list(x)
while i != n:
	if s[i] == s[i + 1]:
		count += 1
		s[i] = 'a'
		s[i + 1] = 'b'
	i += 2
str = ''
for ele in s:
	str += ele
print(count)
print(str)


a = int(input())
b = list(input())
k = 0
for x in range(0, a, 2):
	if b[x] == b[x + 1]:
		if b[x] == 'a':
			b[x] = 'b'
		else:
			b[x] = 'a'
		k += 1
print(k)
print(''.join(b))


import collections, heapq, bisect, math

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

def solve(s, n):
	count = 0
	out = []
	for i in range(0, len(s), 2):
		if s[i:i + 2] == 'aa':
			out.append('ab')
			count += 1
		elif s[i:i + 2] == 'bb':
			out.append('ab')
			count += 1
		else:
			out.append(s[i:i + 2])
	print(count)
	print(''.join(out))
q = 1
tests = []
for test in range(1):
	n = input()
	s = input()
solve(s, n)


from sys import stdin, stdout
for _ in range(1):
	n = int(stdin.readline())
	s = list(input())
	a = b = 0
	ans = 0
	for i in range(n):
		if s[i] == 'a':
			a += 1
		else:
			b += 1
		if i & 1:
			if a > b:
				s[i] = 'b'
				b += 1
				a -= 1
				ans += 1
			elif b > a:
				s[i] = 'a'
				a += 1
				b -= 1
				ans += 1
	print(ans)
	print(''.join(s))


input()
s = input()
r = 0
t = ''
for i in range(0, len(s), 2):
	f = s[i] == s[i + 1]
	r += f
	t += (s[i:i + 2], 'ab')[f]
print(r)
print(t)


n = int(input())
x = list(input())
operation = 0
for i in range(0, n, 2):
	if x[i] == x[i + 1]:
		if x[i] == 'a':
			x[i] = 'b'
			operation += 1
		else:
			x[i] = 'a'
			operation += 1
print(operation)
print(''.join(x))


n = int(input())
s = input()
i = 0
count = 0
res = ''
while i < n:
	if s[i] == 'a' and s[i + 1] == 'a':
		res += 'ba'
		count += 1
	elif s[i] == 'b' and s[i + 1] == 'b':
		res += 'ab'
		count += 1
	else:
		res += s[i] + s[i + 1]
	i += 2
print(count)
print(res)


n = int(input())
s = input()
res = []
swap = {'a': 'b', 'b': 'a'}
ctr = 0
for i in range(0, n, 2):
	if s[i] != s[i + 1]:
		res.append(s[i:i + 2])
	else:
		ctr += 1
		res.append(swap[s[i]])
		res.append(s[i + 1])
print(ctr)
print(''.join(res))


def arr():
	return list(map(int, input().split()))
n = int(input())
s = input()
i = 0
step = 0
l = []
while i < len(s):
	l.append(s[i])
	if s[i] == 'a':
		if s[i + 1] == 'b':
			pass
		else:
			step += 1
		l.append('b')
	elif s[i] == 'b':
		if s[i + 1] == 'a':
			pass
		else:
			step += 1
		l.append('a')
	i += 2
print(step)
print(''.join(l))


n = int(input())
x = input()
ans = 0
f = ''
for j in range(1, n, 2):
	curr = x[j - 1:j + 1]
	if curr == 'aa' or curr == 'bb':
		ans += 1
		f += 'ab'
	else:
		f += curr
print(ans)
print(f)


n = int(input())
s = input()
ct = 0
s = list(s)
for i in range(0, n, 2):
	if s[i] != s[i + 1]:
		pass
	else:
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		ct += 1
str1 = ''
print(ct)
print(str1.join(s))


n = int(input())
s = input()
l = []
c = 0
for i in range(0, n, 2):
	x = s[i:i + 2]
	if x == 'aa' or x == 'bb':
		x = 'ab'
		c += 1
	l.append(x)
print(c)
for i in l:
	print(i, end='')
print()


n = int(input())
s = input()
t = ''
op = {'a': 'b', 'b': 'a'}
ans = 0
for i in range(n // 2):
	if s[2 * i] == s[2 * i + 1]:
		ans += 1
	t += s[2 * i]
	t += op[s[2 * i]]
print(ans)
print(t)


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

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

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

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

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

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007

def solve():
	t = 1
	for tt in range(t):
		n = nu()
		s = list(input())
		xp = ''
		cc = 0
		for i in range(0, n, 2):
			if s[i] == s[i + 1]:
				cc += 1
				if s[i] == 'a':
					s[i + 1] = 'b'
				else:
					s[i + 1] = 'a'
		print(cc)
		print(*s, sep='')
solve()


import sys
str_len = int(sys.stdin.readline())
input_str = list(sys.stdin.readline())
count = 0
x = 0
while x < str_len - 1:
	if input_str[x] == 'a' and input_str[x + 1] == 'a':
		input_str[x] = 'b'
		count += 1
	elif input_str[x] == 'b' and input_str[x + 1] == 'b':
		input_str[x] = 'a'
		count += 1
	x += 2
print(count)
print(''.join(input_str))


L = int(input())
s = list(input())
final = ''
counter = 0
ind = 0
for x in range(int(L / 2)):
	if s[ind] == s[ind + 1]:
		if s[ind] == 'a':
			s[ind] = 'b'
		else:
			s[ind] = 'a'
		counter += 1
	ind += 2
print(counter)
print(''.join(s))


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

def split_str(s):
	return [ch for ch in s]
l = split_str(s)
n = 0
for i in range(0, t, 2):
	if ord(l[i]) + ord(l[i + 1]) != 195:
		l[i] = 'a'
		l[i + 1] = 'b'
		n = n + 1

def convert(s):
	new = ''
	for x in s:
		new += x
	return new
print(n)
print(convert(l))


n = int(input())
s = input()
c = 0
o = list(s)
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			c += 1
			o[i] = 'a'
			o[i + 1] = 'b'
		else:
			c += 1
			o[i] = 'b'
			o[i + 1] = 'a'
print(c)
for x in o:
	print(x, end='')


import math
from collections import *
import sys
from functools import reduce

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

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
DIRECTIONS = [[0, 1], [0, -1], [1, 0], [1, -1]]
NEIGHBOURS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i != 0 or j != 0]
OrdUnicode_a = ord('a')
OrdUnicode_A = ord('A')
CAPS_ALPHABETS = {chr(i + OrdUnicode_A): i for i in range(26)}
SMOL_ALPHABETS = {chr(i + OrdUnicode_a): i for i in range(26)}
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0) + 1
INFINITY = float('inf')
N = int(input())
ans = 0
li = list(input())
for i in range(N // 2):
	if li[2 * i] == li[2 * i + 1]:
		if li[2 * i] == 'a':
			li[2 * i] = 'b'
		else:
			li[2 * i] = 'a'
		ans += 1
print(ans)
print(''.join(li))


t = int(input())
b = input()
a = list(b)
c = 0
for i in range(t):
	if i % 2 == 0:
		if a[i] == a[i + 1]:
			if a[i] == 'a':
				a[i] = 'b'
				c = c + 1
			else:
				a[i] = 'a'
				c = c + 1
s = ''
print(c)
print(s.join(a))


size = int(input())
s = list(input())

def change(char):
	if char == 'a':
		return 'b'
	else:
		return 'a'
count = 0
for i in range(0, size, 2):
	if s[i] == s[i + 1]:
		s[i] = change(s[i])
		count += 1
print(count)
for char in s:
	print(char, end='')


input()
smth = list(input())
cnt = 0
for i in range(len(smth) // 2):
	if smth[i * 2] == smth[i * 2 + 1]:
		cnt += 1
		if smth[i * 2] == 'a':
			smth[i * 2] = 'b'
		else:
			smth[i * 2] = 'a'
smth = ''.join(smth)
print(cnt)
print(smth)


import os
import sys
from io import BytesIO, IOBase

def solution(n, s):
	res = sum((1 for i in range(0, n - 1, 2) if s[i:i + 2] != 'ab' and s[i:i + 2] != 'ba'))
	res_s = ['ab' if s[i:i + 2] != 'ab' and s[i:i + 2] != 'ba' else s[i:i + 2] for i in range(0, n - 1, 2)]
	write(res)
	write(''.join(res_s))

def main():
	n = r_int()
	s = input()
	solution(n, s)
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))

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

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


from sys import stdin, stdout

def main():
	str_length = int(stdin.readline().strip())
	text = list(stdin.readline().strip())
	counter = 0
	for i in range(0, str_length, 2):
		if text[i] == text[i + 1]:
			old_text_i = text[i]
			text[i] = 'a' if text[i + 1] == 'b' else 'b'
			counter += 1 if text[i] != old_text_i else 0
	stdout.write('%d\n' % counter)
	stdout.write('%s\n' % ''.join(text))
main()


def swap(i):
	if i == 'a':
		return 'b'
	else:
		return 'a'
n = int(input())
s = list(input())
ans = 0
prev = 0
news = ''
for l in range(1, n, 2):
	sub = s[prev:l + 1]
	if sub.count('a') != 1:
		ans += 1
		sub[0] = swap(sub[0])
	news += ''.join(sub)
	prev = l + 1
print(ans)
print(news)


import sys
n = int(input())
s = list(input())
conto = 0
for x in range(n):
	if s[x] == s[x - 1]:
		if x % 2 != 0:
			if s[x] == 'b':
				s[x - 1] = 'a'
				conto += 1
			else:
				s[x - 1] = 'b'
				conto += 1
print(conto)
for x in range(n):
	print(s[x], end='')


elem = int(input())
string = input()
ar = []
for x in range(len(string)):
	ar.append(string[x])
first = 'a'
second = 'a'
count = 0
new_ar = []
for x in range(len(ar)):
	if x % 2 == 0:
		first = ar[x]
		second = ar[x + 1]
		if first != second:
			new_ar.append(first)
			new_ar.append(second)
		else:
			count = count + 1
			new_ar.append('a')
			new_ar.append('b')
print(count)
print(''.join((str(i) for i in new_ar)))


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
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 graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

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

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

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

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

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

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

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

def bs(a, l, h, x):
	while l < h:
		mid = (l + h) // 2
		if a[mid] == x:
			return mid
		if a[mid] < x:
			l = mid + 1
		else:
			h = mid
	return l

def sieve(a):
	for i in range(3, 10 ** 6 + 1, 2):
		a[i] = 1
	for i in range(3, 10 ** 6 + 1, 2):
		for j in range(i * i, 10 ** 6 + 1, i):
			a[j] = 0
	a[2] = 1
	return a

def bfs(g, st):
	visited = [0] * len(g)
	visited[st] = 1
	queue = []
	queue.append(st)
	new = []
	while len(queue) != 0:
		s = queue.pop()
		new.append(s)
		for i in g[s]:
			if visited[i] == 0:
				visited[i] = 1
				queue.append(i)
	return new

def solve():
	n = int(inp())
	s = inp()
	cnta = 0
	cntb = 0
	ans = 0
	pre = []
	for i in range(1, n, 2):
		new = s[i - 1:i + 1]
		if new == 'aa' or new == 'bb':
			pre.append('ab')
			ans += 1
		else:
			pre.append(new)
	print(ans)
	print(''.join(pre))
testcase(1)


n = int(input())
li = list(input())
co = 0
for i in range(0, n, 2):
	if li[i] == 'a' and li[i + 1] == 'b' or (li[i] == 'b' and li[i + 1] == 'a'):
		continue
	else:
		co += 1
		if li[i] == 'a':
			li[i] = 'b'
		else:
			li[i] = 'a'
print(co)
print(*li, sep='')


def moves(s, n):
	ctr = 0
	for i in range(0, n, 2):
		if s[i] == s[i + 1]:
			ctr += 1
	print(ctr)

def new_string(s, n):
	s_1 = ''
	for i in range(0, n, 2):
		if s[i:i + 2] == 'ab' or s[i:i + 2] == 'ba':
			s_1 = s_1 + s[i:i + 2]
		else:
			s_1 = s_1 + 'ab'
	print(s_1)
n = input()
n = int(n)
s = input()
moves(s, n)
new_string(s, n)


(a, s) = (int(input()), list(input()))
summ = 0
for i in range(0, a, 2):
	if s[i:i + 2] != ['a', 'b'] and s[i:i + 2] != ['b', 'a']:
		summ += 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
print(summ)
print(*s, sep='')


n = int(input())
s = list(input())
count = 0
for i in range(0, n, 2):
	if i != n - 1 and s[i] == s[i + 1]:
		count += 1
		s[i] = 'b' if s[i] is 'a' else 'a'
print(count, ''.join(s), sep='\n')


length = int(input())
s = input()
ops = 0
final = ''
for i in range(0, len(s), 2):
	spfix = s[i:i + 2]
	acount = spfix.count('a')
	bcount = spfix.count('b')
	if acount > bcount:
		ops = ops + 1
		spfix = spfix.replace('a', 'b', 1)
	elif bcount > acount:
		ops = ops + 1
		spfix = spfix.replace('b', 'a', 1)
	final = final + spfix
print(int(ops))
print(final)


n = int(input())
s = input()
ch = []
dem = 0
for i in range(0, n - 1, 2):
	if s[i] != s[i + 1]:
		ch.append(s[i])
		ch.append(s[i + 1])
	else:
		dem = dem + 1
		ch.append('a')
		ch.append('b')
print(dem)
delim = ''
print(delim.join(ch))


N = int(input())
S = input()
S1 = ''
c = 0
for i in range(0, N, 2):
	if S[i] == 'a':
		S1 = S1 + 'a'
		if S[i + 1] != 'b':
			c = c + 1
		S1 = S1 + 'b'
	else:
		S1 = S1 + 'b'
		if S[i + 1] != 'a':
			c = c + 1
		S1 = S1 + 'a'
print(c)
print(S1)


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

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

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

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

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

def string_list():
	return list(input())

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

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	n = int(input())
	s = list(input())
	cost = 0
	for i in range(1, n, 2):
		temp = s[i - 1] + s[i]
		if temp == 'ba' or temp == 'ab':
			continue
		else:
			cost += 1
			if temp == 'bb':
				s[i] = 'a'
			else:
				s[i] = 'b'
	print(cost)
	print(''.join(s))
t = 1
for _ in range(t):
	solve()


n = int(input())
s = list(input())
i = 0
count = 0
while i < n:
	j = i + 1
	if s[i] == 'a' and s[j] == 'b' or (s[i] == 'b' and s[j] == 'a'):
		pass
	elif s[i] == 'a' and s[j] == 'a':
		count += 1
		s[i] = 'b'
	else:
		count += 1
		s[i] = 'a'
	i = j + 1
print(count)
print(''.join(s))


n = int(input())
s = input()
str = []
(numa, numb, ans) = (0, 0, 0)
for i in range(n):
	if s[i] == 'a':
		numa += 1
	else:
		numb += 1
	if i % 2 == 0:
		str.append(s[i])
		continue
	if numa != numb:
		ans += 1
		if numa > numb:
			numa -= 1
			numb += 1
			str.append('b')
		else:
			numa += 1
			numb -= 1
			str.append('a')
	else:
		str.append(s[i])
print(ans)
for ch in str:
	print(ch, end='')


_ = input()
s = input().strip()
total = 0
a = 0
b = 0
changes = 0
finstr = []
for c in s:
	if c == 'a':
		a += 1
	else:
		b += 1
	finstr.append(c)
	total += 1
	if total % 2 == 0:
		chg = a - b
		changes += abs(chg) // 2
		if chg > 0:
			finstr[total - 2 + finstr[total - 2:total].index('a')] = 'b'
			b += 1
			a -= 1
		elif chg < 0:
			finstr[total - 2 + finstr[total - 2:total].index('b')] = 'a'
			a += 1
			b -= 1
print(changes)
print(''.join(finstr))


def rev(q):
	if q == 'a':
		return 'b'
	else:
		return 'a'
n = int(input())
s = list(input())
k = 0
p = ''
for i in range(0, n, 2):
	p += s[i]
	if p[-1] == s[i + 1]:
		k += 1
		p += rev(s[i + 1])
	else:
		p += s[i + 1]
print(k)
print(p)


n = int(input())
l = list(input())
s = []
c = 0
for i in range(0, n - 1, 2):
	if l[i] == 'a' and l[i + 1] != 'b':
		c += 1
		s.append('a')
		s.append('b')
	if l[i] == 'b' and l[i + 1] != 'a':
		c += 1
		s.append('b')
		s.append('a')
	if l[i] == 'a' and l[i + 1] == 'b':
		s.append('a')
		s.append('b')
	if l[i] == 'b' and l[i + 1] == 'a':
		s.append('b')
		s.append('a')
print(c)
if c == 0:
	for i in l:
		print(i, end='')
else:
	for i in s:
		print(i, end='')


n = int(input())
s = input()
(str1, c) = ('', 0)
for i in range(0, n, 2):
	if s[i + 1] == s[i]:
		if s[i + 1] == 'a':
			str1 += 'ab'
			c += 1
		else:
			str1 += 'ba'
			c += 1
	else:
		str1 += s[i] + s[i + 1]
print(c)
if str1 == '':
	print(s)
else:
	print(str1)


n = int(input())
s = input()
c = 0
ns = []
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'a' or (s[i] == 'b' and s[i + 1] == 'b'):
		ns.append('ab')
		c += 1
	else:
		ns.append(s[i] + s[i + 1])
print(c)
print(''.join(ns))


import sys
line = sys.stdin.readline().rstrip()
n = int(line)
s = list(sys.stdin.readline().rstrip())
c = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		c += 1
		s[i] = 'a'
		s[i + 1] = 'b'
print(c)
print(''.join(s))


n = int(input())
s = list(input())
(i, count) = (1, 0)
while i < n:
	if s[i] == s[i - 1] == 'a':
		s[i] = 'b'
		count += 1
	elif s[i] == s[i - 1] == 'b':
		s[i] = 'a'
		count += 1
	i += 2
print(count)
print(*s, sep='')


from collections import Counter

def main():
	l = int(input())
	ss = input()
	rr = []
	count = 0
	for i in range(0, l, 2):
		s1 = ss[i]
		rr.append(s1)
		rr.append('b' if s1 == 'a' else 'a')
		if ss[i + 1] != rr[i + 1]:
			count += 1
	print(count)
	print(''.join(rr))
main()


n = int(input())
s = list(input())
c = 0
for i in range(len(s) // 2):
	c1 = s[i * 2]
	c2 = s[i * 2 + 1]
	if c1 == c2:
		c += 1
		if c1 == 'a':
			s[i * 2] = 'b'
		else:
			s[i * 2] = 'a'
print(c)
print(''.join(s))


n = int(input())
s = str(input())
sl = list(s)
ns = str()
ctr = 0
for i in range(int(n / 2)):
	if sl[2 * i] == sl[2 * i + 1]:
		if sl[2 * i] == 'a':
			sl[2 * i] = 'b'
		else:
			sl[2 * i] = 'a'
		ctr += 1
for i in range(len(sl)):
	ns = ns + sl[i]
print(ctr)
print(ns)


def solve(test):
	n = int(input())
	ans = 0
	s = list(input())
	for i in range(0, n, 2):
		if s[i] == s[i + 1]:
			ans += 1
			if s[i] == 'a':
				s[i] = 'b'
			else:
				s[i] = 'a'
	print(ans)
	print(''.join(s))
t = 1
for _ in range(t):
	solve(_ + 1)


input()
s = input()
p = 0
q = ''
for i in range(0, len(s), 2):
	f = s[i] == s[i + 1]
	p += f
	q += (s[i:i + 2], 'ab')[f]
print(p)
print(q)


n = int(input())
s = str(input())
c = [0] * (n + 1)
ans = 0
l = []
for i in range(n):
	if s[i] == 'a':
		c[i + 1] = c[i] + 1
	else:
		c[i + 1] = c[i] - 1
	if i % 2 == 1:
		if c[i + 1] > 0:
			l.append('b')
			ans += 1
			c[i + 1] = 0
		elif c[i + 1] < 0:
			l.append('a')
			ans += 1
			c[i + 1] = 0
		else:
			l.append(s[i])
	else:
		l.append(s[i])
print(ans)
print(''.join(l))


n = int(input())
s = input()
l = []
for i in s:
	l.append(i)
i = 0
t = 0
while i < n:
	if l[i] == 'a' and l[i + 1] == 'a':
		l[i] = 'b'
		t += 1
	if l[i] == 'b' and l[i + 1] == 'b':
		l[i] = 'a'
		t += 1
	i += 2
a = ''.join(l)
print(t)
print(a)


gi = lambda : list(map(int, input().split()))
(n,) = gi()
s = input()
ans = 0
ss = []
for k in range(0, n, 2):
	ss.append(s[k])
	if s[k] == s[k + 1]:
		ans += 1
		ss.append('a' if s[k] == 'b' else 'b')
	else:
		ss.append(s[k + 1])
print(ans)
print(''.join(ss))


n = int(input())
s = list(map(str, input()))
c = 0
for i in range(2, len(s) + 1, 2):
	a = 0
	b = 0
	for j in range(i - 2, i):
		if s[j] == 'a':
			a += 1
		else:
			b += 1
	if a == b:
		continue
	elif a > b:
		if s[i - 2] == 'a':
			s[i - 2] = 'b'
			c += 1
		else:
			s[i - 1] = 'b'
			c += 1
	elif s[i - 2] == 'b':
		s[i - 2] = 'a'
		c += 1
	else:
		s[i - 1] = 'a'
		c += 1
print(c)
for i in s:
	print(i, end='')


n = int(input())
s = input()
count = 0
news = ''
for i in range(0, n - 1, 2):
	ss = s[i:i + 2]
	if ss == 'aa':
		count += 1
		news += 'ab'
	elif ss == 'bb':
		count += 1
		news += 'ab'
	else:
		news += ss
print(count)
print(news)


n = int(input())
string = list(input())
count = 0
for i in range(0, n, 2):
	if ''.join(string[i:i + 2]) == 'ab' or ''.join(string[i:i + 2]) == 'ba':
		continue
	else:
		if ''.join(string[i:i + 2]) == 'aa':
			string[i] = 'b'
		elif ''.join(string[i:i + 2]) == 'bb':
			string[i] = 'a'
		count += 1
print(count)
print(''.join(string))


T = int(input())
t = ''
S = list(map(str, input()))
s = 0
c = 0
d = ''
while s < len(S):
	if (S[s] == 'a' and S[s + 1] == 'b' or (S[s] == 'b' and S[s + 1] == 'a')) == False:
		if S[s] == 'a':
			S[s] = 'b'
			d += 'ba'
		else:
			S[s] = 'a'
			d += 'ab'
		c += 1
	else:
		d += S[s] + S[s + 1]
	s += 2
print(c)
print(d)


n = int(input())
str1 = list(input())
count = 0
for i in range(0, len(str1) - 1, 2):
	if str1[i] == str1[i + 1]:
		count += 1
		if str1[i] == 'a':
			str1[i] = 'b'
		else:
			str1[i] = 'a'
print(count)
print(''.join(str1))


n = int(input())
s = input()
r = ''
count = 0
for i in range(n // 2):
	x = s[2 * i:2 * (i + 1)]
	if x == 'aa' or x == 'bb':
		count += 1
		r += 'ab'
	else:
		r += x
print(count)
print(r)


n = int(input())
s = input()
count = 0
out = []
for i in range(0, n, 2):
	s2 = s[i:i + 2]
	if s2 == 'ab' or s2 == 'ba':
		out.append(s2)
	else:
		count += 1
		out.append('ab')
print(count)
print(''.join(out))


x = int(input())
a = list(input())
i = 1
b = 0
while i < x:
	if a[i] == a[i - 1]:
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
		b += 1
	i += 2
print(b)
print(''.join(a))


n = int(input())
a = list(input())
b = 0
c = 0
d = 0
for i in range(len(a)):
	if a[i] == 'b':
		b += 1
		if (i + 1) % 2 == 0:
			if b != c:
				a[i] = 'a'
				d += 1
				c += 1
				b -= 1
	else:
		c += 1
		if (i + 1) % 2 == 0:
			if b != c:
				a[i] = 'b'
				d += 1
				b += 1
				c -= 1
print(d)
e = ''.join((str(elem) for elem in a))
print(e)


n = int(input())
s = str(input())
k = 0
new = ''
for i in range(0, n - 1, 2):
	if s[i:i + 2] == 'ab':
		new += 'ab'
		continue
	if s[i:i + 2] == 'ba':
		new += 'ba'
		continue
	else:
		k += 1
		new += 'ab'
print(k)
print(new)


a = int(input())
l = input()
s = list(l)
count1 = 0
for i in range(0, len(s) - 1, 2):
	if s[i] == 'b' and s[i + 1] == 'b':
		s[i + 1] = 'a'
		count1 += 1
	elif s[i] == 'a' and s[i + 1] == 'a':
		s[i + 1] = 'b'
		count1 += 1
print(count1)
s1 = ''.join(s)
print(s1)


n = int(input())
s = list(input())
r = 0
c = 0
for i in range(len(s)):
	if s[i] == 'a':
		c += 1
	else:
		c -= 1
	if i % 2 == 1:
		if c == 2:
			s[i] = 'b'
			r += 1
		elif c == -2:
			s[i] = 'a'
			r += 1
		c = 0
print(r)
print(''.join(s))


input()
s = list(input())
counter = 0
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		counter += 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
print(counter)
print(*s, sep='')


def prefix(s):
	ctr = 0
	l = []
	for i in range(2, len(s) + 1, 2):
		s1 = s[i - 2:i]
		a = s1.count('a')
		b = s1.count('b')
		if a != b:
			ctr += 1
			if a > b:
				l.append(s1.replace('a', 'b', 1))
			else:
				l.append(s1.replace('b', 'a', 1))
		else:
			l.append(s1)
	print(ctr)
	print(''.join(l))
n = int(input())
s = input()
prefix(s)


n = int(input())
s = input()
l = list(s)
c1 = c2 = 0
q = 0
s1 = ''
k = ''
for i in range(n):
	if l[i] == 'a':
		c1 += 1
	if l[i] == 'b':
		c2 += 1
	k += l[i]
	if (i + 1) % 2 == 0:
		if c1 == c2:
			s1 += k
		else:
			s1 += 'ab'
			q += 1
		k = ''
		c1 = c2 = 0
print(q)
print(s1)


def alphaNum(x):
	if x == 'a':
		return -1
	return 1

def numAlpha(x):
	if x == -1:
		return 'a'
	return 'b'
n = int(input())
s = list(map(alphaNum, list(input())))
k = 0
l = 0
for i in range(0, n, 2):
	l = s[i] + s[i + 1]
	if l != 0:
		if s[i + 1] == 1:
			s[i + 1] = -1
		else:
			s[i + 1] = 1
		k += 1
s = list(map(numAlpha, s))
print(k)
for i in range(n):
	print(s[i], end='')


n = int(input())
s = input()
(c, k) = (0, '')
for i in range(0, len(s), 2):
	if s[i] == 'a' and s[i + 1] == 'b':
		k = k + s[i] + s[i + 1]
	elif s[i] == 'b' and s[i + 1] == 'a':
		k = k + s[i] + s[i + 1]
	elif s[i] == 'b':
		k = k + s[i] + 'a'
		c = c + 1
	else:
		k = k + s[i] + 'b'
		c = c + 1
print(c)
print(k)


n = int(input())
v = input()
l = list(v)
i = 0
count = 0
while i < n:
	if l[i] == 'a' and l[i + 1] == 'a':
		l[i] = 'b'
		count = count + 1
	elif l[i] == 'b' and l[i + 1] == 'b':
		l[i] = 'a'
		count = count + 1
	i = i + 2
print(count)
print(''.join(l))


t = int(input())
s = input()
scale = 2
op = 0
new = ''
while scale <= t:
	sca = s[scale - 2:scale]
	if sca == 'ab' or sca == 'ba':
		new += sca
	elif sca == 'aa':
		op += 1
		new += 'ab'
	else:
		op += 1
		new += 'ab'
	scale += 2
print(op)
print(new)


n = int(input())
s = list(input())
ans = 0
i = 0
while i < n:
	if s[i] == s[i + 1] and s[i] == 'a':
		s[i] = 'b'
		ans += 1
	elif s[i] == s[i + 1] and s[i] == 'b':
		s[i] = 'a'
		ans += 1
	else:
		pass
	i += 2
print(ans)
print(''.join(s))


n = int(input())
s = input()
r = 0
n = int(n / 2)
res = ''
for i in range(n):
	if s[i * 2] == s[i * 2 + 1]:
		res += 'ab'
		r += 1
	else:
		res += s[i * 2:i * 2 + 2]
print(r)
print(res)


l = input()
s = list(input())
e = enumerate(['a', 'b'])
count = 0
for i in range(int(l) // 2):
	if s[2 * i] == s[2 * i + 1]:
		count += 1
		if s[2 * i] == 'a':
			s[2 * i] = 'b'
		else:
			s[2 * i] = 'a'
print(count)
print(''.join(s))


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	n = read_int()
	A = list(input())
	count = 0
	for i in range(1, n, 2):
		if A[i] == A[i - 1]:
			(A[i], A[i - 1]) = ('a', 'b')
			count += 1
	print(count)
	print(''.join(A))

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
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')

def read_int():
	return int(input())

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

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

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

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


def f(c):
	if c == 'a':
		return 'b'
	return 'a'
n = int(input())
s = input()
ans = ['a'] * n
d = 0
(ac, bc) = (0, 0)
i = 0
while i < n:
	if s[i] != s[i + 1]:
		ans[i] = s[i]
		ans[i + 1] = s[i + 1]
	else:
		d += 1
		ans[i] = s[i]
		ans[i + 1] = f(s[i])
	i += 2
print(d)
for i in ans:
	print(i, end='')
print()


counta = 0
counb = 0
n = int(input())
s = input().rstrip()
count = 0
p = dict()
s = [i for i in s]
for i in range(1, n, 2):
	if s[i] == s[i - 1]:
		if s[i] == 'a':
			s[i - 1] = 'b'
			count += 1
		else:
			s[i - 1] = 'a'
			count += 1
print(count)
print(''.join(s))


def A():
	new_string = ''
	length = int(input())
	string = input()
	am_of_operations = 0
	dct = dict()
	dct['a'] = 'b'
	dct['b'] = 'a'
	for i in range(0, len(string), 2):
		if string[i] == string[i + 1]:
			am_of_operations += 1
			new_string += string[i] + dct[string[i]]
		else:
			new_string += string[i:i + 2]
	print(am_of_operations)
	print(new_string)
A()


n = int(input())
s = input()
lst = list(s)
count = 0
i = 0
while i < n:
	if lst[i] == lst[i + 1]:
		count += 1
		lst[i:i + 2] = 'ab'
	i += 2
st = ''.join(lst)
print(count)
print(st)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
lst = list(get_string())
count = 0
for i in range(0, n, 2):
	if lst[i] == lst[i + 1]:
		if lst[i] == 'a':
			lst[i] = 'b'
			count += 1
		else:
			lst[i] = 'a'
			count += 1
print(count)
print(''.join(lst))


n = int(input())
a = input()
s = list(a)
cnt = 0
i = 0
while i < n - 1:
	if s[i] == s[i + 1]:
		cnt += 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
	i += 2
print(cnt)
print(''.join(s))


n = int(input())
s = input()
i = 1
x = 0
s1 = ''
while i < n:
	if s[i - 1] + s[i] == 'aa':
		s1 += 'ab'
		x += 1
	elif s[i - 1] + s[i] == 'bb':
		s1 += 'ab'
		x += 1
	else:
		s1 += s[i - 1] + s[i]
	i += 2
print(x)
print(s1)


n = int(input())
s = input()
inverse = {'a': 'b', 'b': 'a'}
ans_num = 0
ans_string = ''
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		ans_num += 1
	ans_string += s[i] + inverse[s[i]]
print(ans_num)
print(ans_string)


n = int(input())
s = input()
S = ['a'] * n
for j in range(n):
	S[j] = s[j]
count = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		count += 1
		if s[i] == 'a':
			S[i] = 'b'
		else:
			S[i] = 'a'
print(count)
for k in range(n):
	print(S[k], end='')
print('')


N = int(input())
s = input()
(x, r) = (0, [])
for i in range(1, N, 2):
	if s[i - 1] == s[i]:
		r.extend(['a', 'b'])
		x += 1
		continue
	r.extend(s[i - 1:i + 1])
print(x)
print(''.join(r))


n = int(input())
string = input()
count = 0
initial = None
result = ''
for i in range(n):
	if i == 0:
		initial = string[i]
		result = initial
	elif i % 2 == 0:
		initial = string[i]
		result += initial
	elif string[i] == initial and initial == 'a':
		result += 'b'
		initial = 'b'
		count += 1
	elif string[i] == initial and initial == 'b':
		result += 'a'
		initial = 'a'
		count += 1
	else:
		result += string[i]
		initial = string[i]
print(count)
print(result)


n = int(input())
k = 0
a = input()
l = [i for i in a]
for i in range(0, len(a) - 1, 2):
	if l[i] == l[i + 1] and l[i] == 'b':
		l[i] = 'a'
		k = k + 1
	elif l[i] == l[i + 1] and l[i] == 'a':
		l[i] = 'b'
		k = k + 1
print(k)
for i in l:
	print(i, end='')


n = int(input())
s = input()
out = []
cnt = 0
for i in range(0, n - 1, 2):
	if len(set(s[i:i + 2])) == 1:
		cnt += 1
		out.append('ab')
	else:
		out.append(s[i:i + 2])
print(cnt)
print(''.join(out))


n = int(input())
s = list(input())
b = ans = 0
d = {}
a = ''
d['a'] = 0
d['b'] = 0
for i in range(0, n, 2):
	d[s[i]] += 1
	d[s[i + 1]] += 1
	if d['a'] != d['b']:
		ans += 1
		a += 'ab'
	else:
		a += s[i]
		a += s[i + 1]
	d['a'] = d['b']
print(ans)
print(a)


n = int(input())
s = input()
d = 0
ans = []
for i in range(0, n, 2):
	ans.append(s[i])
	if s[i] == s[i + 1]:
		d += 1
		if s[i + 1] == 'a':
			ans.append('b')
		else:
			ans.append('a')
	else:
		ans.append(s[i + 1])
print(d)
print(''.join(ans))


N = int(input())
S = input()
a = 0
b = 0
ans = 0
T = ''
for (i, s) in enumerate(S):
	if s == 'a':
		a += 1
	else:
		b += 1
	if i % 2 == 1:
		if a != b:
			if s == 'a':
				s = 'b'
				a -= 1
				b += 1
			else:
				s = 'a'
				a += 1
				b -= 1
			ans += 1
	T += s
print(ans)
print(T)


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')
n = int(input())
vals = [k for k in input()]
a = 0
b = 0
moves = 0
for s in range(n):
	if vals[s] == 'a':
		a += 1
	else:
		b += 1
	if s % 2 == 1:
		if a == b:
			continue
		if a < b:
			b -= 1
			a += 1
			moves += 1
			vals[s] = 'a'
		else:
			a -= 1
			b += 1
			moves += 1
			vals[s] = 'b'
print(moves)
print(*vals, sep='')


def process(A, n):
	a = 0
	b = 0
	for i in range(2):
		if A[i] == 'a':
			a += 1
		else:
			b += 1
	if a > b:
		A[1] = 'b'
		res = 1
	elif a < b:
		A[1] = 'a'
		res = 1
	else:
		res = 0
	for i in range(3, len(A) + 1, 2):
		if A[i - 1] == A[i]:
			res += 1
			if A[i - 1] == 'a':
				A[i - 1] = 'b'
			else:
				A[i - 1] = 'a'
	return (res, A)
n = int(input())
A = [x for x in input()]
(res, B) = process(A, n)
print(res)
for i in B:
	print(i, end='')


n = int(input())
s = input()
res = 0
res_s = ''
for i in range(0, n // 2):
	ch1 = s[2 * i]
	ch2 = s[2 * i + 1]
	if ch2 == ch1:
		res += 1
		if ch1 == 'a':
			ch1 = 'b'
		else:
			ch1 = 'a'
	res_s += ch1 + ch2
print(res)
print(res_s)


n = int(input())
s = list(input())
pref = [0]
k = 0
for i in range(0, n - 1, 2):
	if s[i] == s[i + 1]:
		k += 1
		if s[i] == 'b':
			s[i] = 'a'
		else:
			s[i] = 'b'
print(k)
print(''.join(s))


n = int(input())
s = input()
t = 0
r = ''
for i in range(0, n, 2):
	s2 = s[i:i + 2]
	if s2 == 'aa' or s2 == 'bb':
		r += 'ab'
		t += 1
	else:
		r += s2
print(t)
print(r)


k = int(input())
s = [i for i in input()]
n = 0

def outro(n):
	if n == 'a':
		return 'b'
	return 'a'
for i in range(1, k, 2):
	if s[i] == s[i - 1]:
		n += 1
		s[i] = outro(s[i])
print(n)
for i in s:
	print(i, end='')
print('')


length = int(input())
string = list(input())
evenCounter = 0
numberOfOperations = 0
Acount = 0
Bcount = 0
for pos in range(0, len(string)):
	evenCounter += 1
	char = string[pos]
	if char == 'a':
		Acount += 1
	else:
		Bcount += 1
	if evenCounter % 2 == 0:
		if Acount != Bcount:
			numberOfOperations += 1
			dif = abs(Acount - Bcount)
			if Acount > Bcount:
				string[pos] = 'b'
				Bcount += dif
			else:
				string[pos] = 'a'
				Acount += dif
print(numberOfOperations)
str1 = ''.join(string)
print(str1)


n = int(input())
s = list(map(str, input().strip()))
ans = 0
for i in range(n):
	if i % 2 and s[i] == s[i - 1]:
		s[i] = 'a' if s[i - 1] == 'b' else 'b'
		ans += 1
print(ans)
print(''.join(s))


n = int(input())
s = list(input())
n_change = 0
for (i, c) in enumerate(s):
	if i % 2 == 0:
		c1 = c
	elif c1 == c:
		n_change += 1
		s[i] = 'a' if c == 'b' else 'b'
out = ''.join(s)
print(n_change)
print(out)


import sys
input('')
string = list(input(''))
flipNumber = 0
for i in range(0, len(string), 2):
	if string[i] == string[i + 1]:
		string[i] = 'a'
		string[i + 1] = 'b'
		flipNumber += 1
print(flipNumber)
print(''.join(string))


swap = dict()
swap['a'] = 'b'
swap['b'] = 'a'
n = int(input())
s = list(input())
cnt = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		cnt += 1
		s[i] = swap[s[i]]
print(cnt)
print(''.join(s))


n = int(input().strip())
s = list(input().strip())
i = 0
cnt = 0
while i < n:
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			s[i + 1] = 'b'
		else:
			s[i + 1] = 'a'
		cnt += 1
	else:
		pass
	i += 2
print(cnt)
for c in s:
	print(c, end='')
print()


n = int(input())
s = input()
end = list()
pl = 0
j = 2
last = [s[i:i + j] for i in range(0, len(s), j)]
for i in last:
	if i == 'bb' or i == 'aa':
		pl += 1
		end.append('ab')
	else:
		end.append(i)
print(pl)
print(''.join(end) if pl != 0 else s)


n = int(input())
word = list(input())
cnt = 0
for i in range(0, n, 2):
	if word[i] == word[i + 1]:
		cnt += 1
		word[i] = ['a', 'b'][word[i] == 'a']
print(cnt)
print(''.join(word))


q = int(input())
s = input()
ans = list(s)
o = 0
for i in range(0, len(ans), 2):
	if ans[i] == ans[i + 1]:
		o += 1
		if ans[i] == 'a':
			ans[i] = 'b'
		else:
			ans[i] = 'a'
print(o)
print(''.join(ans))


import math
n = int(input())
s = input()
k = ''
y = 0
for i in range(0, n, 2):
	if s[i:i + 2] == 'ab' or s[i:i + 2] == 'ba':
		k = k + s[i:i + 2]
	else:
		k = k + 'ab'
		y = y + 1
print(y)
print(k)


N = int(input())
s = input()
r = []
ac = 1 if s[0] == 'a' else 0
bc = 1 if s[0] == 'b' else 0
x = 0
r.append(s[0])
for i in range(1, N):
	ac += 1 if s[i] == 'a' else 0
	bc += 1 if s[i] == 'b' else 0
	if i % 2 == 1:
		if ac > bc:
			r.append('b')
			x += 1
		elif bc > ac:
			r.append('a')
			x += 1
		else:
			r.append(s[i])
		bc = ac = 0
	else:
		r.append(s[i])
print(x)
print(''.join(r))


n = int(input())
a = input()
s = 0
n_s = ''
for i in range(1, n, 2):
	if a[i] == a[i - 1]:
		s += 1
		n_s += a[i] + chr(ord('a') + ord('b') - ord(a[i]))
	else:
		n_s += a[i - 1] + a[i]
print(s)
print(n_s)


n = int(input())
a = input()
c = 0
l = []
for x in range(0, n, 2):
	if a[x] != a[x + 1]:
		l.append(a[x])
		l.append(a[x + 1])
	else:
		l.append(a[x])
		if a[x + 1] == 'a':
			l.append('b')
		else:
			l.append('a')
		c += 1
print(c)
print(''.join(l))


def prefixes(n, s):
	result = 0
	sResult = []
	if n == 2:
		if s.count('a') == s.count('b'):
			result = 0
		else:
			result = 1
			s = ['b', 'a']
	i = 2
	j = 0
	while i <= len(s):
		pref = s[j:i]
		counter = pref.count('a')
		counter2 = pref.count('b')
		if counter != counter2:
			result += 1
			if counter > counter2:
				s[i - 1] = 'b'
			else:
				s[i - 1] = 'a'
		j = i
		i += 2
	print(int(result))
	print(''.join(s))
n = int(input())
s = list(input())
prefixes(n, s)


def prefixes(s, l):
	counter = 0
	i = 0
	ret = ''
	while i < l:
		if s[i] != s[i + 1]:
			ret += s[i:i + 2]
		else:
			counter += 1
			ret += 'ab'
		i += 2
	print(counter)
	print(ret)
l = int(input())
s = input()
prefixes(s, l)


n = int(input())
b = input()
t = ''
q = 0
for j in range(0, len(b), 2):
	if b[j:j + 2] == 'ab' or b[j:j + 2] == 'ba':
		t += b[j:j + 2]
	else:
		t += 'ab'
		q += 1
print(q)
print(t)


n = int(input())
a = input()
res = 0
res2 = ''
for i in range(0, len(a), 2):
	if a[i] == a[i + 1]:
		res += 1
		res2 += 'ab'
	else:
		res2 += a[i]
		res2 += a[i + 1]
print(res)
print(res2)


s = [input(), list(input())][1]
res = 0
for i in range(len(s))[::2]:
	if s[i] == s[i + 1]:
		s[i] = {'a', 'b'}.difference(s[i]).pop()
		res += 1
print(res, ''.join(s), sep='\n')


n = int(input())
s = list(input())
no = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		no += 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
print('{}\n{}'.format(no, ''.join(s)))


(n, s, out, s_out) = (int(input()), input(), 0, '')
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		out += 1
		s_out += 'ab'
		continue
	s_out += s[i:i + 2]
print(out, s_out, sep='\n')


n = int(input())
(c, res) = (0, [])
s = input()
for i in range(0, len(s), 2):
	a = s[i]
	b = s[i + 1]
	if a == b:
		c += 1
		b = 'b' if b == 'a' else 'a'
	res.append(a)
	res.append(b)
print(c)
print(''.join(res))


def main():
	size = int(input())
	string = list(input())
	count = 0
	for i in range(0, len(string), 2):
		if string[i] == string[i + 1]:
			string[i] = 'a'
			string[i + 1] = 'b'
			count += 1
	print(count)
	print(''.join(string))
main()


n = int(input())
s = input()
count = 0
res = ''
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		count += 1
		res += 'ab'
	else:
		res += s[i:i + 2]
print(count)
print(res)


input()
s = input()
o = ''
c = 0
for i in range(len(s) // 2):
	pair = s[2 * i:2 * (i + 1)]
	if pair[0] == pair[1]:
		if pair[0] == 'a':
			o += 'ba'
		else:
			o += 'ab'
		c += 1
	else:
		o += pair
print(c)
print(o)


from collections import Counter

def func():
	n = int(input())
	s = list(input())
	l = []
	c = 0
	for i in range(0, n, 2):
		if s[i] == s[i + 1]:
			if s[i] == 'a':
				s[i] = 'b'
			else:
				s[i] = 'a'
			c += 1
	print(c)
	print(''.join(s))
t = 1
for i in range(t):
	func()


n = int(input())
s = input()
c = 0
res = ''
for i in range(2, n + 1, 2):
	l = s[i - 2:i]
	if l.count('a') != l.count('b'):
		a = l.count('a')
		b = l.count('b')
		r = len(l) // 2
		if a > b:
			d = a - r
			l = l.replace('a', 'b', d)
			c += d
		else:
			d = b - r
			l = l.replace('b', 'a', d)
			c += d
	res += l
print(c)
print(res)


n = int(input())
a = input()
ans = 0
gg = ''
for i in range(1, n, 2):
	if a[i] == a[i - 1]:
		ans += 1
		gg += a[i - 1]
		if a[i] == 'a':
			gg += 'b'
		else:
			gg += 'a'
	else:
		gg += a[i - 1]
		gg += a[i]
print(ans)
print(gg)


length = int(input())
string = input()
string_list = list(string)
counter = 0
for i in range(0, len(string), 2):
	if string[i:i + 2] == 'bb':
		string_list[i + 1] = 'a'
		counter = counter + 1
	elif string[i:i + 2] == 'aa':
		string_list[i + 1] = 'b'
		counter = counter + 1
print(counter)
for i in string_list:
	print(i, end='')


n = int(input())
st = input()
s = 2
k = 0
str1 = ''
for i in range(len(st)):
	ka = 0
	kb = 0
	for j in range(s - 2, s):
		if st[j] == 'a':
			ka = ka + 1
		else:
			kb = kb + 1
	st1 = st[s - 2:s]
	if ka > kb:
		str1 = str1 + st1.replace('a', 'b', 1)
		k = k + 1
	if kb > ka:
		str1 = str1 + st1.replace('b', 'a', 1)
		k = k + 1
	if ka == kb:
		str1 = str1 + st1
	s = s + 2
	if s > len(st):
		break
print(k)
print(str1)


def string(x):
	a = len(x)
	cnt = 0
	for i in range(0, a, 2):
		if x[i] == 'a' and x[i + 1] == 'a':
			x[i] = 'b'
			cnt += 1
		elif x[i] == 'b' and x[i + 1] == 'b':
			x[i] = 'a'
			cnt += 1
	print(cnt)
	return x
n = int(input())
x = list(input())
x = string(x)
for i in x:
	print(i, end='')


import sys

def rint():
	return map(int, sys.stdin.readline().split())
n = int(input())
s = list(input())
cnt = 0
for i in range(n // 2):
	if s[2 * i] == s[2 * i + 1]:
		if s[2 * i] == 'a':
			s[2 * i] = 'b'
		else:
			s[2 * i] = 'a'
		cnt += 1
print(cnt)
print(''.join(s))


n = int(input())
s = input()
c = 0
t = ''
for (x, y) in zip(s[::2], s[1::2]):
	if x == y:
		c += 1
	t += x + 'ab'[x < 'b']
print(c)
print(t)


def f(s):
	(op, ac, bc) = (0, 0, 0)
	(lasta, lastb) = (-1, -1)
	o = list(s)
	for i in range(len(s) + 1):
		if i > 0 and i % 2 == 0:
			if ac > bc:
				o[lasta] = 'b'
				op += 1
				ac -= 1
				bc += 1
				assert ac == bc
			elif ac < bc:
				o[lastb] = 'a'
				op += 1
				ac += 1
				bc -= 1
				assert ac == bc
		if i < len(s):
			if s[i] == 'a':
				ac += 1
				lasta = i
			else:
				lastb = i
				bc += 1
	return (op, ''.join(o))
assert f('bbbb') == (2, 'baba')
assert f('ababab') == (0, 'ababab')
assert f('aa') == (1, 'ab')
n = int(input())
s = input()
(a, b) = f(s)
print(a)
print(b)


n = int(input())
s = input()
a = []
for i in range(n):
	a.append(s[i])
counta = 0
countb = 0
count = 0
for i in range(0, n - 1, 2):
	if a[i] == 'a':
		counta += 1
	else:
		countb += 1
	if a[i + 1] == 'a':
		counta += 1
	else:
		countb += 1
	if counta > countb:
		a[i] = 'b'
		count += 1
		counta -= 1
		countb += 1
	elif counta < countb:
		a[i] = 'a'
		count += 1
		counta += 1
		countb -= 1
print(count)
for num in a:
	print(num, end='')
print()


n = int(input())
s = list(input())
c = 0
i = 0
while i != len(s):
	if s[i] == s[i + 1]:
		c = c + 1
		i = i + 2
	else:
		i = i + 2
i = 0
print(c)
while i != len(s):
	if s[i] == s[i + 1]:
		print('ab', end='')
		i = i + 2
	else:
		print(s[i] + s[i + 1], end='')
		i = i + 2
print()


length = int(input())
string = input()
changes = 0
resstring = ''
for i in range(length // 2):
	if string[2 * i] == string[2 * i + 1]:
		changes += 1
		if string[2 * i] == 'a':
			resstring += string[2 * i] + 'b'
		else:
			resstring += string[2 * i] + 'a'
	else:
		resstring += string[2 * i] + string[2 * i + 1]
print(changes)
print(resstring)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
d = {'a': 0, 'b': 1}
s = list(map(lambda x: d[x], input()))
ans = 0
for i in range(1, n, 2):
	if s[i] != 1 - s[i - 1]:
		ans += 1
		s[i] = 1 - s[i - 1]
e = {0: 'a', 1: 'b'}
print(ans)
print(''.join(map(lambda x: e[x], s)))


n = int(input())
word = input()
ans = ''
cost = 0
for i in range(0, n, 2):
	temp = word[i] + word[i + 1]
	if temp == 'ab' or temp == 'ba':
		ans = ans + temp
		continue
	else:
		cost += 1
		if temp[0] == 'a':
			ans += 'ab'
		else:
			ans += 'ba'
print(cost)
print(ans)


def prefix(s):
	count = 0
	result = []
	for i in range(0, len(s) - 1, 2):
		if s[i:i + 2] == 'aa' or s[i:i + 2] == 'bb':
			count += 1
			result.append('b')
			result.append('a')
		else:
			result.append(s[i])
			result.append(s[i + 1])
	return (count, ''.join(result))
n = int(input())
s = input()
result = prefix(s)
print(result[0])
print(result[1])


def pre(x):
	m = 0
	s = list(x)
	for i in range(0, len(s), 2):
		if s[i] == 'a' and s[i + 1] == 'a':
			s[i] = 'b'
			m += 1
		elif s[i] == 'b' and s[i + 1] == 'b':
			s[i] = 'a'
			m += 1
	print(m)
	print(''.join(s))
y = int(input())
x = input()
pre(x)


n = int(input())
s = input()
ans = 0
a = []
for i in range(0, n, 2):
	if s[i:i + 2] == 'aa' or s[i:i + 2] == 'bb':
		ans += 1
		a += ['ab']
	else:
		a += [s[i:i + 2]]
print(ans)
print(''.join(a))


class Prefixo:

	def __init__(self, palavra, a, b):
		self.palavra = palavra
		self.a = a
		self.b = b

def main():
	n = int(input())
	palavra = input()
	prfix = []
	start = 0
	div = n // 2
	for i in range(div):
		p = palavra[start:start + 2]
		prfix.append(Prefixo(p, p.count('a'), p.count('b')))
		start += 2
	cont = 0
	for i in prfix:
		if i.a != i.b:
			if i.a < i.b:
				while i.a < i.b:
					cont += 1
					index = i.palavra.index('b')
					i.palavra = i.palavra[0:index] + 'a' + i.palavra[index + 1:]
					i.a += 1
					i.b -= 1
			elif i.a > i.b:
				while i.a > i.b:
					cont += 1
					index = i.palavra.index('a')
					i.palavra = i.palavra[0:index] + 'b' + i.palavra[index + 1:]
					i.a -= 1
					i.b += 1
	print(cont)
	print(''.join([i.palavra for i in prfix]))
main()


n = int(input())
s = input()[:n]
x = s.count('a')
y = s.count('b')
s = list(s)
c = 0
for i in range(0, len(s), 2):
	if s[i] == 'b' and s[i + 1] == 'b' or (s[i] == 'a' and s[i + 1] == 'a'):
		(s[i], s[i + 1]) = ('b', 'a')
		c = c + 1
print(c)
print(''.join(s))


n = int(input())
s = list(input())
(res, result) = (0, '')
for i in range(0, n - 1, 2):
	if s[i] == 'a' and s[i + 1] == 'a' or (s[i] == 'b' and s[i + 1] == 'b'):
		res += 1
		result += 'ab'
	else:
		result += s[i] + s[i + 1]
print(res)
print(result)


n = int(input())
arr = list(input())
a_count = 0
b_count = 0
res = 0
ans = ''
for i in range(n):
	if arr[i] == 'a':
		a_count += 1
	else:
		b_count += 1
	if i % 2:
		if a_count != b_count:
			res += 1
			if a_count < b_count:
				arr[i] = 'a'
				a_count += 1
				b_count -= 1
			else:
				arr[i] = 'b'
				a_count -= 1
				b_count += 1
print(res)
print(''.join(arr))


n = int(input())
s1 = input()
s = list(s1)
c = 0
for i in range(1, n, 2):
	if s[i] == 'b' and s[i - 1] == 'b':
		c += 1
		s[i] = 'a'
	elif s[i] == 'a' and s[i - 1] == 'a':
		c += 1
		s[i] = 'b'
print(c)
st = ''.join(s)
print(st)


N = int(input())
A = input()
tot = 0
B = []
for i in range(0, len(A), 2):
	if A[i] == 'a' and A[i + 1] == 'b':
		B.append(A[i])
		B.append(A[i + 1])
		pass
	elif A[i] == 'b' and A[i + 1] == 'a':
		B.append(A[i])
		B.append(A[i + 1])
		pass
	elif A[i] == 'a' and A[i + 1] == 'a':
		tot += 1
		B.append(A[i])
		B.append('b')
	elif A[i] == 'b' and A[i + 1] == 'b':
		tot += 1
		B.append(A[i])
		B.append('a')
print(tot)
print(''.join(B))


l = int(input())
data = list(input())
c = 0
for i in range(0, l, 2):
	b = 0
	a = 0
	if data[i] == 'b':
		b += 1
	else:
		a += 1
	if data[i + 1] == 'b':
		b += 1
	else:
		a += 1
	if b > a:
		c += 1
		data[i] = 'a'
	elif a > b:
		c += 1
		data[i] = 'b'
print(c)
print(''.join(data))


n_letters = int(input())
letters = [i for i in input()]
count = 0
prefix = []
for i in range(0, n_letters, 2):
	if letters[i] == letters[i + 1]:
		count += 1
		prefix += 'ab'
	else:
		prefix += letters[i:i + 2]
print(count)
print(''.join(prefix))


n = int(input())
conjunto = list(input())
copia = []
j = 0
a_count = 0
b_count = 0
trocas = 0
for i in conjunto:
	if i == 'a':
		a_count += 1
	else:
		b_count += 1
	copia.append(i)
	if j % 2 != 0:
		if abs(a_count - b_count) != 0:
			trocas += 1
			if copia[j] == 'a':
				copia[j] = 'b'
			else:
				copia[j] = 'a'
		a_count = 0
		b_count = 0
	j += 1
saida = ''
for i in copia:
	saida = saida + i
print(trocas)
print(saida)


n = int(input())
s = str(input())
c = 0
y = ''
x = ''
for i in range(2, len(s) + 1, 2):
	x = s[i - 2:i]
	if x.count('a') > x.count('b'):
		c += int(x.count('a') / 2)
		x = x.replace('a', 'b', int(x.count('a') / 2))
		y += x
	elif x.count('a') < x.count('b'):
		c += int(x.count('b') / 2)
		x = x.replace('b', 'a', int(x.count('b') / 2))
		y += x
	else:
		y += x
print(c)
print(y)


n = int(input())
s = input()
num_a = 0
num_b = 0
curr_index = 0
ans = 0
final = ''
for char in s:
	if char == 'a':
		num_a += 1
	elif char == 'b':
		num_b += 1
	curr_index += 1
	if curr_index % 2 == 0:
		if num_a != num_b:
			num_a = (num_b + num_a) // 2
			num_b = num_a
			ans += 1
			final += 'ab'
		else:
			final += s[curr_index - 2] + s[curr_index - 1]
print(ans)
print(final)


n = int(input())
s = list(input())
a = 0
b = 0
ans = 0
for i in range(n):
	if s[i] == 'a':
		a += 1
	elif s[i] == 'b':
		b += 1
	if i & 1 == 1 and a != b:
		ans += 1
		if b > a:
			b -= 1
			a += 1
			s[i] = 'a'
		else:
			a -= 1
			b += 1
			s[i] = 'b'
print(ans)
print(''.join(s))


ans = 0
end = input()
end = eval(end)
str = input()
str = list(str)
for i in range(0, end, 2):
	if str[i] + str[i + 1] == 'aa':
		str[i] = 'a'
		str[i + 1] = 'b'
		ans += 1
	if str[i] + str[i + 1] == 'bb':
		str[i] = 'a'
		str[i + 1] = 'b'
		ans += 1
print(ans)
print(''.join(str))


n = int(input())
s = input()
a = []
for i in s:
	a.append(i)
k = 0
for i in range(0, n, 2):
	if a[i] != a[i + 1]:
		continue
	else:
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
		k = k + 1
print(k)
for i in a:
	print(i, end='')
print()


n = int(input())
s = list(input())
cnt = 0
for i in range(0, len(s), 2):
	if s[i] + s[i + 1] == 'aa' or s[i] + s[i + 1] == 'bb':
		cnt += 1
		if s[i] == 'a':
			s[i + 1] = 'b'
		else:
			s[i + 1] = 'a'
print(cnt)
print(''.join(s))


a = int(input())
nlist = input()
str = list(nlist)
i = 0
k = 2
count = 0
while i <= len(str):
	n_str = str[i:k]
	acnt = n_str.count('a')
	bcnt = n_str.count('b')
	if acnt != bcnt:
		count += 1
		if acnt == 2:
			str[i] = 'b'
		else:
			str[i] = 'a'
	i = k
	k += 2
print(count)
str = ''.join(str)
print(str)


import sys

def main():

	def input():
		return sys.stdin.readline()[:-1]
	n = int(input())
	s = input()
	ans = ''
	t = 0
	for k in range(n // 2):
		if s[2 * k:2 * k + 2] == 'aa' or s[2 * k:2 * k + 2] == 'bb':
			t += 1
			ans += 'ab'
		else:
			ans += s[2 * k:2 * k + 2]
	print(t)
	print(ans)
main()


a = int(input())
b = input()
c = ''
d = 0
for i in range(0, a):
	if i % 2 != 0:
		if b[i - 1] == b[i]:
			d += 1
			if b[i - 1] == 'a':
				c += 'b'
			if b[i - 1] == 'b':
				c += 'a'
		else:
			c += b[i]
	else:
		c += b[i]
print(d)
print(c)


n = int(input())
s = list(input())
k = 0
ans = ''
for i in range(0, n - n % 2, 2):
	if s[i] == s[i + 1]:
		ans += 'ab'
		k += 1
	else:
		ans += s[i] + s[i + 1]
if n % 2 == 1:
	ans += s[-1]
print(k)
print(ans)


def answer():
	n = int(input())
	s = list(input())
	i = 0
	ans = 0
	while i < len(s):
		if s[i] == 'a' and s[i + 1] == 'a':
			s[i + 1] = 'b'
			ans += 1
		elif s[i] == 'b' and s[i + 1] == 'b':
			s[i + 1] = 'a'
			ans += 1
		i += 2
	print(ans)
	a = ''
	for x in s:
		a += x
	print(a)
answer()


n = int(input())
s = list(input())
aCount = 0
bCount = 0
operations = 0
for i in range(0, n):
	if s[i] == 'a':
		aCount += 1
	else:
		bCount += 1
	if i % 2:
		if bCount > aCount:
			operations += bCount - aCount - 1
			s[i] = 'a'
			aCount += 1
			bCount -= 1
		elif aCount > bCount:
			operations += aCount - bCount - 1
			s[i] = 'b'
			bCount += 1
			aCount -= 1
		else:
			pass
print(operations)
print(''.join(s))


n = int(input().strip())
string = input().strip()
count = 0
pref = list(string)
for i in range(0, len(string), 2):
	if string[i:i + 2] != 'ab' and string[i:i + 2] != 'ba':
		if pref[i] == 'a':
			pref[i] = 'b'
		else:
			pref[i] = 'a'
		count += 1
print(count)
print(''.join(pref))


n = int(input())
_in = input()
s = [char for char in _in]
prev = ''
ops = 0
for i in range(n):
	if i % 2 == 0:
		prev = s[i]
	elif s[i] == prev:
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		ops += 1
print(ops)
print(''.join(s))


t = int(input())
s = input()
lst = list(s)
count1 = 0
for i in range(1, len(lst), 2):
	if lst[i - 1] == lst[i]:
		count1 = count1 + 1
		if lst[i - 1] == 'a':
			lst[i - 1] = 'b'
		else:
			lst[i - 1] = 'a'
print(count1)
print(''.join(lst))


from sys import stdin, stdout
n = int(stdin.readline())
s = list(stdin.readline())
count = 0
for i in range(0, n, 2):
	if s[i] == 'a':
		if s[i + 1] == 'a':
			count += 1
			s[i + 1] = 'b'
	elif s[i + 1] == 'b':
		count += 1
		s[i + 1] = 'a'
stdout.write(str(count) + '\n')
for c in s:
	if c != '\n':
		stdout.write(c)


n = int(input())
s = str(input())
temp = ''
c = 0
for i in range(1, n + 1, 2):
	if s[i - 1] == s[i]:
		if s[i] == 'a':
			temp += 'b' + s[i]
			c += 1
		elif s[i] == 'b':
			temp += 'a' + s[i]
			c += 1
	else:
		temp += s[i - 1] + s[i]
print(c)
print(temp)


def main():
	n = int(input())
	s1 = str(input())
	cnt = 0
	res = ''
	for i in range(1, n, 2):
		res += s1[i - 1]
		if s1[i - 1] != s1[i]:
			res += s1[i]
		else:
			cnt += 1
			res += 'a' if s1[i - 1] == 'b' else 'b'
	print(cnt)
	print(res)
	return
main()


import sys

def main():
	n = int(sys.stdin.readline())
	s = sys.stdin.readline()
	cnt = 0
	ans = []
	for i in range(0, n, 2):
		if s[i] == s[i + 1]:
			cnt += 1
			r = 'a' if s[i] == 'b' else 'b'
			ans += [r, s[i]]
		else:
			ans += [s[i], s[i + 1]]
	print(cnt)
	for x in ans:
		print(x, end='')
	print()
main()


n = input()
string = input()
replaces = 0
new_string = ''
for i in range(0, int(n), 2):
	if string[i] == 'a' and string[i + 1] == 'a':
		replaces += 1
		new_string += 'ba'
	elif string[i] == 'b' and string[i + 1] == 'b':
		replaces += 1
		new_string += 'ab'
	else:
		new_string += string[i:i + 2]
print(replaces)
print(new_string)


n = int(input())
str = input()
lst = []
for i in range(0, len(str), 2):
	lst.append(str[i:i + 2])
ans = 0
ans_str = []
for i in lst:
	if i[0] == i[1]:
		ans += 1
		ans_str.append('ab')
	else:
		ans_str.append(i)
print(ans)
print(''.join(ans_str))


n = int(input())
ss = input()
s = [ss[x] for x in range(len(ss))]
ans = 0
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		ans += 1
	if s[i] == 'a':
		s[i + 1] = 'b'
	else:
		s[i + 1] = 'a'
print(ans)
print(''.join(s))


def f(a):
	cnt = 0
	fliped = {'a': 'b', 'b': 'a'}
	for i in range(0, len(a), 2):
		if a[i] == a[i + 1]:
			cnt += 1
			a[i] = fliped[a[i]]
	print(cnt)
	print(''.join(a))
input()
f(list(input()))


input()
s = input()
t = ''.join((x + 'ab'[x < 'b'] for x in s[::2]))
print(sum((x != y for (x, y) in zip(s, t))))
print(t)


def get_count(s):
	count = 0
	for i in range(1, len(s), 2):
		if s[i] == s[i - 1]:
			count += 1
			s[i] = 'a' if s[i] == 'b' else 'b'
	return (count, ''.join(s))
input()
s = input()
(count, s) = get_count(list(s))
print(count)
print(s)


import sys
import math
input = sys.stdin.readline
n = int(input())
s = input()
l = list()
l.append('0')
cnta = 0
cntb = 0
ans = 0
for i in range(n):
	if s[i] == 'a':
		cnta += 1
	else:
		cntb += 1
	if i % 2 == 1:
		if cnta > cntb:
			l.append('b')
			cntb += 1
			cnta -= 1
			ans += 1
		elif cntb > cnta:
			l.append('a')
			cnta += 1
			cntb -= 1
			ans += 1
		else:
			l.append(s[i])
	else:
		l.append(s[i])
print(ans)
for i in range(1, len(l)):
	print(l[i], end='')
print()


n = int(input())
s = list(map(str, input().strip()))
d = dict()
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
l = []
c = 0
for i in range(n - 1):
	if i % 2 == 0:
		if s[i] != s[i + 1]:
			continue
		else:
			c += 1
			if s[i] == 'a':
				s[i + 1] = 'b'
			else:
				s[i + 1] = 'a'
print(c)
print(''.join(s))


n = int(input())
l = list(input())
ans = 0
for i in range(0, n, 2):
	if l[i] == l[i + 1]:
		ans += 1
		if l[i] == 'a':
			l[i] = 'b'
		else:
			l[i] = 'a'
print(ans)
print(''.join(l))


n = int(input())
s = list(input())
d = {'a': 0, 'b': 0}
last = {'a': 0, 'b': 0}
rc = 0
for i in range(len(s)):
	d[s[i]] += 1
	last[s[i]] = i
	if (i + 1) % 2 == 0:
		if d['a'] == d['b']:
			continue
		elif d['a'] < d['b']:
			s[last['b']] = 'a'
			d['a'] += 1
			d['b'] -= 1
			rc += 1
		else:
			s[last['a']] = 'b'
			d['b'] += 1
			d['a'] -= 1
			rc += 1
print(rc)
print(''.join(s))


d = {'a': 1, 'b': 2}
n = int(input())
a = list(input())
i = 0
z = 0
while i < len(a):
	if a[i] == 'a' and a[i + 1] != 'b':
		a[i + 1] = 'b'
		z = z + 1
	if a[i] == 'b' and a[i + 1] != 'a':
		a[i + 1] = 'a'
		z = z + 1
	i += 2
print(z)
for i in a:
	print(i, end='')


import os

def f(s):
	new_s: str = s[0]
	count = 0
	prev_char = new_s[-1]
	for i in range(1, len(s)):
		if i % 2:
			if s[i] == prev_char:
				count += 1
				new_s += 'a' if s[i] == 'b' else 'b'
			else:
				new_s += s[i]
		else:
			new_s += s[i]
		prev_char = new_s[-1]
	return f'{count}\n{new_s}'
if os.environ.get('DEBUG', False):
	print(f"{f('bbbb')} = 2 abba")
	print(f"{f('ababab')} = 0 ababab")
	print(f"{f('aa')} = 1 ba")
else:
	int(input())
	print(f(input()))


n = int(input())
s = list(input())
ac = 0
bc = 0
cc = 0
for i in range(n):
	if s[i] == 'a':
		ac += 1
	elif s[i] == 'b':
		bc += 1
	if (i + 1) % 2 == 0:
		if ac > bc:
			s[i] = 'b'
			cc += 1
			ac -= 1
			bc += 1
		elif bc > ac:
			s[i] = 'a'
			cc += 1
			bc -= 1
			ac += 1
print(cc)
print(''.join(s))


from sys import stdin
n = int(stdin.readline())
s = [x for x in stdin.readline().rstrip()]
count = 0
for idx in range(0, n, 2):
	if s[idx] == 'a' and s[idx + 1] == 'a':
		s[idx] = 'b'
		count += 1
	elif s[idx] == 'b' and s[idx + 1] == 'b':
		s[idx] = 'a'
		count += 1
print(count)
print(''.join(s))


n = int(input())
s = input()
count = 0
t = ''
for i in range(n - 1):
	if i % 2 == 1:
		continue
	elif s[i] == s[i + 1]:
		count += 1
		t += 'ab'
	else:
		t += s[i] + s[i + 1]
print(count)
if count == 0:
	print(s)
else:
	print(t)


length = int(input())
input_string = input()
input_string = [input_string[i:i + 2] for i in range(0, length, 2)]
operations = 0
for (i, s) in enumerate(input_string):
	if s[0] == s[1]:
		operations += 1
		input_string[i] = 'ab'
print(operations)
print(''.join(input_string))


n = int(input())
s = input()
count = 0
s1 = ''
for i in range(0, n - 1, 2):
	if s[i] == 'a' and s[i + 1] == 'b' or (s[i] == 'b' and s[i + 1] == 'a'):
		s1 += s[i] + s[i + 1]
	else:
		if s[i] == 'a':
			s1 += s[i] + 'b'
		elif s[i] == 'b':
			s1 += s[i] + 'a'
		count += 1
print(count)
print(s1)


n = int(input())
s = input()
c = 0
news = ''
for i in range(0, n, 2):
	if s[i:i + 2] == 'aa' or s[i:i + 2] == 'bb':
		c += 1
		news += 'ab'
	else:
		news += s[i:i + 2]
print(c)
print(news)


N = int(input().strip())
S = list(str(input().strip()))
count = 0
for i in range(0, N, 2):
	if S[i] == S[i + 1]:
		count += 1
		if S[i] == 'a':
			S[i] = 'b'
		else:
			S[i] = 'a'
print(count)
print(''.join((str(i) for i in S)))


N = int(input())
X = list(input())
i = 1
Count = 0
while i < N:
	Temp = str(X[i - 1] + X[i])
	if Temp.count(Temp[0]) == 2:
		Count += 1
		X[i - 1] = 'a'
		X[i] = 'b'
	i += 2
print(Count)
print(*X, sep='')


n = int(input())
s = str(input())
r = ''
p = 0
a = 0
b = 0
for i in range(0, n):
	if s[i] == 'a':
		a += 1
	if s[i] == 'b':
		b += 1
	if i % 2 == 0:
		r = r + s[i]
	if i % 2 != 0:
		if a == b:
			r = r + s[i]
		elif a > b:
			r = r + 'b'
			a = a - 1
			b += 1
			p += 1
		elif b > a:
			r = r + 'a'
			b -= 1
			a += 1
			p += 1
print(p)
print(r)


l = int(input())
s = str(input())
cnt = 0
ans = ''
for i in range(0, len(s), 2):
	ans += s[i]
	if s[i] == s[i + 1]:
		cnt += 1
		ans += 'b' if s[i + 1] == 'a' else 'a'
	else:
		ans += s[i + 1]
print(cnt)
print(ans)


n = int(input())
str = list(input())
counter = 0
for i in range(2, n + 1, 2):
	mas = str[i - 2:i]
	a = mas.count('a')
	b = mas.count('b')
	if a > b:
		mas[0] = 'b'
		counter += 1
		str[i - 2:i] = mas
	elif a < b:
		mas[0] = 'a'
		counter += 1
		str[i - 2:i] = mas
print(counter)
print(''.join(str))


n = int(input())
l = [*input()]
a = b = 0
cnt = 0
for i in range(n):
	if l[i] == 'a':
		a += 1
	else:
		b += 1
	if i & 1 and a != b:
		cnt += 1
		if a > b:
			(l[i], a) = ('b', b)
		else:
			(l[i], b) = ('a', a)
print(cnt)
print(''.join(l))


a = int(input())
s = input()
ac = 0
s = list(s)
for i in range(0, a, 2):
	if s[i] == s[i + 1]:
		ac += 1
		s[i] = 'a'
		s[i + 1] = 'b'
print(ac)
print(''.join(s))


n = int(input())
li = list(input())
ans = []
cnt = 0
for i in range(n // 2):
	if li[2 * i] == li[2 * i + 1]:
		if li[2 * i] == 'a':
			ans.append('b')
			ans.append(li[2 * i + 1])
			cnt += 1
		if li[2 * i] == 'b':
			ans.append('a')
			ans.append(li[2 * i + 1])
			cnt += 1
	else:
		ans.append(li[2 * i])
		ans.append(li[2 * i + 1])
print(cnt)
print(''.join(map(str, ans)))


n = int(input())
a = list(input())
acnt = 0
bcnt = 0
ans = 0
for i in range(len(a)):
	if acnt != bcnt and a[i] == a[i - 1]:
		if acnt > bcnt:
			if a[i] == 'a':
				a[i] = 'b'
				bcnt += 1
				ans += 1
		elif a[i] == 'b':
			a[i] = 'a'
			acnt += 1
			ans += 1
	elif a[i] == 'a':
		acnt += 1
	else:
		bcnt += 1
print(ans)
print(''.join(a))


n = int(input())
a = [''] * n
s = input()
ans = 0
i = 0
while i < len(s):
	if s[i] == 'a':
		if s[i + 1] == 'a':
			ans += 1
		a[i] = 'a'
		a[i + 1] = 'b'
	else:
		if s[i + 1] == 'b':
			ans += 1
		a[i] = 'b'
		a[i + 1] = 'a'
	i += 2
print(ans)
print(*a, sep='')


x = int(input())
arr = list(input())
count = 0
ans = []
for i in range(0, x - 1, 2):
	temp = arr[i] + arr[i + 1]
	if temp == 'ab' or temp == 'ba':
		ans.append(temp)
	elif temp == 'bb' or temp == 'aa':
		ans.append('ab')
		count += 1
print(count)
print(''.join(ans))


def solve(s):
	res = []
	op_count = 0
	for i in range(0, len(s), 2):
		if s[i] != s[i + 1]:
			res.append(s[i:i + 2])
		else:
			res.append('ab')
			op_count += 1
	print(int(op_count))
	print(''.join(res))
n = int(input())
s = input()
solve(s)


n = int(input())
s = list(input())
res = 0
for i in range(n // 2):
	j = 2 * i
	if s[j] == s[j + 1]:
		s[j] = 'b'
		s[j + 1] = 'a'
		res += 1
print(res)
print(''.join(s))


x = int(input())
y = list(input())
n = 0
for i in range(0, x - 1, +2):
	if y[i] == y[i + 1]:
		n += 1
		if y[i] == 'a':
			y[i] = 'b'
		else:
			y[i] = 'a'
print(n)
for i in y:
	print(i, end='')


n = int(input())
s = list(input())
g = 0
for i in range(0, n, 2):
	p = [s[i], s[i + 1]]
	p.sort()
	if p != ['a', 'b']:
		g += 1
		s[i] = 'a'
		s[i + 1] = 'b'
s = ''.join(s)
print(g)
print(s)


n = int(input())
s = str(input())
len = len(s)
cnta = cntb = 0
ans = 0
ss = ''
for i in range(n):
	if s[i] == 'a':
		cnta = cnta + 1
	if s[i] == 'b':
		cntb = cntb + 1
	if i % 2 == 1:
		if cnta == cntb:
			ss += s[i]
			continue
		ans += 1
		if cnta > cntb:
			ss += 'b'
			cnta = cnta - 1
			cntb = cntb + 1
		if cntb > cnta:
			ss += 'a'
			cnta += 1
			cntb -= 1
	else:
		ss += s[i]
print(ans)
print(ss)


a = int(input())
s = input()

def swap(a):
	if a == 'a':
		return 'b'
	return 'a'
s = list(s)
i = 0
cnt = 0
while i < a:
	if s[i] == s[i + 1]:
		s[i + 1] = swap(s[i + 1])
		cnt += 1
	i += 2
print(f"{cnt}\n{''.join(s)}")


(n, s) = (int(input()), list(input()))
ops = 0
for i in range(n // 2):
	if s[2 * i] == s[2 * i + 1]:
		ops += 1
		s[2 * i:2 * i + 2] = 'ab'
print(ops)
print(*s, sep='')


def main():
	n = int(input())
	word = list(input())
	replaces = 0
	i = 0
	while i < len(word):
		if word[i] == word[i + 1]:
			replaces = replaces + 1
			if word[i] == 'a':
				word[i + 1] = 'b'
			else:
				word[i + 1] = 'a'
		i = i + 2
	print(replaces)
	print(''.join(word))
main()


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

def count_as(s, j):
	t = 0
	r = True
	for k in range(2 * j - 2, 2 * j):
		if s[k] == 'a':
			t += 1
	if t == 1:
		r = False
	else:
		f = t
		if f == 0:
			k = 2 * j - 2
			while f == 0:
				if s[k] == 'b':
					s[k] = 'a'
					f += 1
				k += 1
		else:
			k = 2 * j - 2
			while f == 2:
				if s[k] == 'a':
					s[k] = 'b'
					f -= 1
				k += 1
	return (r, s)
c = 0
for j in range(1, n // 2 + 1):
	(r, s) = count_as(s, j)
	if r:
		c += 1
print(c)
print(''.join(s))


n = int(input())
x = input()
y = [x[i] + x[i + 1] for i in range(0, n, 2)]
p = 0
for i in range(n // 2):
	if y[i].count('a') == 2 or y[i].count('b') == 2:
		p += 1
		y[i] = 'ab'
print(p, '\n', ''.join(y), sep='')


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

def addDictList(d, key, val):
	if key not in d:
		d[key] = []
	d[key].append(val)

def addDictInt(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] = val

def addDictCount(d, key):
	if key not in d:
		d[key] = 0
	d[key] += 1

def addDictSum(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] += val
n = getInt()
s = getStr()
i = 0
s2 = ''
res = 0
while i < n:
	if s[i] == s[i + 1]:
		res += 1
		s2 += 'ab'
	else:
		s2 += s[i] + s[i + 1]
	i += 2
print(res)
print(s2)


n = int(input())
s = str(input())
s = list(s)
d = 0
e = ['a', 'b']
f = ['b', 'a']
k = ''
for i in range(0, len(s), 2):
	g = s[i:i + 2]
	if g != e and g != f:
		d = d + 1
		s[i] = 'a'
		s[i + 1] = 'b'
	else:
		pass
k = k.join(s)
print(d)
print(k)


n = int(input())
s = input()
c = 0
s1 = ''
for i in range(n):
	ps = s[i * 2:i * 2 + 2]
	if ps == 'aa' or ps == 'bb':
		c += 1
		ps = 'ab'
	s1 += ps
print(c)
print(s1)


import sys
n = int(input())
j = 0
i = 0
s = ''
while i <= n - 1:
	a = sys.stdin.read(1)
	b = sys.stdin.read(1)
	if a == b:
		j += 1
		if b == 'a':
			s = s + 'ab'
		else:
			s = s + 'ab'
	else:
		s = s + a + b
	i += 2
print(j)
print(s)


n = int(input())
s = input()
ans = 0
sans = ''
for i in range(0, n, 2):
	ss = s[i:i + 2]
	if ss == 'aa' or ss == 'bb':
		ans += 1
		sans += 'ab'
	else:
		sans += ss
print(ans)
print(sans)


def compl(c):
	if c == 'a':
		return 'b'
	return 'a'
n = int(input())
s = input()
s2 = ''
nr = 0
for i in range(0, n, 2):
	if s[i] != s[i + 1]:
		s2 += s[i] + s[i + 1]
	else:
		s2 += s[i] + compl(s[i])
		nr += 1
print(nr)
print(s2)


import sys
import os
from io import IOBase, BytesIO

def main():
	n = int(input())
	s = list(input())
	ans = 0
	for i in range(0, n - 1, 2):
		x = s[i] + s[i + 1]
		if x == 'ab' or x == 'ba':
			continue
		else:
			ans += 1
			s[i] = 'a'
			s[i + 1] = 'b'
	print(ans)
	print(*s, sep='')
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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))

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

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

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


n = int(input())
s = list(input())
e = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		s[i] = chr(1 - ord(s[i]) + 194)
		e += 1
print(e)
print(''.join(s))


from sys import stdin

def check_valid(string):
	stack = []
	for i in string:
		if i in ['(', '[']:
			stack.append(i)
		elif i == ')':
			if len(stack) > 0:
				if stack[-1] == '(':
					stack.pop()
					continue
			return False
		elif i == ']':
			if len(stack) > 0:
				if stack[-1] == '[':
					stack.pop()
					continue
			return False
	return len(stack) == 0

def merge(index):
	aux = []
	if len(index) > 0:
		aux = [index[0]]
		for i in range(1, len(index)):
			if index[i][0] == aux[-1][1] + 1:
				aux[-1][1] = index[i][1]
			elif check_valid(string[aux[-1][1] + 1:index[i][0]]):
				aux[-1][1] = index[i][1]
			else:
				aux.append(index[i])
	return aux
n = int(stdin.readline().strip())
string = list(stdin.readline().strip())
b = 0
count = 0
a = 0
for i in range(0, len(string), 2):
	if string[i] == 'a':
		a += 1
	else:
		b += 1
	if string[i + 1] == 'a':
		a += 1
	else:
		b += 1
	if a == b:
		pass
	else:
		count += 1
		if a > b:
			string[i] = 'b'
			b += 1
			a -= 1
		else:
			string[i] = 'a'
			a += 1
			b -= 1
print(count)
print(''.join(string))


def sint():
	return int(input())

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

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

def sstr():
	s = input()
	return list(s[:len(s)])

def change(x):
	if x == 'a':
		return 'b'
	return 'a'

def main():
	n = sint()
	s = sstr()
	cnt = 0
	for i in range(0, n - 1, 2):
		if s[i] == s[i + 1]:
			s[i] = change(s[i])
			cnt += 1
	print(cnt)
	for i in s:
		print(i, end='')
main()


n = int(input())
a = input()
b = ''
m = 0
for i in range(0, n - 1, 2):
	if a[i:i + 2] == 'bb' or a[i:i + 2] == 'aa':
		b += 'ab'
		m += 1
	else:
		b += a[i:i + 2]
print(m)
print(b)


l = int(input())
st = list(input())
ct = 0
data = {'a': 'b', 'b': 'a'}
for x in range(0, len(st), 2):
	if st[x] == st[x + 1]:
		st[x] = data[st[x]]
		ct += 1
print(ct)
for x in st:
	print(x, end='')


from collections import Counter
n = int(input())
s = [char for char in input()]
dp = [0] * n
for i in range(2, len(s) + 1, 2):
	if i == 2:
		c = Counter(s[0:i])
		m = abs(c['a'] - c['b']) // 2
		dp[i - 1] = m
		if m != 0 and c['a'] == 2:
			s[i - 1] = 'b'
		elif m != 0 and c['b'] == 2:
			s[i - 1] = 'a'
	else:
		c = Counter(s[i - 2:i])
		m = abs(c['a'] - c['b']) // 2
		dp[i - 1] = dp[i - 3] + m
		if m != 0 and c['a'] == 2:
			s[i - 1] = 'b'
		elif m != 0 and c['b'] == 2:
			s[i - 1] = 'a'
print(dp[n - 1])
print(''.join(s))


import sys
input = sys.stdin.readline
n = int(input())
s = list(input()[:-1])
ans = 0
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'a':
		s[i] = 'b'
		ans += 1
	elif s[i] == 'b' and s[i + 1] == 'b':
		s[i] = 'a'
		ans += 1
print(ans)
print(''.join(s))


n = int(input())
s = list(input())
count = 0
for i in range(2, n + 1, 2):
	if s[i - 2:i] in [list('aa'), list('bb')]:
		s[i - 2:i] = list('ab')
		count += 1
print(count)
print(''.join(s))


a = int(input())
s = list(input())
list1 = [0, 0]
count = 0
for i in range(1, len(s), 2):
	if s[i - 1] == 'a' and s[i] == 'a':
		count = count + 1
		s[i - 1] = 'b'
	elif s[i - 1] == 'b' and s[i] == 'b':
		count = count + 1
		s[i - 1] = 'a'
	else:
		continue
p = ''
print(count)
for i in s:
	p = p + i
print(p)


n = int(input())
s = list(input())
res = []
cnt = 0
for i in range(0, len(s), 2):
	(a_cnt, b_cnt) = (0, 0)
	for j in range(i, i + 2):
		if s[j] == 'a':
			a_cnt += 1
		else:
			b_cnt += 1
	if a_cnt > b_cnt:
		cnt += 1
		res.extend(['a', 'b'])
	elif b_cnt > a_cnt:
		cnt += 1
		res.extend(['a', 'b'])
	else:
		res.extend(s[i:i + 2])
print(cnt)
print(''.join(res))


h = int(input())
b = input()
k = 0
g = ''
for i in range(0, h, 2):
	if b[i] == b[i + 1]:
		g += 'ab'
		k += 1
	elif b[i] == 'a':
		g += 'ab'
	else:
		g += 'ba'
print(k)
if k == 0:
	print(b)
else:
	print(g)


n = int(input())
s = input()
counter = 0
Str = ''
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		counter += 1
		Str += 'ab'
	else:
		Str += s[i] + s[i + 1]
print(counter)
print(Str)


n = int(input())
s = list(input())
(op, b, a) = (0, 0, 0)
for i in range(n):
	if s[i] == 'a':
		a += 1
	else:
		b += 1
	if (i + 1) % 2 == 0:
		if a > b:
			s[i] = 'b'
			a -= 1
			b += 1
			op += 1
		elif b > a:
			s[i] = 'a'
			a += 1
			b -= 1
			op += 1
print(op)
for i in range(n):
	print(s[i], end='')


n = int(input())
letras = list(map(str, input()))
saida = ''
c = 0
for i in range(n // 2):
	n1 = 2 * i
	n2 = 2 * i + 1
	l = [letras[n1], letras[n2]]
	if l[0] != l[1]:
		saida += l[0] + l[1]
	elif l[0] == l[1] == 'a':
		saida += l[0] + 'b'
		c += 1
	elif l[0] == l[1] == 'b':
		saida += l[0] + 'a'
		c += 1
print(c)
print(saida)


n = int(input())
arr = list(input())
cnt = {'a': 0, 'b': 0}
cnt[arr[0]] += 1
result = 0
for i in range(1, n):
	if cnt['a'] > cnt['b'] and arr[i] == 'a':
		result += 1
		cnt['b'] += 1
		arr[i] = 'b'
	elif cnt['a'] > cnt['b'] and arr[i] != 'a':
		cnt['b'] += 1
	elif cnt['a'] < cnt['b'] and arr[i] == 'b':
		result += 1
		cnt['a'] += 1
		arr[i] = 'a'
	elif cnt['a'] < cnt['b'] and arr[i] != 'b':
		cnt['a'] += 1
	else:
		cnt[arr[i]] += 1
print(result)
print(''.join(arr))


d = dict()
d['a'] = 'b'
d['b'] = 'a'
N = int(input())
frase = input()
new = list()
cont = 0
tam = len(frase)
for i in range(0, tam, 2):
	if frase[i] == frase[i + 1]:
		cont += 1
		new.append(d[frase[i]])
		new.append(frase[i + 1])
	else:
		new.append(frase[i])
		new.append(frase[i + 1])
print(cont)
print(''.join(new))


import sys
r = sys.stdin.readline
n = int(r())
s = r()[:-1]
(c, f) = (0, '')
for i in range(n // 2):
	if s[i * 2] == s[i * 2 + 1]:
		c += 1
		f += s[i * 2]
		f += 'a' if s[i * 2 + 1] == 'b' else 'b'
	else:
		f += s[i * 2] + s[i * 2 + 1]
print(c)
print(f)


import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def wr(arr):
	return ' '.join(map(str, arr))

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def revn(n):
	m = 0
	while n > 0:
		m = m * 10 + n % 10
		n = n // 10
	return m
n = ii()
s = input()
ans = 0
t = list(s)
for i in range(0, n, 2):
	if s[i:i + 2] == 'aa' or s[i:i + 2] == 'bb':
		ans += 1
		t[i] = 'a'
		t[i + 1] = 'b'
print(ans)
print(''.join(t))


n = int(input())
s = input()
ans = []
c = 0
i = 0
j = 1
while i < n - 1:
	if s[i] == s[j]:
		c += 1
		ans.append('a')
		ans.append('b')
	else:
		ans.append(s[i])
		ans.append(s[j])
	i += 2
	j += 2
print(c)
for i in range(n):
	print(ans[i], end='')


n = int(input())
s = list(input())
ans = 0
for i in range(0, n - 1, 2):
	x = s[i]
	y = s[i + 1]
	if x == 'a' and y == 'a' or (x == 'b' and y == 'b'):
		if x == 'a':
			s[i + 1] = 'b'
		else:
			s[i] = 'a'
		ans += 1
print(ans)
print(''.join(s))


def prefixes(n, string, count):
	if n == 2:
		if string[0] == 'a' and string[1] == 'a':
			count += 1
			string = string[0] + 'b'
			return [string, count]
		elif string[0] == 'b' and string[1] == 'b':
			count += 1
			string = string[0] + 'a'
			return [string, count]
		else:
			return [string, count]
	else:
		mid = n // 2
		if mid % 2 == 1:
			mid = mid - 1
		l = string[:mid]
		r = string[mid:]
		L = prefixes(len(l), l, count)
		R = prefixes(len(r), r, count)
		string2 = []
		merge2 = merge(L, R)
		string2.append(merge2[0])
		string2.append(merge2[1])
		return string2

def output(n, string, count):
	out = prefixes(n, string, count)
	return str(out[1]) + '\n' + out[0]

def merge(L, R):
	return [L[0] + R[0], L[1] + R[1]]
n = int(input())
string = str(input())
count = 0
print(output(n, string, count))


n = int(input())
s = list(input())
moves = 0
a = 0
b = 0
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
		moves += 1
print(moves)
print(*s, sep='')


n = int(input())
s = input()
s_list = [0 if i == 'a' else 1 for i in s]
s_list_changes = [(s_list[i * 2] + s_list[i * 2 + 1] + 1) % 2 for i in range(int(n / 2))]
print(sum([(s_list[i * 2] + s_list[i * 2 + 1] + 1) % 2 for i in range(int(n / 2))]))
print(''.join([('b' if i % 2 else 'a') if s_list_changes[i // 2] else s[i] for i in range(n)]))


(n, s) = (int(input()), input())
size = len(s)
k = []
count = 0
i = 0
while i < size:
	k.append(s[i])
	if size > i + 1 and s[i] == s[i + 1] and (s[i] == 'a'):
		k.append('b')
		count += 1
	elif size > i + 1 and s[i] == s[i + 1] and (s[i] == 'b'):
		k.append('a')
		count += 1
	else:
		k.append(s[i + 1])
	i += 2
print('{}\n{}'.format(count, ''.join(k)))


import os
import heapq
import sys
import bisect
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def inar():
	return [int(k) for k in input().split()]

def main():
	n = int(input())
	st = list(input())
	ans = 0
	for i in range(1, n, +2):
		if st[i] != st[i - 1]:
			continue
		else:
			if st[i] == 'a':
				st[i] = 'b'
			else:
				st[i] = 'a'
			ans += 1
	print(ans)
	print(''.join(st))
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())
a = list(input().strip())
c = 0
for i in range(1, n, 2):
	if a[i - 1] == 'b' and a[i] == 'a' or (a[i - 1] == 'a' and a[i] == 'b'):
		continue
	else:
		c += 1
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
print(c)
print(''.join(a))


n = int(input())
s = input()
l = list()
ans = 0
x = 'a'
y = 'b'
i = 0
while i < n - 1:
	x = s[i]
	y = s[i + 1]
	if x == y:
		l.append('a')
		l.append('b')
		ans += 1
	else:
		l.append(s[i])
		l.append(s[i + 1])
	i += 2
print(ans)
print(''.join(l))


n = int(input())
strings = str(input())
answer = list()
count = 0
for (i, string) in enumerate(strings):
	if i % 2 == 0:
		old = string
		answer.append(string)
	if i % 2 == 1:
		if old == string:
			if old == 'a':
				answer.append('b')
			else:
				answer.append('a')
			count += 1
		else:
			answer.append(string)
print(count)
print(''.join(answer))


def tostring(ls):
	st = ''
	for i in ls:
		st = st + i
	return st
n = int(input())
s = list(input())
cng = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		cng = cng + 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
print(cng)
print(tostring(s))


L = int(input())
Sa = ' '
s = list(map(str, input()))
t = 0
m = 0
Sb = ''
while t < len(s):
	if (s[t] == 'a' and s[t + 1] == 'b' or (s[t] == 'b' and s[t + 1] == 'a')) == False:
		if s[t] == 'a':
			s[t] = 'b'
			Sb = Sb + 'ba'
		else:
			s[t] = 'a'
			Sb = Sb + 'ab'
		m = m + 1
	else:
		Sb = Sb + (s[t] + s[t + 1])
	t = t + 2
print(m)
print(Sb)


n = int(input())
s1 = [*input()]
count = 0
for i in range(0, n, 2):
	if s1[i] == s1[i + 1]:
		count = count + 1
		s1[i:i + 2] = 'ab'
print(count)
print(''.join(s1))


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

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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

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

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

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

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

def S():
	return input()

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

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		a = [c for c in S()]
		r = 0
		for i in range(0, n, 2):
			if a[i] != a[i + 1]:
				continue
			r += 1
			a[i + 1] = chr(ord('a') + ord('b') - ord(a[i]))
		rr.append(r)
		rr.append(JA(a, ''))
	return JA(rr, '\n')
print(main())


n = int(input())
s = input()
t = []
cost = 0
for i in range(0, n, 2):
	c = s[i]
	d = s[i + 1]
	if c == d:
		cost += 1
		t += ['a', 'b']
	else:
		t += [c, d]
print(cost)
print(''.join(t))


from sys import stdin

def main():
	n = int(stdin.readline().strip())
	string = list(stdin.readline().strip())
	(a, b, i, ans) = (0, 0, 0, 0)
	for i in range(len(string)):
		if string[i] == 'a':
			a += 1
		else:
			b += 1
		if i % 2 != 0 and a != b:
			ans += 1
			if string[i] == 'a':
				string[i] = 'b'
			else:
				string[i] = 'a'
			(a, b) = (0, 0)
	print(ans)
	for c in string:
		print(c, end='')
	print('')
main()


n = int(input())
s = input()
count = 0
ans = ''
for i in range(0, len(s), 2):
	if s[i:i + 2] == 'ab' or s[i:i + 2] == 'ba':
		ans += s[i:i + 2]
	else:
		ans += 'ab'
		count += 1
print(count)
print(ans)


n = int(input())
stroka = [x for x in input()] + ['a', 'b']
result = ''
res = 0
for x in range(n // 2):
	sli = stroka[x * 2:x * 2 + 2]
	if sli == ['a', 'b'] or sli == ['b', 'a']:
		continue
	elif sli == ['b', 'b']:
		stroka[x * 2] = 'a'
		res += 1
	else:
		stroka[x * 2] = 'b'
		res += 1
result = ''.join(stroka[0:-2])
print(res)
print(result)


n = int(input())
l = list(input())
a = 0
for i in range(0, n, 2):
	if l[i] == 'a' and l[i + 1] == 'a' or (l[i] == 'b' and l[i + 1] == 'b'):
		if l[i] == 'a':
			l[i] = 'b'
			a += 1
		else:
			l[i] = 'a'
			a += 1
print(a)
print(*l, sep='')


input()
cntb = cnta = cntr = 0
ans = ''
for (i, s) in enumerate(input()):
	if i % 2:
		ps = s
		s = 'b' if cnta > cntb else 'a'
		if ps != s:
			cntr += 1
	if s == 'a':
		cnta += 1
	else:
		cntb += 1
	ans += s
print(cntr, ans, sep='\n')


R = lambda : map(int, input().split())
n = int(input())
s = [i for i in input()]
res = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		res += 1
		if s[i] == 'a':
			s[i] = 'b'
		elif s[i] == 'b':
			s[i] = 'a'
print(res)
print(''.join(s))


n = int(input())
s = input()
(ans, counter) = ('', 0)
for j in range(0, n + 1, 2):
	string = s[j:j + 2]
	for i in range(len(string) - 1):
		if string[i] == 'a':
			if string[i + 1] != 'b':
				counter += 1
				ans += string[i] + 'b'
			else:
				ans += string[i] + string[i + 1]
		elif string[i] == 'b':
			if string[i + 1] != 'a':
				counter += 1
				ans += string[i] + 'a'
			else:
				ans += string[i] + string[i + 1]
print(counter)
if counter == 0:
	print(s)
else:
	print(ans)


n = int(input())
l1 = list(input())
c = 0
i = 0
while i < n - 1:
	if l1[i] == l1[i + 1]:
		if l1[i + 1] == 'a':
			l1[i + 1] = 'b'
			c += 1
		else:
			l1[i + 1] = 'a'
			c += 1
	i += 2
print(c)
k = ''.join([str(a) for a in l1])
print(k)


n = int(input())
s = input()
l = list(s)
c = 0
for i in range(0, n, 2):
	if l[i] == l[i + 1]:
		l[i] = chr(195 - ord(l[i]))
		c = c + 1
print(c)
print(''.join(l))


n = int(input())
string = input()
string = list(string)
op = 0
for i in range(0, n, 2):
	if string[i] == 'a' and string[i + 1] == 'a':
		string[i + 1] = 'b'
		op += 1
	elif string[i] == 'b' and string[i + 1] == 'b':
		string[i + 1] = 'a'
		op += 1
tr = ''
tr = tr.join(string)
print(op)
print(tr)


n = int(input())
s = str(input())
ans = 0
l = list(s)
s1 = ''
s2 = 'ab'
for i in range(0, n, 2):
	if l[i] == l[i + 1]:
		ans += 1
		s1 = s1 + s2
	else:
		s1 = s1 + str(l[i]) + str(l[i + 1])
print(ans)
print(s1)


n = int(input())
text = list(input())
cnt = 0
res = []
a = 0
b = 0
for i in range(len(text)):
	if i % 2 == 1:
		if text[i] == text[i - 1]:
			if text[i] == 'a':
				cnt += 1
				res.append('b')
				b += 1
			else:
				cnt += 1
				res.append('a')
				a += 1
		else:
			res += text[i]
	else:
		res.append(text[i])
		if text[i] == 'a':
			a += 1
		else:
			b += 1
print(cnt)
print(''.join(res))


def main():
	length = int(input())
	word = input()
	list_word = list(word)
	i = 0
	j = 2
	operations = 0
	while j <= length:
		if list_word[i] == list_word[j - 1]:
			operations += 1
			if list_word[i] is 'a':
				list_word[i] = 'b'
			else:
				list_word[i] = 'a'
		i = j
		j += 2
	print(operations)
	print(''.join(list_word))
	return
main()


n = int(input())
k = input()
s = list(k)
c = 0
for i in range(0, n - 1, 2):
	if s[i] == 'a':
		if s[i + 1] == 'b':
			continue
		else:
			s[i + 1] = 'b'
			c += 1
	elif s[i + 1] == 'a':
		continue
	else:
		s[i + 1] = 'a'
		c += 1
l = ''
l = l.join(s)
print(c)
print(l)


input()
s = input()
ans = 0
l = list(s)
for i in range(len(l) // 2):
	if l[2 * i + 1] == l[2 * i]:
		ans += 1
		if l[2 * i] == 'a':
			l[2 * i] = 'b'
		else:
			l[2 * i] = 'a'
print(ans, ''.join(l), sep='\n')


n = int(input())
a = list(input())
counter = 0
for i in range(0, n, 2):
	if a[i] == a[i + 1] == 'a':
		a[i] = 'b'
		counter += 1
	elif a[i] == a[i + 1] == 'b':
		a[i] = 'a'
		counter += 1
print(counter)
for item in a:
	print(item, end='')


def findOps(string, n):
	l = 1
	idx = 0
	res = list(string)
	ops = 0
	while l != n + 1:
		l1 = res[l - 1]
		l2 = res[l]
		if l1 == l2:
			if l1 == 'a':
				ops = ops + 1
				res[l - 1] = 'b'
			elif l1 == 'b':
				ops = ops + 1
				res[l - 1] = 'a'
		l = l + 2
	print(ops)
	for i in res:
		print(i, end='')
n = int(input())
string = str(input())
findOps(string, n)


len = int(input())
a = input()
a = list(a)
count = 0
for i in range(0, len, 2):
	if a[i] == a[i + 1]:
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
		count += 1
	else:
		continue
print(count)
print(*a, sep='')


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

def reverse(c):
	if c == 'b':
		return 'a'
	if c == 'a':
		return 'b'
count = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		s[i] = reverse(s[i])
		count += 1
print(count)
print(''.join(s))


n = int(input())
A = list(input())
(a, b) = (0, 0)
result = 0
D = {'a': 'b', 'b': 'a'}
for i in range(0, len(A), 2):
	if A[i] == A[i + 1]:
		result += 1
		A[i] = D[A[i]]
print(result)
print(''.join(A))


t = int(input())
a = input()
b = list(a)
k = 0
for i in range(0, t, 2):
	c = b[i:i + 2]
	if c.count('a') == 0:
		b[i] = 'a'
		k += 1
	elif c.count('a') == 2:
		b[i + 1] = 'b'
		k += 1
print(k)
print(''.join(b))


n = int(input())
s = input()
s = list(s)
cnta = 0
cntb = 0
cnt = 0
for i in range(0, n):
	if s[i] == 'a':
		cnta = cnta + 1
	else:
		cntb = cntb + 1
	if i % 2 == 1:
		if cnta == 2:
			s[i] = 'b'
			cnt = cnt + 1
		if cntb == 2:
			s[i] = 'a'
			cnt = cnt + 1
		cnta = 0
		cntb = 0
print(cnt)
for i in range(0, n):
	print(s[i], end='')
print()


l = int(input())
s = input()
d = []
count = 0
for i in range(1, l, 2):
	d.append(s[i - 1])
	if s[i] == d[i - 1]:
		if s[i] == 'a':
			d.append('b')
			count += 1
		else:
			d.append('a')
			count += 1
	else:
		d.append(s[i])
print(count)
for i in d:
	print(i, end='')


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
n = read_int()
s = [c for c in input().strip()]
count = 0
for i in range(1, n):
	if i % 2 == 1:
		if s[i] == s[i - 1]:
			count += 1
			s[i] = 'a' if s[i] == 'b' else 'b'
print(count)
print(''.join(s))


import sys
i = sys.stdin.readline
c = int(i())
a = i()
d = list(a)
count = 0
for k in range(0, c, 2):
	if d[k] == d[k + 1]:
		count += 1
		if d[k] == 'a':
			d[k + 1] = 'b'
		else:
			d[k + 1] = 'a'
print(count)
for k in d:
	print(k, end='')


n = int(input())
s = list(input())
ans = 0
cnta = cntb = 0
for i in range(n):
	if s[i] == 'a':
		cnta += 1
	else:
		cntb += 1
	if (i + 1) % 2 == 0:
		if cnta > cntb:
			s[i] = 'b'
			cntb += 1
			cnta -= 1
			ans += 1
		elif cntb > cnta:
			s[i] = 'a'
			cnta += 1
			cntb -= 1
			ans += 1
print(ans)
print(''.join(s))


n = int(input())
ans = 0
f = -1
l = list(input())
for t in range(0, n - 1, 2):
	if l[t] == 'a' and l[t + 1] == 'a':
		ans += 1
		l[t] = 'b'
	elif l[t] == 'b' and l[t + 1] == 'b':
		ans += 1
		l[t + 1] = 'a'
print(ans)
print(*l, sep='')


n = int(input())
s = input()
c = ''
l = 0
for i in range(0, len(s), 2):
	if s[i] == 'a':
		c += 'a'
		if s[i + 1] != 'b':
			l += 1
			c += 'b'
		else:
			c += s[i + 1]
	else:
		c += 'b'
		if s[i + 1] != 'a':
			l += 1
			c += 'a'
		else:
			c += s[i + 1]
print(l)
print(c)


n = int(input())
s = input()
l = list(s)
c = 0
s1 = ''
for i in range(0, len(l), 2):
	if l[i] == l[i + 1] and l[i] == 'a':
		l[i] = 'b'
		c += 1
	elif l[i] == l[i + 1] and l[i] == 'b':
		l[i] = 'a'
		c += 1
	else:
		continue
for i in l:
	s1 = s1 + i
print(c, sep='\n')
print(s1)


def f(x):
	if x == 'a':
		return 'b'
	return 'a'
n = int(input())
s = input()
ans = 0
res = ''
for i in range(n // 2):
	(a, b) = (s[2 * i], s[2 * i + 1])
	res += a
	if a == b:
		ans += 1
		res += f(b)
	else:
		res += b
print(ans)
print(res)


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)
a = list(input())
ans = 0
for i in range(0, n, 2):
	if a[i] != a[i + 1]:
		pass
	else:
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
		ans += 1
print(ans)
print(''.join(a))


n = int(input(''))
a = input('')
c = 0
ans = ''
for i in range(0, n, 2):
	if a[i] == 'a' and a[i + 1] == 'b':
		ans = ans + 'ab'
	if a[i:i + 2] == 'ba':
		ans = ans + 'ba'
	if a[i:i + 2] == 'aa' or a[i:i + 2] == 'bb':
		c = c + 1
		ans = ans + 'ab'
print(c)
print(ans)


n = int(input())
l = list(input())
count = 0
for i in range(0, n, 2):
	if l[i] == l[i + 1]:
		l[i] = chr(1 - ord(l[i]) + 2 * ord('a'))
		count += 1
print(count)
print(''.join(l))


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip()
ans = ''
c = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			ans += 'ba'
		else:
			ans += 'ba'
		c += 1
	else:
		ans += s[i] + s[i + 1]
print(c)
print(ans)


n = int(input())
s = input()
s = list(s)
res = 0
for i in range(n // 2):
	x = s[2 * i + 0]
	y = s[2 * i + 1]
	if x != y:
		continue
	elif x == 'a' and y == 'a':
		s[2 * i + 0] = 'b'
		res += 1
	elif x == 'b' and y == 'b':
		s[2 * i + 0] = 'a'
		res += 1
print(res)
print(''.join(s))


a = int(input())
s = input()
a1 = 0
b1 = 0
a2 = 0
b2 = 0
ans1 = []
ans2 = []
c1 = 0
ans = []
for i in range(len(s) // 2):
	t = s[2 * i]
	x = s[2 * i + 1]
	if t != x:
		ans.append(t)
		ans.append(x)
	else:
		c1 += 1
		if x == 'a':
			ans.append(t)
			ans.append('b')
		else:
			ans.append(t)
			ans.append('a')
print(c1)
print(''.join(map(str, ans)))


n = int(input())
s = input()
l = list(s)
k = 0
i = 2
t = 0
f = 0
while 1:
	a = l[k:i]
	av = a.count('a')
	bs = a.count('b')
	if n == 2:
		if av == bs:
			f = 1
			print(0, s)
			break
		else:
			f = 1
			print(1, 'ab', sep='\n')
			break
	elif av != bs:
		if av < bs:
			c = bs - av - 1
			v = 0
			for j in range(k, i):
				if l[j] == 'b':
					l[j] = 'a'
					t += 1
					v += 1
					if v == c:
						break
					else:
						v += 1
		if av > bs:
			c = av - bs - 1
			v = 0
			for j in range(k, i):
				if l[j] == 'a':
					l[j] = 'b'
					t += 1
					v += 1
					if v == c:
						break
					else:
						v += 1
	if i < n:
		i += 2
		k += 2
	else:
		break
if f == 0:
	print(t, ''.join(l), sep='\n')


n = int(input())
s = input()
cnt = 0
ans = ['a'] * n
i = 0
while i < n:
	ss = s[i:i + 2]
	if ss == 'aa' or ss == 'bb':
		(ans[i], ans[i + 1]) = ('a', 'b')
		cnt += 1
	else:
		(ans[i], ans[i + 1]) = (ss[0], ss[1])
	i += 2
print(cnt)
print(''.join(ans))


n = int(input())
s = input()
ops = 0
st = []
for i in range(2, n + 1, 2):
	st += list(s[i - 2:i])
	p = st[i - 2]
	if p == st[i - 1]:
		st[i - 2] = 'ab'.replace(p, '')
		ops += 1
s = ''.join((k for k in st))
print(ops)
print(s)


n = int(input())
arr = list(input())
cost = 0
for i in range(1, n, 2):
	if arr[i] == arr[i - 1]:
		if arr[i] == 'a':
			arr[i] = 'b'
		else:
			arr[i] = 'a'
		cost += 1
print(cost)
print(''.join(arr))


def prefixes(n, s):
	(t, result) = (list(s), 0)
	for i in range(1, n + 1, 2):
		if t[i - 1] == 'a' and t[i] != 'b':
			t[i] = 'b'
			result += 1
		if t[i - 1] != 'a' and t[i] == 'b':
			t[i - 1] = 'a'
			result += 1
	return (result, ''.join(t))
m = int(input())
z = input()
(l, k) = prefixes(m, z)
print(l)
print(k)


n = int(input())
l = input()
acnt = 0
bcnt = 0
ans = 0
s = list(l)
for i in range(n):
	if s[i] == 'a':
		acnt += 1
	if s[i] == 'b':
		bcnt += 1
	if (i + 1) % 2 == 0 and acnt != bcnt:
		if acnt > bcnt:
			acnt -= 1
			bcnt += 1
			s[i] = 'b'
			ans += 1
		if acnt < bcnt:
			acnt += 1
			bcnt -= 1
			s[i] = 'a'
			ans += 1
print(ans)
print(''.join(s))


n = int(input())
arr = list(input())
(aas, bbs) = (0, 0)
operations = 0
for i in range(0, len(arr)):
	if arr[i] == 'a':
		aas += 1
	else:
		bbs += 1
	if i % 2 != 0:
		if aas == bbs:
			pass
		else:
			operations += 1
			if bbs > aas:
				bbs -= 1
				aas += 1
				if arr[i] == 'b':
					arr[i] = 'a'
				elif arr[i - 1] == 'b':
					arr[i - 1] = 'a'
			elif aas > bbs:
				aas -= 1
				bbs += 1
				if arr[i] == 'a':
					arr[i] = 'b'
				elif arr[i - 1] == 'a':
					arr[i - 1] = 'b'
print(operations)
print(''.join(arr))


input()
value = list(input())
(a, b) = (0, 0)
for i in range(0, len(value) - 1, 2):
	if value[i] == value[i + 1] and value[i] == 'a':
		a += 1
		value[i] = 'b'
	elif value[i] == value[i + 1] and value[i] == 'b':
		b += 1
		value[i] = 'a'
print(a + b)
print(''.join(value))


n = int(input())
sm = list(input())
amount = 0
for i in range(2, n + 1, 2):
	ads = sm[i - 2:i].count('a')
	bs = sm[i - 2:i].count('b')
	if ads == bs:
		continue
	if ads > bs:
		j = i - 2
		while j < i and bs < ads:
			if sm[j] == 'a':
				sm[j] = 'b'
				bs += 1
				ads -= 1
				j += 1
				amount += 1
	else:
		j = i - 2
		while j < i and ads < bs:
			if sm[j] == 'b':
				sm[j] = 'a'
				ads += 1
				bs -= 1
				j += 1
				amount += 1
print(amount)
print(''.join(sm))


from math import *
from sys import *
from heapq import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def alldivisors(n):
	list = []
	arr = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				arr += [i]
			else:
				arr += [i]
				list.append(n // i)
	arr += list[::-1]
	return arr

def primefactorisation(n):
	potentional_p = 3
	itog_list = defaultdict(int)
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			itog_list[n] += 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			itog_list[potentional_p] += 1
		potentional_p += 2
	return itog_list

def main():
	n = int(input())
	s = list(input())
	temp = ''
	val = 0
	for i in range(0, n, 2):
		if s[i] + s[i + 1] == 'aa':
			val += 1
			s[i + 1] = 'b'
		elif s[i] + s[i + 1] == 'bb':
			val += 1
			s[i] = 'a'
	print(val)
	print(''.join(s))
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.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())
a = str(input())
a1 = list()
for i in a:
	a1.append(i)
result = 0
for i in range(0, n - 1, 2):
	if a1[i] == a1[i + 1]:
		result = result + 1
		if a1[i] == 'a':
			a1[i] = 'b'
		else:
			a1[i] = 'a'
print(result)
for i in range(n):
	print(a1[i], end='')


def main():
	n = int(input())
	arr = list(input())
	count = 0
	for i in range(1, n, 2):
		if arr[i - 1] == arr[i]:
			if arr[i] == 'a':
				arr[i] = 'b'
			else:
				arr[i] = 'a'
			count += 1
	print(count)
	print(''.join(arr))
main()


N = int(input())
S = list(input())
k = N // 2
ans = 0
T = ''
for i in range(k):
	if S[2 * i] == S[2 * i + 1]:
		ans += 1
		T += 'ab'
	else:
		T += S[2 * i] + S[2 * i + 1]
print(ans)
print(T)


n = int(input())
frase = str(input())
vetor = []
for i in range(len(frase)):
	vetor.append(frase[i])
counter = 0
for j in range(0, len(frase), 2):
	if vetor[j] == vetor[j + 1]:
		if vetor[j] == 'b':
			vetor[j] = 'a'
			counter += 1
		else:
			vetor[j] = 'b'
			counter += 1
	else:
		continue
pal = str(''.join(vetor))
print(counter)
print(pal)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
n = ini()
s = list(ins())
ans = 0
for i in range(0, n - 1, 2):
	if s[i] == s[i + 1]:
		ans += 1
		s[i] = 'a' if s[i] != 'a' else 'b'
print(ans)
out(s, '')


n = int(input())
s = list(input())
(j, cnt) = (0, 0)
while j < n:
	if s[j] == 'a' and s[j + 1] == 'a':
		s[j + 1] = 'b'
		cnt += 1
	elif s[j] == 'b' and s[j + 1] == 'b':
		s[j] = 'a'
		cnt += 1
	j += 2
print(cnt)
print(*s, sep='')


tamstring = int(input())
string = input()
trocas = 0
stringfim = ''
for i in range(0, tamstring - 1, 2):
	if string[i] == 'a' and string[i + 1] == 'a' or (string[i] == 'b' and string[i + 1] == 'b'):
		stringfim += 'a'
		stringfim += 'b'
		trocas += 1
	else:
		stringfim += string[i]
		stringfim += string[i + 1]
print(trocas)
print(stringfim)


b'\nimport sys\nimport re\npattern = r"\x08(.+)\x01\x08"\nfor line in sys.stdin:\n    line = line.rstrip()\n    if re.search(pattern, line):\n        print(line)\n'
n = int(input())
s = input()
answer = []
for j in s:
	answer.append(j)
i = 0
count = 0
while i < n:
	if answer[i] == answer[i + 1]:
		if answer[i] == 'a':
			answer[i] = 'b'
		else:
			answer[i] = 'a'
		count += 1
	i += 2
print(count)
for k in answer:
	print(k, end='')


n = int(input())
s = input()
k = 0
ss = ''
for i in range(0, len(s), 2):
	if s[i] == s[i + 1]:
		if s[i] == 'a':
			ss = ss + s[i] + 'b'
		else:
			ss = ss + s[i] + 'a'
		k = k + 1
	else:
		ss = ss + s[i] + s[i + 1]
print(k)
if k == 0:
	print(s)
else:
	print(ss)


n = int(input())
s = list(input())
i = 0
count = 0
while i < n:
	if s[i] + s[i + 1] != 'ab':
		if s[i] + s[i + 1] != 'ba':
			count = count + 1
			s[i] = 'a'
			s[i + 1] = 'b'
	i = i + 2
print(count)
for i in s:
	print(i, end='')


n = int(input())
s = str(input())
l = len(s)
k = 0
ans = 0
ss = ''
while k < l:
	if s[k] == s[k + 1]:
		ans += 1
		ss = ss + 'ab'
	else:
		ss = ss + s[k:k + 2]
	k += 2
print(ans)
print(ss)


n = int(input())
v = list(input())
dic = {}
dic['a'] = 'b'
dic['b'] = 'a'
cont = 0
for i in range(1, n, 2):
	if v[i] == v[i - 1]:
		v[i] = dic[v[i]]
		cont += 1
print(cont)
print(''.join(v))


n = int(input())
s = input()
l = list(s)
i = 0
ct = 0
while i < len(l):
	l1 = []
	if i + 1 >= len(l):
		break
	l1.append(l[i])
	l1.append(l[i + 1])
	if l1.count('a') != l1.count('b'):
		ct = ct + 1
		if l[i] == 'a':
			l[i] = 'b'
		elif l[i] == 'b':
			l[i] = 'a'
	if i + 2 < len(l):
		i = i + 2
	else:
		break
s1 = ''
for i in range(len(l)):
	s1 = s1 + l[i]
print(ct)
print(s1)


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from fractions import Fraction
import math

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

def si():
	return str(input())

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

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

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

def fsi():
	return str(stdin.readline())

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

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

def getKey(item):
	return item[0]

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

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

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

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

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

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

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)
from collections import defaultdict

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y, z) = mi()
		if x not in d:
			d[x] = [[z, y]]
		else:
			d[x].append([z, y])
		if y not in d:
			d[y] = [[z, x]]
		else:
			d[y].append([z, x])
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n + 1):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime
n = ii()
s = list(si())
count = 0
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'a':
		count += 1
		s[i + 1] = 'b'
	elif s[i] == 'b' and s[i + 1] == 'b':
		count += 1
		s[i + 1] = 'a'
print(count)
print(''.join(s))


n = int(input())
s = input()
cnt = 0
ans = ['' for i in range(n)]
for i in range(0, n, 2):
	temp = s[i:i + 2]
	if temp == 'aa' or temp == 'bb':
		ans[i] = 'a'
		ans[i + 1] = 'b'
		cnt += 1
	else:
		ans[i] = s[i]
		ans[i + 1] = s[i + 1]
print(cnt)
print(''.join(ans))


(n, a, b) = (int(input()), 0, 0)
s = input()
tot = 0
l = list(s)
for i in range(len(s)):
	if s[i] == 'a':
		a += 1
	else:
		b += 1
	if i & 1:
		tot += 1
		if a > b:
			a -= 1
			b += 1
			l[i] = 'b'
		elif b > a:
			a += 1
			b -= 1
			l[i] = 'a'
		else:
			tot -= 1
print(tot)
print(''.join(l))


n = int(input())
s = str(input())
k = 0
a = []
for i in range(0, n, 2):
	if s[i] == 'a':
		if s[i] == s[i + 1]:
			k += 1
		a.append('a')
		a.append('b')
	if s[i] == 'b':
		if s[i] == s[i + 1]:
			k += 1
		a.append('b')
		a.append('a')
print(k)
print(''.join(a))


a = int(input(''))
h = input('')
x = 2
k = 0
b = []
for i in range(0, a, 1):
	b.append(h[i])
while x <= a:
	c = d = 0
	for i in range(x - 2, x, 1):
		if b[i] == 'a':
			c += 1
		elif b[i] == 'b':
			d += 1
	if c > d:
		k += 1
		for i in range(x - 2, x, 1):
			if b[i] == 'a':
				b[i] = 'b'
				break
	elif d > c:
		k += 1
		for i in range(x - 2, x, 1):
			if b[i] == 'b':
				b[i] = 'a'
				break
	elif d == c:
		k += 0
	x += 2
print(k)
for i in range(0, a, 1):
	print(b[i], end='')


import math
inarr = lambda : map(int, input().split())
for _ in range(1):
	n = int(input())
	s = list(input())
	i = 0
	ans = 0
	while i < len(s):
		if s[i] == 'a' and s[i + 1] != 'b':
			ans += 1
			s[i + 1] = 'b'
		elif s[i] == 'b' and s[i + 1] != 'a':
			ans += 1
			s[i + 1] = 'a'
		i += 2
	print(ans)
	for i in s:
		print(i, end='')


n = int(input())
s = input()
li = list(s)
count = 0
for i in range(0, n, 2):
	if li[i] == li[i + 1]:
		if li[i] == 'a':
			li[i] = 'b'
		else:
			li[i] = 'a'
		count += 1
print(count)
for ele in li:
	print(ele, end='')


n = input()
s = list(input())
count = 0
for i in range(len(s) // 2):
	group = ['a', 'b']
	if s[2 * i + 1] == s[2 * i]:
		group.remove(s[2 * i])
		s[2 * i + 1] = group[0]
		count += 1
print(count)
print(''.join(s))


n = int(input())
x = input()
ar = []
f = ''
s = 0
for i in x:
	ar.append(i)
for j in range(0, n, 2):
	if ar[j] == 'a' and ar[j + 1] == 'b' or (ar[j] == 'b' and ar[j + 1] == 'a'):
		continue
	else:
		if ar[j] == 'a':
			ar[j] = 'b'
		else:
			ar[j] = 'a'
		s = s + 1
print(s)
print(f.join(ar))


n = int(input())
s = input()
i = 0
(s1, s2) = ('ab', 'ba')
ans = 0
res = ''
while i < n:
	cur = s[i] + s[i + 1]
	(res1, res2) = (0, 0)
	for j in range(2):
		if cur[j] != s1[j]:
			res1 += 1
	for j in range(2):
		if cur[j] != s2[j]:
			res2 += 1
	ans += min(res1, res2)
	if res1 < res2:
		res += s1
	else:
		res += s2
	i += 2
print(ans, res, sep='\n')


n = int(input())
s = input()
count = 0
counta = 0
countb = 0
for i in range(n):
	if s[i] == 'a':
		counta += 1
	elif s[i] == 'b':
		countb += 1
l = list(s)
i = 1
cek = n / 2
while i <= cek:
	if s[n - 1] == 'a' and s[n - 2] == 'a' or (s[n - 1] == 'b' and s[n - 2] == 'b'):
		if s[n - 1] == 'a' and s[n - 2] == 'a':
			l[n - 1] = 'b'
			count += 1
		if s[n - 1] == 'b' and s[n - 2] == 'b':
			l[n - 1] = 'a'
			count += 1
	n -= 2
	i += 1
print(str(count))
print(''.join(l))


from sys import stdin
input = stdin.readline
n = int(input())
s = list(input().strip())
c = 0
for i in range(1, n, 2):
	if s[i] == s[i - 1]:
		c += 1
		s[i - 1] = 'a' if s[i] == 'b' else 'b'
print(c)
print(''.join(s))


x = int(input())
s = input()
output = ''
i = 0
count = 0
while i < len(s):
	if s[i] == s[i + 1]:
		count += 1
		if s[i] == 'a':
			output += 'b'
			output += 'a'
		else:
			output += 'a'
			output += 'b'
	else:
		output += s[i]
		output += s[i + 1]
	i += 2
print(count)
print(output)


n = int(input())
s = list(input())
l1 = ''
count = 0
l1 += s[0]
a = l1.count('a')
b = l1.count('b')
for i in range(1, n):
	if (i + 1) % 2 == 1:
		l1 += s[i]
		if s[i] == 'a':
			a += 1
		else:
			b += 1
	elif a > b:
		if s[i] == 'a':
			l1 += 'b'
			b += 1
			count += 1
		else:
			l1 += 'b'
			b += 1
	elif b > a:
		if s[i] == 'b':
			l1 += 'a'
			a += 1
			count += 1
		else:
			l1 += 'a'
			a += 1
print(count)
print(l1)


n = int(input())
a = input()
count = 0
op = ''
for i in range(0, n, 2):
	if a[i] == a[i + 1]:
		count += 1
		temp = 'b' if a[i] == 'a' else 'a'
		op += a[i] + temp
	else:
		op += a[i] + a[i + 1]
print(count)
print(op)


data = int(input())
name = input()
le = len(name)
ans = 0
s = list(name)
for i in range(0, le, 2):
	sub1 = s[i]
	sub2 = s[i + 1]
	if sub1 == sub2:
		ans += 1
		if sub1 == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
name = ''.join(s)
print(ans)
print(name)


def chunk_str(str, chunk_size):
	return [str[i:i + chunk_size] for i in range(0, len(str), chunk_size)]

def Prefixes(string_length, string):
	string_length = int(string_length)
	steps = 0
	List = []
	List.extend(chunk_str(string, 2))
	for pref in range(len(List)):
		if 'a' in List[pref] and 'b' in List[pref]:
			pass
		else:
			List[pref] = 'ab'
			steps += 1
	print(steps)
	print(''.join(List))
Prefixes(input(), input())


n = int(input())
s = input()
(t, i, count) = ('', 0, 0)
while i < n - 1:
	if s[i:i + 2] != 'ab' and s[i:i + 2] != 'ba':
		t += 'ab'
		count += 1
	else:
		t += s[i:i + 2]
	i += 2
print(count)
print(t)


n = int(input())
s = input()
count = 0
A = [0 for i in range(n)]
for i in range(len(A)):
	A[i] = s[i]
for i in range(0, len(A), 2):
	if A[i] == 'a':
		if A[i] == 'a' and A[i + 1] == 'a':
			A[i + 1] = 'b'
			count += 1
	elif A[i] == 'b' and A[i + 1] == 'b':
		A[i + 1] = 'a'
		count += 1
print(count)
print(''.join(A))


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

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

def sin():
	return input()

def inin():
	return int(input())

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

def main():
	n = inin()
	s = sin()
	s = list(s)
	c = 0
	for i in range(n):
		if i % 2 == 1:
			if s[i] == 'a':
				if s[i - 1] == 'a':
					s[i - 1] = 'b'
					c += 1
			if s[i] == 'b':
				if s[i - 1] == 'b':
					s[i - 1] = 'a'
					c += 1
	print(c)
	print(*s, sep='')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

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


n = int(input())
s = list(input())
ans = 0
for i in range(1, n, 2):
	if s[i - 1] != s[i]:
		continue
	ans += 1
	s[i] = 'ab'[s[i - 1] == 'a']
print(ans)
print(''.join(s))


n = int(input())
word = list(map(str, input()))
count = 0
for i in range(0, n, 2):
	if word[i] + word[i + 1] == 'ab' or word[i] + word[i + 1] == 'ba':
		pass
	elif word[i] + word[i + 1] == 'aa':
		count += 1
		word[i + 1] = 'b'
	else:
		count += 1
		word[i + 1] = 'a'
print(count)
print(''.join((str(x) for x in word)))


n = map(int, input().split())
s = list(input())
a = b = ch = 0
pos = 1
res = s
for c in s:
	if c is 'a':
		a += 1
	else:
		b += 1
	if pos % 2 is 0:
		if a < b:
			res[pos - 1] = 'a'
			ch += 1
			a += 1
			b -= 1
		elif b < a:
			res[pos - 1] = 'b'
			ch += 1
			b += 1
			a -= 1
	pos += 1
print(ch)
print(''.join(res))


(n, s, c) = (int(input()), list(input()), 0)
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		(c, s[i]) = (c + 1, chr(ord(s[i]) ^ 3))
print(str(c) + '\n' + ''.join(s))


n = int(input())
a = input()
b = list(a)
t = 0
for i in range(0, len(b) - 1, 2):
	if b[i] == b[i + 1] == 'b':
		b[i] = 'a'
		t += 1
	elif b[i] == b[i + 1] == 'a':
		b[i] = 'b'
		t += 1
print(t)
print(''.join(b))


n = int(input())
string = list(input())
isa = False
counter = 0
for i in range(0, len(string), 2):
	if string[i] == 'a':
		if string[i + 1] != 'b':
			string[i + 1] = 'b'
			counter += 1
	elif string[i + 1] == 'b':
		if string[i + 1] != 'a':
			string[i + 1] = 'a'
			counter += 1
print(counter)
for i in string:
	print(i, end='')


n = int(input())
string = input()
counter = 0
res = ''
for i in range(len(string) // 2):
	(s, t) = (string[2 * i], string[2 * i + 1])
	if s == t:
		res += 'ab'
		counter += 1
	else:
		res += s + t
print(counter)
print(res)


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

def num():
	return int(input())
n = num()
s = input()
ans = []
q = 0
ab = ['a', 'b']
for (a, b) in zip(s[::2], s[1::2]):
	ans.append(a)
	if a == b:
		q += 1
		ans.append(ab[((a == 'b') + 1) % 2])
	else:
		ans.append(b)
print(q)
print(''.join(ans))


import sys
from functools import reduce
from collections import Counter
import time
import datetime
import math

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

def sip():
	return input()

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

def mips():
	return map(str, sys.stdin.readline().split())

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

def slip():
	return list(map(str, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

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

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = ip()
s = sip()
new = ''
flag = 0
count = 0
val = 0
for i in range(n):
	if i % 2 == 0:
		if s[i] == 'a' and s[i + 1] == 'b':
			new += 'ab'
		elif s[i] == 'b' and s[i + 1] == 'a':
			new += 'ba'
		elif s[i] == 'b' and s[i + 1] == 'b':
			count += 1
			new += 'ab'
		elif s[i] == 'a' and s[i + 1] == 'a':
			new += 'ab'
			count += 1
print(count)
print(new)


def main():
	n = int(input())
	s = list(input())
	a = 0
	b = 0
	ans = 0
	for i in range(n):
		if s[i] == 'a':
			a += 1
		else:
			b += 1
		if i % 2 != 0:
			if a > b:
				s[i] = 'b'
				b += 1
				a -= 1
				ans += 1
			elif b > a:
				s[i] = 'a'
				a += 1
				b -= 1
				ans += 1
	print(ans)
	for i in s:
		print(i, end='')
main()


t = int(input())
s = input()
res = 0
l = list(s)
for i in range(0, len(s) - 1, 2):
	if s[i] == s[i + 1]:
		res += 1
		l[i] = 'a'
		l[i + 1] = 'b'
print(res)
print(''.join(l))


lens = int(input())
strs = input()
anss = ''
need = 0
for i in range(0, lens, 2):
	if strs[i] == strs[i + 1]:
		need += 1
		anss += ['b', 'a'][strs[i] == 'b']
		anss += strs[i + 1]
	else:
		anss += strs[i] + strs[i + 1]
print(need)
print([anss, strs][need == 0])


n = int(input())
letters = [char for char in input()]
changes = 0
res = []
curr = 0
while curr < n:
	one = letters[curr]
	two = letters[curr + 1]
	res.append(one)
	if one == two:
		changes += 1
		if two == 'a':
			res.append('b')
		else:
			res.append('a')
	else:
		res.append(two)
	curr += 2
print(changes)
print(''.join(res))


def modify(n, s):
	count = [0, 0]
	operations = 0
	newString = []
	chars = ['a', 'b']
	for i in range(n):
		count[ord(s[i]) - ord('a')] += 1
		if i & 1:
			if count[0] != count[1]:
				newString.append(chars[count[0] > count[1]])
				operations += 1
			else:
				newString.append(s[i])
			count = [0, 0]
		else:
			newString.append(s[i])
	return (operations, ''.join(newString))
n = int(input())
s = input()
(o, ns) = modify(n, s)
print(o, ns, sep='\n')


n = int(input())
s = input()
s_m = ''
c = 0
for i in range(0, n, 2):
	p = s[i:i + 2]
	if p in ['ab', 'ba']:
		s_m += p
	else:
		c += 1
		s_m += 'ab'
print(c)
print(s_m)


n = int(input())
x = input()
y = list(x)
count = 0
for i in range(0, n, 2):
	if 'ab' in x[i:i + 2] or 'ba' in x[i:i + 2]:
		continue
	else:
		count += 1
		if x[i:i + 2] == 'aa':
			y[i] = 'b'
		else:
			y[i] = 'a'
print(count)
print(''.join(y))


def soln() -> None:

	def logic() -> None:
		n = int(input())
		arr = list(input())
		cnt = 0
		for i in range(0, n, 2):
			if arr[i] == arr[i + 1]:
				if arr[i] == 'a':
					arr[i] = 'b'
					cnt += 1
				else:
					arr[i] = 'a'
					cnt += 1
		print(cnt)
		print(''.join(arr))
	logic()
soln()


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

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

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

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

def S():
	return input()

def main():
	n = I()
	s = S()
	ans = 0
	ans_str = ''
	for i in range(n // 2):
		ac = bc = 0
		x = ''
		for j in range(i * 2, i * 2 + 2):
			x += s[j]
			if s[j] == 'a':
				ac += 1
			else:
				bc += 1
		if abs(ac - bc) == 2:
			ans += 1
			ans_str += 'ab'
		else:
			ans_str += x
	print(ans)
	print(ans_str)
main()


import sys
import math
import collections
import bisect
import string

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

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

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	string = list(get_string())
	a = 0
	b = 0
	ans = 0
	for i in range(n):
		if string[i] == 'a':
			a += 1
		else:
			b += 1
		if i % 2 == 1:
			if a == b:
				continue
			if a > b:
				string[i] = 'b'
				a -= 1
				b += 1
				ans += 1
			else:
				string[i] = 'a'
				b -= 1
				a += 1
				ans += 1
	print(ans)
	print(*string, sep='')


n = int(input())
s = input()
s_list = [i for i in s]
count = 0
out_s = []
for i in range(0, n - 1, 2):
	sub = s_list[i:i + 2]
	if sub == ['a', 'a'] or sub == ['b', 'b']:
		count += 1
		out_s.extend(['a', 'b'])
	else:
		out_s.extend(sub)
print(count)
print(''.join(out_s))


input()
s = input()
changes = 0
balance = 0
res = []
for i in range(len(s)):
	balance += 1 if s[i] == 'a' else -1
	res.append(s[i])
	if i % 2 == 1 and balance != 0:
		changes += 1
		res[-1] = chr(ord('a') + ord('b') - ord(res[-1]))
		balance = 0
print(changes)
print(''.join(res))


n = int(input())
s = list(input())
ans = 0
for i in range(0, n, 2):
	pos1 = i
	pos2 = i + 1
	if (s[pos1] == 'a' or s[pos2] == 'a') and (s[pos1] == 'b' or s[pos2] == 'b'):
		pass
	elif s[pos1] == 'a' or s[pos2] == 'a':
		ans += 1
		s[pos1] = 'b'
	elif s[pos1] == 'b' or s[pos2] == 'b':
		ans += 1
		s[pos1] = 'a'
print(ans)
print(''.join(s))


n = int(input())
s = input()
t = ''
kq = 0
i = 0
while i < n:
	if s[i:i + 2] == 'ab' or s[i:i + 2] == 'ba':
		t = t + s[i:i + 2]
	else:
		t = t + 'ab'
		kq += 1
	i += 2
print(kq)
print(t)


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline()
q = ''
chet = 0
for i in range(1, n, 2):
	if s[i] == s[i - 1]:
		q += 'ab'
		chet += 1
	else:
		q += s[i - 1:i + 1]
sys.stdout.write(str(chet) + '\n' + q)


n = int(input())
s = input()
ans = ''
suma = 0
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'a':
		ans += 'ab'
		suma += 1
	elif s[i] == 'b' and s[i + 1] == 'b':
		ans += 'ba'
		suma += 1
	else:
		ans += s[i:i + 2]
print(suma)
print(ans)


n = int(input())
s = input()
total = 0
i = 0
z = ''
while i < n - 1:
	if s[i] == s[i + 1]:
		z += 'ab'
		total += 1
	else:
		z += s[i] + s[i + 1]
	i += 2
print(total)
print(z)


n = int(input())
arr = list(input().strip())
ans = 0
for i in range(0, n, 2):
	if arr[i] == 'a' and arr[i + 1] == 'a':
		arr[i] = 'b'
		ans += 1
	elif arr[i] == 'b' and arr[i + 1] == 'b':
		arr[i] = 'a'
		ans += 1
print(ans)
print(''.join(arr))


n = int(input())
s = input()
l = []
count = 0
i = 0
while i + 1 < n:
	l.append([s[i], s[i + 1]])
	i += 2
for i in range(len(l)):
	if len(set(l[i])) == 1:
		count += 1
		if l[i][0] == 'a':
			l[i][0] = 'b'
		else:
			l[i][0] = 'a'
print(count)
s1 = ''
for i in range(len(l)):
	s1 += l[i][0] + l[i][1]
print(s1)


n = int(input())
s = input()
t = ''
d = 0
dd = 0
dem = 0
for i in range(n):
	if s[i] == 'a':
		d += 1
	else:
		dd += 1
	if i % 2 == 1:
		if d != dd:
			if s[i] == 'a':
				t += 'b'
			else:
				t += 'a'
			dem += 1
		else:
			t += s[i]
		d = 0
		dd = 0
	else:
		t += s[i]
print(dem)
print(t)


n = int(input())
m = [str(i) for i in input()]
a = 0
b = 0
k = 0
for i in range(n):
	if i % 2:
		if a > b:
			if m[i] == 'a':
				k += 1
				m[i] = 'b'
		elif m[i] == 'b':
			k += 1
			m[i] = 'a'
	if m[i] == 'a':
		a += 1
	else:
		b += 1
print(k)
for i in m:
	print(i, end='')


n = int(input())
s = list(input())
pocet = 0
for i in range(n // 2):
	if s[2 * i] != s[2 * i + 1]:
		continue
	else:
		pocet += 1
		if s[2 * i] == 'a':
			s[2 * i] = 'b'
		else:
			s[2 * i] = 'a'
print(pocet)
print(''.join(s))


l = int(input())
s = list(input().strip())
ct = 0
for i in range(0, l - 1, 2):
	if s[i] == s[i + 1]:
		ct += 1
		if s[i] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
print(ct)
print(''.join(s))


Len = int(input())
S = str(input())
i = 0
ans = 0
SS = ''
while i < Len:
	if i & 1 == 1 and S[i] == S[i - 1]:
		ans += 1
		if S[i - 1] == 'a':
			SS += 'b'
		else:
			SS += 'a'
	else:
		SS += S[i]
	i += 1
print(ans)
print(SS)


from sys import setcheckinterval, stdin, setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10 ** 7)

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

def lin():
	return list(map(int, stdin.readline().split()))
n = iin()
s = list(input())
ca = 0
cb = 0
pva = -1
pvb = -1
ans = 0
for i in range(n):
	if s[i] == 'a':
		ca += 1
		pva = i
	else:
		cb += 1
		pvb = i
	if i % 2 and ca != cb:
		ans += 1
		if ca < cb:
			s[pvb] = 'a'
			cb -= 1
			ca += 1
		else:
			s[pva] = 'b'
			ca -= 1
			cb += 1
print(ans)
print(''.join(s))


P = int(input())
p = ''
S = list(map(str, input()))
s = 0
c = 0
st = ''
while s < len(S):
	if (S[s] == 'a' and S[s + 1] == 'b' or (S[s] == 'b' and S[s + 1] == 'a')) == False:
		if S[s] == 'a':
			S[s] = 'b'
			st += 'ba'
		else:
			S[s] = 'a'
			st += 'ab'
		c += 1
	else:
		st += S[s] + S[s + 1]
	s += 2
print(c)
print(st)


x = eval(input())
y = list(input())
a = 0
for i in range(int(x / 2)):
	if y[2 * i] == y[2 * i + 1] and y[2 * i] == 'a':
		a += 1
		y[2 * i] = 'b'
	elif y[2 * i] == y[2 * i + 1] and y[2 * i] == 'b':
		a += 1
		y[2 * i] = 'a'
print(a)
print(''.join(y))


l = int(input())
s = list(input())
replace_map = {'a': 'b', 'b': 'a'}
ops = 0
for i in range(0, l, 2):
	if s[i] == s[i + 1]:
		ops += 1
		s[i] = replace_map[s[i]]
print(ops)
print(''.join(s))


n = input()
string = input()
changes = 0
output = ''
for i in range(0, len(string), 2):
	if string[i] == string[i + 1]:
		changes += 1
		if string[i] == 'a':
			output += 'ba'
		else:
			output += 'ab'
	else:
		output += string[i] + string[i + 1]
print(changes)
print(output)


def sol(l, s):
	n = 0
	out = ''
	for i in range(0, l, 2):
		if s[i] == s[i + 1]:
			n = n + 1
			out = out + s[i]
			if s[i] == 'a':
				out = out + 'b'
			else:
				out = out + 'a'
		else:
			out = out + s[i:i + 2]
	return (n, out)
l = int(input())
s = input()
(a, b) = sol(l, s)
print(a)
print(b)


n = int(input())
s = input().strip()
cnt = 0
l = []
for i in range(0, n, 2):
	if s[i:i + 2] == 'aa' or s[i:i + 2] == 'bb':
		cnt += 1
		l.append('ab')
	else:
		l.append(s[i:i + 2])
print(cnt)
print(''.join(l))


n = int(input())
a = list(input())
(l, r) = (0, 2)
count = 0
while r <= n:
	(count_a, count_b) = (0, 0)
	for el in a[l:r]:
		if el == 'a':
			count_a += 1
		else:
			count_b += 1
	diff = abs(count_a - count_b)
	if diff > 0:
		if a[l] == 'b':
			a[l] = 'a'
		else:
			a[l] = 'b'
		count += 1
	l += 2
	r += 2
print(count)
print(''.join(a))


length = int(input())
string = input()
operations = 0
altered = []
for i in range(0, length, 2):
	if string[i] == string[i + 1]:
		operations += 1
	if string[i] == 'a':
		altered.append('ab')
	else:
		altered.append('ba')
print(operations)
print(''.join(altered))


n = int(input())
str = input()
res = list()
count = 0
final = list()
for i in str:
	if len(res) == 0:
		res.append(i)
		continue
	elif res[len(res) - 1] != i:
		res.append(i)
		final.append(res[0])
		final.append(res[1])
		del res[:]
		continue
	else:
		if i == 'a':
			res.append('b')
		else:
			res.append('a')
		final.append(res[0])
		final.append(res[1])
		del res[:]
		count += 1
print(count)
print(''.join(final))


input()
s = input()
g = 0
sas = [i for i in s]
for i in range(len(s) // 2):
	if s[i * 2] == s[i * 2 + 1]:
		g += 1
		if s[i * 2] == 'a':
			sas[i * 2 + 1] = 'b'
		else:
			sas[i * 2 + 1] = 'a'
print(g)
print(*sas, sep='')


def invert_letter(l):
	if l == 'a':
		return 'b'
	else:
		return 'a'
n = input()
s = input()
new_s = []
counter = 0
has_a = False
has_b = False
for i in range(0, len(s)):
	if i % 2 == 0:
		has_a = s[i] == 'a'
		has_b = s[i] == 'b'
		new_s.append(s[i])
	else:
		double_a = s[i] == 'a' and has_a
		double_b = s[i] == 'b' and has_b
		if double_a or double_b:
			counter = counter + 1
			new_s.append(invert_letter(s[i]))
		else:
			new_s.append(s[i])
		has_a = False
		has_b = False
print(counter)
for i in new_s:
	print(i, end='')
print()


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(1):
	n = int(input())
	a = list(input())
	ans = 0
	for x in range(0, n, 2):
		if a[x] == 'a' and a[x + 1] == 'a' or (a[x] == 'b' and a[x + 1] == 'b'):
			ans += 1
			if a[x] == 'a':
				a[x] = 'b'
			else:
				a[x] = 'a'
	print(ans)
	print(''.join(a))


n = int(input())
ss = input()
s = list(ss)
sum = 0
for i in range(0, len(s)):
	if i % 2 != 0:
		if s[i] == s[i - 1]:
			if s[i] == 'a':
				s[i] = 'b'
			else:
				s[i] = 'a'
			sum = sum + 1
print(sum)
ss = ''.join(s)
print(ss)


n = int(input())
s = list(input())
c = 0
for i in range(1, n, 2):
	a = s[i]
	if a == 'a':
		j = 1
	else:
		j = -1
	if s[i - 1] == a:
		s[i - 1] = chr(ord(a) + j)
		c += 1
print(c)
print(''.join(s))


def f():
	t = int(input())
	string = input()
	string = list(string)
	i = 0
	c = 0
	length = len(string)
	while i < length:
		if string[i] == string[i + 1]:
			c += 1
			if string[i] == 'a':
				string[i] = 'b'
			else:
				string[i] = 'a'
		i += 2
	string = ''.join(string)
	print(c)
	print(string)
f()


n = int(input())
s = list(input())
count = 0
for i in range(0, n, 2):
	if s[i] == 'a' and s[i + 1] == 'b':
		pass
	elif s[i] == 'b' and s[i + 1] == 'a':
		pass
	else:
		count += 1
		if s[i] == 'b':
			s[i + 1] = 'a'
		else:
			s[i + 1] = 'b'
print(count)
print(''.join(s))


from sys import stdin, stdout
(n, s, cnt) = (int(stdin.readline()), list(stdin.readline()), 0)
for i in range(1, n, 2):
	(s[i], cnt) = (('a', cnt + 1) if s[i] == 'b' else ('b', cnt + 1)) if s[i] == s[i - 1] else (s[i], cnt)
stdout.write(''.join([str(cnt) + '\n'] + s))


n = int(input())
word = list(input())
count = 0
for i in range(0, n, 2):
	(curr, nxt) = (word[i], word[i + 1])
	if curr == nxt and curr == 'b':
		count = count + 1
		word[i] = 'a'
	if curr == nxt and curr == 'a':
		count = count + 1
		word[i] = 'b'
print(str(count))
print(''.join(word))


n = int(input())
s = list(input())
p = 0
for x in range(0, n, 2):
	if s[x] == 'a' and s[x + 1] == 'a':
		p += 1
		s[x + 1] = 'b'
	if s[x] == 'b' and s[x + 1] == 'b':
		p += 1
		s[x + 1] = 'a'
print(p)
print(*s, sep='')


n = int(input())
s = input()
nb = 0
ch1 = ''
for i in range(1, n, 2):
	ch = s[i - 1] + s[i]
	if ch.count('a') > ch.count('b') or ch.count('a') < ch.count('b'):
		ch1 = ch1 + 'a' + 'b'
		nb = nb + 1
	else:
		ch1 = ch1 + ch
print(nb)
print(ch1)


n = int(input())
s = input()
changes = 0
answer = ''
index = 0
while index < len(s):
	ss = s[index:index + 2]
	if ss == 'aa' or ss == 'bb':
		changes += 1
		answer += 'ab'
	else:
		answer += ss
	index += 2
print(changes)
print(answer)


n = int(input())
x = input()
d = ''
ans = 0
for i in range(0, n - 1, 2):
	r = x[i:i + 2]
	if r == 'aa':
		d = d + 'ab'
		ans = ans + 1
	elif r == 'bb':
		d = d + 'ba'
		ans = ans + 1
	else:
		d = d + r
		continue
print(ans)
print(d)


l = int(input())
s = list(' ' + input())
c = 0
for i in range(1, l // 2 + 1):
	f = 2 * i
	x = s[f - 1:f + 1]
	a = x.count('a')
	b = x.count('b')
	if a != b:
		c += 1
		if s[2 * i] == 'b':
			s[2 * i] = 'a'
		else:
			s[2 * i] = 'b'
print(c)
print(''.join(s[1:]))


n = int(input())
s = input()
a = []
for i in range(n):
	a.append(s[i])
c = 0
for i in range(0, n, 2):
	if a[i] == a[i + 1]:
		c = c + 1
		if a[i] == 'a':
			a[i] = 'b'
		elif a[i] == 'b':
			a[i] = 'a'
print(c)
print(''.join(a))


def solve(n, s):
	i = 0
	diff = 0
	while i != n:
		if s[i] == s[i + 1]:
			if s[i] == 'a':
				s[i] = 'b'
				diff += 1
				i += 2
			else:
				s[i] = 'a'
				diff += 1
				i += 2
		else:
			i += 2
			continue
	print(diff)
	print(''.join(s))
	return
n = int(input())
s = list(input())
solve(n, s)


input()
s = input()
s = list(s)
if not len(s):
	print(0)
	print(s)
elif len(s) == 2:
	if s[0] == s[1]:
		if s[0] == 'a':
			print(1)
			print('ba')
		else:
			print(1)
			print('ab')
	else:
		print(0)
		print(s)
else:
	operations = 0
	n = len(s) // 2
	for i in range(n):
		index = i * 2
		if s[index] == s[index + 1]:
			operations += 1
			if i == n - 1:
				if s[index + 1] == 'a':
					s[index + 1] = 'b'
				else:
					s[index + 1] = 'a'
			elif s[index] == 'a':
				s[index] = 'b'
			else:
				s[index] = 'a'
	print(operations)
	print(''.join(s))


n = int(input())
s = input()
(a, ans) = ([], 0)
for i in range(0, n, 2):
	if s[i] + s[i + 1] == 'ab':
		a.append('ab')
	elif s[i] + s[i + 1] == 'ba':
		a.append('ba')
	elif s[i] + s[i + 1] == 'aa' or s[i] + s[i + 1] == 'bb':
		ans += 1
		a.append('ab')
print(ans)
print(*a, sep='')


n = int(input())
aa = input()
a = []
for i in aa:
	a.append(i)
alll = 0
for i in range(n // 2):
	k = a[i * 2:(i + 1) * 2]
	ha = k.count('a')
	hb = k.count('b')
	if ha != hb:
		if ha > hb:
			alll += 1
			a[i * 2] = 'b'
		else:
			alll += 1
			a[i * 2] = 'a'
print(alll)
print(''.join(a))


n = int(input())
s = input()
err = 0
i = 1
r = []
while i < n:
	r.append(s[i - 1])
	if s[i] == s[i - 1]:
		err += 1
		if s[i] == 'a':
			r.append('b')
		else:
			r.append('a')
	else:
		r.append(s[i])
	i += 2
print(err)
print(''.join(r))


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
n = ii()
s = [x for x in input()]
r = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		r += 1
		s[i] = 'a' if s[i] == 'b' else 'b'
print(r)
print(''.join(s))


n = int(input())
st = list(input())
ar = []
a = 0
b = 0
total = 0
for i in range(len(st)):
	if st[i] == 'a':
		a += 1
	else:
		b += 1
	if i % 2 == 1 and a - b != 0:
		if st[i] == 'b':
			st[i - 1] = 'a'
		else:
			st[i - 1] = 'b'
		total += 1
		a = 0
		b = 0
print(total)
print(''.join(st))


n = int(input())
a = input()
a = list(a)
count = 0
i = 0
while i < n:
	if a[i] == 'a':
		if a[i + 1] == 'b':
			i += 2
			continue
		else:
			a[i + 1] = 'b'
			count += 1
	elif a[i] == 'b':
		if a[i + 1] == 'a':
			i += 2
			continue
		else:
			a[i + 1] = 'a'
			count += 1
	i += 2
print(count)
print(''.join(a))


n = int(input())
s = input()
co = 0
res = []
for i in range(n // 2):
	if s[2 * i] == s[2 * i + 1]:
		res.append('a')
		res.append('b')
		co += 1
	else:
		res.append(s[2 * i])
		res.append(s[2 * i + 1])
print(co)
for i in res:
	print(i, end='')


import sys
from collections import Counter

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

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

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

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

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
S = list(input())
cnt = 0
for i in range(0, N, 2):
	if S[i] == S[i + 1] == 'a':
		S[i] = 'b'
		cnt += 1
	elif S[i] == S[i + 1] == 'b':
		S[i] = 'a'
		cnt += 1
print(cnt)
print(''.join(S))


n = int(input())
s = input()
ans = 0
ans_string = ''
for i in range(0, n, 2):
	(mm, nn) = s[i:i + 2]
	if mm is 'a' and nn is 'b' or (mm is 'b' and nn is 'a'):
		ans_string += mm + nn
	else:
		ans += 1
		ans_string += 'a' + 'b'
print(ans)
print(ans_string)


import sys
input = lambda : sys.stdin.readline().strip()

def opp(s):
	if s == 'a':
		return 'b'
	else:
		return 'a'
n = int(input())
s = list(input())
cnt = 0
for i in range(0, n, 2):
	if s[i] != opp(s[i + 1]):
		cnt += 1
		s[i] = opp(s[i + 1])
print(cnt)
print(''.join(s))


n = int(input())
s = input()
ops = 0
a = []
for i in range(2, n + 2, 2):
	if sorted(s[i - 1] + s[i - 2]) != ['a', 'b']:
		ops += 1
		a += ['a', 'b']
	else:
		a += [s[i - 2], s[i - 1]]
print(ops)
print(''.join(a))


len_string = int(input())
s = input()
ans = ''
exchange = 0
for i in range(0, len_string, 2):
	if s[i] == s[i + 1]:
		exchange += 1
		ans += 'ab'
	else:
		ans += s[i:i + 2]
print(exchange)
print(ans)


n = int(input())
s = input()
l = list(s.strip())
countA = 0
countB = 0
count = 0
for i in range(len(s)):
	if l[i] == 'a':
		countA += 1
	else:
		countB += 1
	if i % 2 != 0:
		if countA < countB:
			l[i] = 'a'
			countA += 1
			countB -= 1
			count += 1
		elif countA > countB:
			l[i] = 'b'
			countA -= 1
			countB += 1
			count += 1
print(count)
print(''.join(l))


from math import ceil
n = int(input())
s = list(input())
count = 0
for i in range(0, n, 2):
	if s[i] == s[i + 1]:
		s[i] = chr(1 - ord(s[i]) + 2 * ord('a'))
		count += 1
print(count)
print(''.join(s))


n = int(input())
s = input()
k = 0
i = 0
l = list(s)
while i < n - 1:
	if l[i] == l[i + 1]:
		k += 1
		if l[i + 1] == 'b':
			l[i + 1] = 'a'
		else:
			l[i + 1] = 'b'
	i += 2
s = ''.join(l)
print(k)
print(s)


def check(i, str1):
	if str1[i] == str1[i - 1]:
		return True
	return False
N = int(input())
str1 = str(input())
count = 0
rs = []
for i in range(1, N, 2):
	rs.append(str1[i - 1])
	if check(i, str1):
		count += 1
		if str1[i] == 'a':
			rs.append('b')
		else:
			rs.append('a')
	else:
		rs.append(str1[i])
print(count)
for e in rs:
	print(e, end='')
print()


n = int(input())
s = input()
t = str()
change = 0
for (x, y) in zip(s[::2], s[1::2]):
	if x == y:
		change += 1
		t += 'ab'
	else:
		t += x + y
print(change)
print(t)


n = int(input())
a = list(input())
k = 0
for i in range(n - 1):
	if i == n - 2 and a[i] == a[i + 1]:
		k += 1
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
	elif i % 2 != 0 and a[i] == a[i - 1]:
		if a[i] == 'a':
			a[i] = 'b'
		else:
			a[i] = 'a'
		k += 1
print(k)
print(''.join(a))


import sys, math, queue
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
n = int(input())
s = input()
x = list(s)
a = 0
for i in range(0, n, 2):
	if s[i] == 'a':
		if s[i + 1] != 'b':
			a += 1
			x[i + 1] = 'b'
	elif s[i + 1] != 'a':
		a += 1
		x[i + 1] = 'a'
print(a)
print(''.join(x))


n = int(input())
string = input()
count = 0
s = []
out = [string[i:i + 2] for i in range(0, n, 2)]
for subs in out:
	if subs.count('a') < subs.count('b'):
		subs = subs.replace('b', 'a', 1)
		count += 1
	if subs.count('a') > subs.count('b'):
		subs = subs.replace('a', 'b', 1)
		count += 1
	s.append(subs)
s = ''.join(s)
print(count)
print(s)


n = int(input())
stream = input()
ans = ''
cnt = 0
for i in range(0, n - 1, 2):
	tmp = stream[i:i + 2]
	if tmp == 'aa' or tmp == 'bb':
		cnt += 1
		ans += 'ab'
	else:
		ans += tmp
print(cnt)
print(ans)


n = int(input())
s = input()
cost = 0
result = []
for i in range(0, n, 2):
	if s[i:i + 2] == 'aa' or s[i:i + 2] == 'bb':
		result.append('ab')
		cost += 1
	else:
		result.append(s[i:i + 2])
print(cost)
print(''.join(result))


n = int(input())
s = list(input())
cnt = 0
for i in range(0, n // 2 * 2, 2):
	s1 = ''.join(s[i:i + 2])
	if not (s1 == 'ab' or s1 == 'ba'):
		if s1[0] == 'a':
			s[i + 1] = 'b'
		else:
			s[i + 1] = 'a'
		cnt += 1
print(cnt)
print(''.join(s))


def solve(l):
	counter = 0
	for i in range(0, len(l), 2):
		if l[i] in ['a']:
			if l[i + 1] in ['b']:
				continue
			else:
				l[i + 1] = 'b'
				counter += 1
		elif l[i] in ['b']:
			if l[i + 1] in ['a']:
				continue
			else:
				l[i + 1] = 'a'
				counter += 1
	print(counter)
	print(''.join(l))

def main():
	n = int(input())
	solve(list(input()))
main()