AtCoder Grand Contest 041 - Domino Quality

Let us consider a grid of squares with N rows and N columns. You want to put some domino pieces on this grid. Each domino piece covers two squares that have a common side. Each square can be covered by at most one piece.

For each row of the grid, let's define its quality as the number of domino pieces that cover at least one square in this row. We define the quality of each column similarly.

Find a way to put at least one domino piece on the grid so that the quality of every row is equal to the quality of every column, or determine that such a placement doesn't exist.

Constraints

* 2 \le N \le 1000

Input

Input is given from Standard Input in the following format:


N


Output

If the required domino placement doesn't exist, print a single integer `-1`.

Otherwise, output your placement as N strings of N characters each. If a square is not covered, the corresponding character must be `.` (a dot). Otherwise, it must contain a lowercase English letter. Squares covered by the same domino piece must contain the same letter. If two squares have a common side but belong to different pieces, they must contain different letters.

Examples

Input

6


Output

aabb..
b..zz.
ba....
.a..aa
..a..b
..a..b


Input

2


Output

-1

Source: atcoder | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
n = int(input())
s3 = ['abb', 'a.d', 'ccd']
s = [['abcc', 'abdd', 'ddba', 'ccba'], ['dccdd', 'daa.c', 'c..bc', 'c..bd', 'ddccd'], ['abbc..', 'a.ac..', 'bba.cc', 'a..aab', 'a..b.b', '.aabaa'], ['aba....', 'aba....', 'bab....', 'bab....', 'a..bbaa', 'a..aabb', '.aabbaa']]
if n == 2:
	print(-1)
elif n == 3:
	[print(x) for x in s3]
else:
	(d, m) = divmod(n, 4)
	d -= 1
	m += 4
	for i in range(d):
		[print('.' * 4 * i + x + '.' * (4 * (d - i - 1) + m)) for x in s[0]]
	[print('.' * 4 * d + x) for x in s[m - 4]]


n = int(input())
base = [['aabc', 'ddbc', 'bcaa', 'bcdd'], ['aabba', 'bcc.a', 'b..cb', 'a..cb', 'abbaa'], ['aabc..', 'ddbc..', '..aabc', '..ddbc', 'bc..aa', 'bc..dd'], ['aabbcc.', 'dd.dd.a', '..d..da', '..d..db', 'dd.dd.b', '..d..dc', '..d..dc']]
if n == 2:
	print(-1)
elif n == 3:
	print('.aa')
	print('a..')
	print('a..')
else:
	(div, mod) = (n // 4 - 1, n % 4 + 4)
	for i in range(div):
		for j in base[0]:
			print('.' * i * 4 + j + '.' * ((div - i - 1) * 4 + mod))
	for i in base[mod - 4]:
		print('.' * div * 4 + i)


N = int(input())
if N == 2:
	print(-1)
	exit()
if N == 3:
	print('aa.\n..b\n..b')
	exit()
P4 = 'abcc\nabdd\nccab\nddab'
P5 = 'abbaa\na..db\nb..db\nbcc.a\naabba'
P6 = 'aa.ccd\n..bd.d\n..bdcc\nccdaa.\nd.d..b\ndcc..b'
P7 = '.ccbbaa\nc...ccd\nc...d.d\nb...dcc\nbccd...\nad.d...\nadcc...'
P = [P4, P5, P6, P7]

def construct(L):
	P_split = [p.split() for p in P]
	ans = []
	offset = 0
	for l in L:
		r = N - offset - l
		for p in P_split[l - 4]:
			ans.append('.' * offset + p + '.' * r)
		offset += l
	return '\n'.join(ans)

def sep(n):
	if n == 6:
		return [6]
	elif n == 7:
		return [7]
	elif n == 11:
		return [5, 6]
	res = [4] * (n // 4)
	for i in range(n % 4):
		res[i] += 1
	return res
print(construct(sep(N)))


n = int(input())
three_tmp = ['aac', 'b.c', 'bdd']
four_tmp = ['abcc', 'abdd', 'eegh', 'ffgh']
five_tmp = ['aabee', 'c.bff', 'cddgg', 'hij..', 'hij..']
seven_tmp = ['aa..dee', '.bb.d.f', '..ccggf', 'h.iil..', 'h...lm.', '...k.mn', 'jj.k..n']
if n == 2:
	print(-1)
elif n == 3:
	for x in three_tmp:
		print(x)
elif n == 4:
	for x in four_tmp:
		print(x)
elif n == 5:
	for x in five_tmp:
		print(x)
elif n == 6:
	for x in three_tmp:
		print(x + '.' * 3)
	for x in three_tmp:
		print('.' * 3 + x)
elif n == 7:
	for x in seven_tmp:
		print(x)
elif n == 8:
	for x in four_tmp:
		print(x + '.' * 4)
	for x in four_tmp:
		print('.' * 4 + x)
elif n == 11:
	for x in four_tmp:
		print(x + '.' * 7)
	for x in seven_tmp:
		print('.' * 4 + x)
else:
	res = n
	while res != 0:
		if res % 4 != 0:
			for x in five_tmp:
				print('.' * (n - res) + x + '.' * (res - 5))
			res -= 5
		else:
			for x in four_tmp:
				print('.' * (n - res) + x + '.' * (res - 4))
			res -= 4


import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
n = int(input())
pata = ['abb', 'a.c', 'ddc']
patb = ['abcc', 'abdd', 'eefg', 'hhfg']
patc = ['abbcc', 'ad..e', 'fd..e', 'f.ggh', 'iijjh']
patd = ['.aabbcc', 'a.ddee.', 'ad....d', 'bd....d', 'be....e', 'ce....e', 'c.ddee.']
pate = ['.aabbcc....', 'a.ddee.....', 'ad....d....', 'bd....d....', 'be....e....', 'ce....e....', 'c.ddee.....', '.......abcc', '.......abdd', '.......ccab', '.......ddab']
cnt = 0

def create_ab(w):
	val = [['.'] * w for _ in range(w)]
	ok = False
	for fives in range(200):
		if (w - fives * 5) % 4 == 0:
			fours = (w - fives * 5) // 4
			if fours >= 0:
				ok = True
				break
	if not ok:
		return None
	t = 0
	for i in range(fives):
		for (i, line) in enumerate(patc):
			for (j, ch) in enumerate(line):
				val[t + i][t + j] = ch
		t += 5
	for i in range(fours):
		for (i, line) in enumerate(patb):
			for (j, ch) in enumerate(line):
				val[t + i][t + j] = ch
		t += 4
	ret = []
	for line in val:
		ret.append(''.join([str(item) for item in line]))
	return ret

def solve(n):
	global cnt
	if n % 3 == 0:
		repeat = n // 3
		for i in range(repeat):
			for line in pata:
				print(line * repeat)
	elif n % 4 == 0:
		repeat = n // 4
		for i in range(repeat):
			for line in patb:
				print(line * repeat)
	elif n % 5 == 0:
		repeat = n // 5
		for i in range(repeat):
			for line in patc:
				print(line * repeat)
	elif n % 7 == 0:
		repeat = n // 7
		for i in range(repeat):
			for line in patd:
				print(line * repeat)
	elif n % 11 == 0:
		repeat = n // 11
		for i in range(repeat):
			for line in pate:
				print(line * repeat)
	else:
		ret = create_ab(n)
		if ret:
			for line in ret:
				print(line)
		else:
			cnt += 1
			print(-1)
solve(n)


import sys
input = sys.stdin.readline
n = int(input())
if n < 20:
	if n == 2:
		print(-1)
	elif n == 7:
		print('aabbcc.')
		print('dd.dd.a')
		print('..d..da')
		print('..d..db')
		print('dd.dd.b')
		print('..d..dc')
		print('..d..dc')
	elif n % 3 == 0:
		x = n // 3
		for i in range(x):
			print('...' * i + 'a..' + '...' * (x - 1 - i))
			print('...' * i + 'a..' + '...' * (x - 1 - i))
			print('...' * i + '.bb' + '...' * (x - 1 - i))
	elif n % 4 == 0:
		x = n // 4
		for i in range(x):
			print('....' * i + 'abcc' + '....' * (x - 1 - i))
			print('....' * i + 'abdd' + '....' * (x - 1 - i))
			print('....' * i + 'eegh' + '....' * (x - 1 - i))
			print('....' * i + 'ffgh' + '....' * (x - 1 - i))
	elif n % 5 == 0:
		x = n // 5
		for i in range(x):
			print('.....' * i + 'aabcc' + '.....' * (x - 1 - i))
			print('.....' * i + 'd.b.f' + '.....' * (x - 1 - i))
			print('.....' * i + 'd.eef' + '.....' * (x - 1 - i))
			print('.....' * i + 'gg.ij' + '.....' * (x - 1 - i))
			print('.....' * i + '.hhij' + '.....' * (x - 1 - i))
	elif n == 11:
		print('a..cee' + '.....')
		print('a..c.f' + '.....')
		print('.bbddf' + '.....')
		print('ceea..' + '.....')
		print('c.fa..' + '.....')
		print('ddf.bb' + '.....')
		print('......' + 'aabcc')
		print('......' + 'd.b.f')
		print('......' + 'd.eef')
		print('......' + 'gg.ij')
		print('......' + '.hhij')
	else:
		if n % 5 == 0:
			a = 0
			b = n // 5
		elif n % 5 == 1:
			a = 4
			b = (n - 16) // 5
		elif n % 5 == 2:
			a = 3
			b = (n - 12) // 5
		elif n % 5 == 3:
			a = 2
			b = (n - 8) // 5
		elif n % 5 == 4:
			a = 1
			b = (n - 4) // 5
		x = a
		for i in range(x):
			print('....' * i + 'abcc' + '....' * (x - 1 - i) + '.....' * b)
			print('....' * i + 'abdd' + '....' * (x - 1 - i) + '.....' * b)
			print('....' * i + 'eegh' + '....' * (x - 1 - i) + '.....' * b)
			print('....' * i + 'ffgh' + '....' * (x - 1 - i) + '.....' * b)
		x = b
		for i in range(x):
			print('....' * a + '.....' * i + 'aabcc' + '.....' * (x - 1 - i))
			print('....' * a + '.....' * i + 'd.b.f' + '.....' * (x - 1 - i))
			print('....' * a + '.....' * i + 'd.eef' + '.....' * (x - 1 - i))
			print('....' * a + '.....' * i + 'gg.ij' + '.....' * (x - 1 - i))
			print('....' * a + '.....' * i + '.hhij' + '.....' * (x - 1 - i))
else:
	if n % 5 == 0:
		a = 0
		b = n // 5
	elif n % 5 == 1:
		a = 4
		b = (n - 16) // 5
	elif n % 5 == 2:
		a = 3
		b = (n - 12) // 5
	elif n % 5 == 3:
		a = 2
		b = (n - 8) // 5
	elif n % 5 == 4:
		a = 1
		b = (n - 4) // 5
	x = a
	for i in range(x):
		print('....' * i + 'abcc' + '....' * (x - 1 - i) + '.....' * b)
		print('....' * i + 'abdd' + '....' * (x - 1 - i) + '.....' * b)
		print('....' * i + 'eegh' + '....' * (x - 1 - i) + '.....' * b)
		print('....' * i + 'ffgh' + '....' * (x - 1 - i) + '.....' * b)
	x = b
	for i in range(x):
		print('....' * a + '.....' * i + 'aabcc' + '.....' * (x - 1 - i))
		print('....' * a + '.....' * i + 'd.b.f' + '.....' * (x - 1 - i))
		print('....' * a + '.....' * i + 'd.eef' + '.....' * (x - 1 - i))
		print('....' * a + '.....' * i + 'gg.ij' + '.....' * (x - 1 - i))
		print('....' * a + '.....' * i + '.hhij' + '.....' * (x - 1 - i))


import sys
N = int(input())
ans = [['.'] * N for _ in range(N)]

def make4(a):
	for j in range(4):
		ans[a][a] = ans[a + 1][a] = 'a'
		ans[a][a + 1] = ans[a + 1][a + 1] = 'b'
		ans[a][a + 2] = ans[a][a + 3] = 'c'
		ans[a + 1][a + 2] = ans[a + 1][a + 3] = 'd'
		ans[a + 2][a] = ans[a + 2][a + 1] = 'e'
		ans[a + 3][a] = ans[a + 3][a + 1] = 'f'
		ans[a + 2][a + 2] = ans[a + 3][a + 2] = 'g'
		ans[a + 2][a + 3] = ans[a + 3][a + 3] = 'h'

def make6(a):
	ans[a + 3][a] = ans[a + 4][a] = 'a'
	ans[a][a + 3] = ans[a][a + 4] = 'a'
	ans[a + 5][a + 1] = ans[a + 5][a + 2] = 'b'
	ans[a + 1][a + 5] = ans[a + 2][a + 5] = 'b'
	ans[a][a] = ans[a + 1][a] = 'c'
	ans[a][a + 1] = ans[a][a + 2] = 'd'
	ans[a + 1][a + 2] = ans[a + 2][a + 2] = 'e'
	ans[a + 2][a] = ans[a + 2][a + 1] = 'f'
	ans[a + 3][a + 3] = ans[a + 4][a + 3] = 'c'
	ans[a + 3][a + 4] = ans[a + 3][a + 5] = 'd'
	ans[a + 4][a + 5] = ans[a + 5][a + 5] = 'e'
	ans[a + 5][a + 3] = ans[a + 5][a + 4] = 'f'

def make5(a):
	ans[a + 2][a + 1] = ans[a + 3][a + 1] = 'a'
	ans[a + 1][a + 2] = ans[a + 1][a + 3] = 'a'
	ans[a][a] = ans[a + 1][a] = 'b'
	ans[a + 2][a] = ans[a + 3][a] = 'c'
	ans[a + 4][a] = ans[a + 4][a + 1] = 'd'
	ans[a + 4][a + 2] = ans[a + 4][a + 3] = 'e'
	ans[a + 4][a + 4] = ans[a + 3][a + 4] = 'f'
	ans[a + 2][a + 4] = ans[a + 1][a + 4] = 'g'
	ans[a][a + 1] = ans[a][a + 2] = 'h'
	ans[a][a + 3] = ans[a][a + 4] = 'i'

def answer():
	for i in range(N):
		print(*ans[i], sep='')
if N == 1 or N == 2:
	print(-1)
elif N == 3:
	a = 0
	ans[a][a] = ans[a + 1][a] = 'c'
	ans[a][a + 1] = ans[a][a + 2] = 'd'
	ans[a + 1][a + 2] = ans[a + 2][a + 2] = 'e'
	ans[a + 2][a] = ans[a + 2][a + 1] = 'f'
	answer()
elif N == 7:
	print('.aabbcc', 'e.hhii.', 'ek....p', 'fk....p', 'fl....q', 'gl....q', 'g.mmnn.', sep='\n')
elif N % 2 == 0:
	if N % 4 == 0:
		for i in range(0, N, 4):
			make4(i)
		answer()
	else:
		make6(0)
		for i in range(6, N, 4):
			make4(i)
		answer()
else:
	make5(0)
	if (N - 5) % 4 == 0:
		for i in range(5, N, 4):
			make4(i)
	else:
		make6(5)
		for i in range(5 + 6, N, 4):
			make4(i)
	answer()


import sys
readline = sys.stdin.readline
imp = set([1, 2])
N = int(readline())
Five = set([5, 10, 14, 19, 23])
dot = ord('.')
if N in imp:
	print(-1)
else:
	G = [[dot] * N for _ in range(N)]
	if N == 7:
		G[0][0] = 97
		G[0][1] = 97
		G[0][2] = 98
		G[0][3] = 98
		G[1][1] = 99
		G[1][2] = 99
		G[2][2] = 100
		G[2][3] = 100
		G[0][6] = 101
		G[1][6] = 101
		G[1][5] = 102
		G[2][5] = 102
		G[2][6] = 103
		G[3][6] = 103
		G[3][4] = 104
		G[4][4] = 104
		G[3][0] = 105
		G[4][0] = 105
		G[5][0] = 106
		G[6][0] = 106
		G[4][1] = 107
		G[5][1] = 107
		G[5][4] = 108
		G[5][5] = 108
		G[6][3] = 109
		G[6][4] = 109
		G[6][5] = 110
		G[6][6] = 110
	elif N == 11:
		G[0][0] = 97
		G[0][1] = 97
		G[0][2] = 98
		G[0][3] = 98
		G[1][1] = 99
		G[1][2] = 99
		G[2][2] = 100
		G[2][3] = 100
		G[0][6] = 101
		G[1][6] = 101
		G[1][5] = 102
		G[2][5] = 102
		G[2][6] = 103
		G[3][6] = 103
		G[3][4] = 104
		G[4][4] = 104
		G[3][0] = 105
		G[4][0] = 105
		G[5][0] = 106
		G[6][0] = 106
		G[4][1] = 107
		G[5][1] = 107
		G[5][4] = 108
		G[5][5] = 108
		G[6][3] = 109
		G[6][4] = 109
		G[6][5] = 110
		G[6][6] = 110
		st = 7
		G[st][st] = 97
		G[st][st + 1] = 97
		G[st + 1][st] = 98
		G[st + 1][st + 1] = 98
		G[st + 2][st + 2] = 99
		G[st + 2][st + 3] = 99
		G[st + 3][st + 2] = 100
		G[st + 3][st + 3] = 100
		G[st + 2][st] = 101
		G[st + 3][st] = 101
		G[st + 2][st + 1] = 102
		G[st + 3][st + 1] = 102
		G[st][st + 2] = 103
		G[st + 1][st + 2] = 103
		G[st][st + 3] = 104
		G[st + 1][st + 3] = 104
	elif N in Five:
		for five in range(N):
			if (N - 5 * five) % 9 == 0:
				nine = (N - 5 * five) // 9
				break
		for i in range(five):
			st = i * 5
			for j in range(3):
				G[st + j][st] = 97 + j
				G[st + j][st + 1] = 97 + j
			G[st][st + 2] = 100
			G[st][st + 3] = 100
			G[st][st + 4] = 101
			G[st + 1][st + 4] = 101
			G[st + 2][st + 4] = 102
			G[st + 2][st + 3] = 102
			G[st + 2][st + 2] = 103
			G[st + 1][st + 2] = 103
			for j in range(3):
				G[st + 3][st + 2 + j] = 104 + j
				G[st + 4][st + 2 + j] = 104 + j
		geta = 5 * five
		for i in range(nine):
			st = geta + 9 * i
			for j in range(3):
				for k in range(3):
					G[st + 3 * j][st + 3 * k] = 97
					G[st + 3 * j][st + 3 * k + 1] = 97
					G[st + 3 * j + 1][st + 3 * k + 2] = 97
					G[st + 3 * j + 2][st + 3 * k + 2] = 97
	elif N % 3 == 0:
		for i in range(0, N, 3):
			G[i][i] = 97
			G[i][i + 1] = 97
			G[i + 1][i + 2] = 97
			G[i + 2][i + 2] = 97
	else:
		for nine in range(N):
			if (N - 9 * nine) % 4 == 0:
				four = (N - 9 * nine) // 4
				break
		for i in range(nine):
			st = i * 9
			for j in range(3):
				for k in range(3):
					G[st + 3 * j][st + 3 * k] = 97
					G[st + 3 * j][st + 3 * k + 1] = 97
					G[st + 3 * j + 1][st + 3 * k + 2] = 97
					G[st + 3 * j + 2][st + 3 * k + 2] = 97
		geta = 9 * nine
		for i in range(four):
			st = geta + i * 4
			G[st][st] = 97
			G[st][st + 1] = 97
			G[st + 1][st] = 98
			G[st + 1][st + 1] = 98
			G[st + 2][st + 2] = 99
			G[st + 2][st + 3] = 99
			G[st + 3][st + 2] = 100
			G[st + 3][st + 3] = 100
			G[st + 2][st] = 101
			G[st + 3][st] = 101
			G[st + 2][st + 1] = 102
			G[st + 3][st + 1] = 102
			G[st][st + 2] = 103
			G[st + 1][st + 2] = 103
			G[st][st + 3] = 104
			G[st + 1][st + 3] = 104
	print('\n'.join([''.join(map(chr, g)) for g in G]))


z3 = ['aa.', '..a', '..a']
z4 = ['abcc', 'abdd', 'eegh', 'ffgh']
z5 = ['biihh', 'baa.g', 'c..ag', 'c..af', 'ddeef']
z6 = ['aa.bbc', '..ae.c', '..aedd', 'bbcaa.', 'e.c..a', 'edd..a']
z7 = ['bbccdd.', 'aa.aa.b', '..a..ab', '..a..ac', 'aa.aa.c', '..a..ad', '..a..ad']
n = int(input())
if n == 2:
	print(-1)
elif n == 3:
	for x in z3:
		print(x)
else:
	m = n // 4 - 1
	if n % 4 == 0:
		for x in z4:
			print(x + '.' * (n - 4))
	if n % 4 == 1:
		for x in z5:
			print(x + '.' * (n - 5))
	if n % 4 == 2:
		for x in z6:
			print(x + '.' * (n - 6))
	if n % 4 == 3:
		for x in z7:
			print(x + '.' * (n - 7))
	for i in range(m):
		for x in z4:
			l = n % 4 + (i + 1) * 4
			print('.' * l + x + '.' * (n - l - 4))


N = int(input())
state = [list('.' * N) for _ in range(N)]

def fill_block3_1(h, w):
	state[h][w] = 'a'
	state[h][w + 1] = 'a'
	state[h + 1][w + 2] = 'b'
	state[h + 2][w + 2] = 'b'

def fill_block3_2(h, w):
	state[h][w] = 'c'
	state[h + 1][w] = 'c'
	state[h][w + 1] = 'd'
	state[h][w + 2] = 'd'
	state[h + 2][w] = 'e'
	state[h + 2][w + 1] = 'e'
	state[h + 1][w + 2] = 'f'
	state[h + 2][w + 2] = 'f'

def solve_5_6n(start_h, start_w, k, s1, s2):
	cycle = 2 * k + 1
	size = 3 * cycle + 2
	num_2 = k
	for h3 in range(cycle):
		for w3 in range(cycle):
			if (h3 + w3) % cycle < num_2:
				fill_block3_2(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
			else:
				fill_block3_1(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
	for x in range(size - 1):
		if x % 4 in [0, 1]:
			state[start_h][start_w + x] = s1
			state[start_h + size - 2 - x][start_w + size - 1] = s2
			state[start_h + size - 1][start_w + size - 1 - x] = s1
			state[start_h + 1 + x][start_w] = s2
		else:
			state[start_h][start_w + x] = s2
			state[start_h + size - 2 - x][start_w + size - 1] = s1
			state[start_h + size - 1][start_w + size - 1 - x] = s2
			state[start_h + 1 + x][start_w] = s1

def solve_2_6n(start_h, start_w, k, s1, s2):
	cycle = 2 * k
	size = 3 * cycle + 2
	num_2 = k - 2
	if k == 1:
		fill_block3_1(start_h + 1, start_w + 1)
		fill_block3_1(start_h + 4, start_w + 4)
	else:
		for h3 in range(cycle):
			for w3 in range(cycle):
				if (h3 + w3) % cycle < num_2:
					fill_block3_2(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
				else:
					fill_block3_1(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
	for x in range(1, size - 1):
		if x % 4 in [1, 2]:
			state[start_h][start_w + x] = s1
			state[start_h + x][start_w] = s1
			state[start_h + size - 1][start_w + x] = s1
			state[start_h + x][start_w + size - 1] = s1
		else:
			state[start_h][start_w + x] = s2
			state[start_h + x][start_w] = s2
			state[start_h + size - 1][start_w + x] = s2
			state[start_h + x][start_w + size - 1] = s2

def solve_1_6n(start_h, start_w, k, s1, s2):
	cycle = 2 * k
	size = 3 * cycle + 1
	for h3 in range(cycle):
		for w3 in range(cycle):
			if (h3 + w3) % cycle < k - 1:
				fill_block3_2(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
			else:
				fill_block3_1(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
	for x in range(1, size):
		if x % 4 in [1, 2]:
			state[start_h][start_w + x] = s1
			state[start_h + x][start_w] = s1
		else:
			state[start_h][start_w + x] = s2
			state[start_h + x][start_w] = s2

def main():
	if N == 2:
		return -1
	if N == 4:
		state = [['a', 'a', 'c', 'd'], ['b', 'b', 'c', 'd'], ['e', 'f', 'g', 'g'], ['e', 'f', 'h', 'h']]
		return state
	if N % 3 == 0:
		l = N // 3
		for h in range(l):
			for w in range(l):
				fill_block3_1(3 * h, 3 * w)
		return
	elif N % 6 == 5:
		k = (N - 5) // 6
		solve_5_6n(0, 0, k, 'x', 'y')
		return
	elif N % 6 == 2:
		k = (N - 2) // 6
		solve_2_6n(0, 0, k, 'x', 'y')
		return
	elif N % 6 == 1:
		solve_1_6n(0, 0, (N - 1) // 6, 'x', 'y')
		return
	else:
		l = (N // 2 - 2) // 3
		if l % 2 == 1:
			solve_5_6n(0, 0, (l - 1) // 2, 's', 't')
			solve_5_6n(N // 2, 0, (l - 1) // 2, 'u', 'v')
			solve_5_6n(0, N // 2, (l - 1) // 2, 'w', 'x')
			solve_5_6n(N // 2, N // 2, (l - 1) // 2, 'y', 'z')
		else:
			solve_2_6n(0, 0, l // 2, 's', 't')
			solve_2_6n(N // 2, 0, l // 2, 'u', 'v')
			solve_2_6n(0, N // 2, l // 2, 'w', 'x')
			solve_2_6n(N // 2, N // 2, l // 2, 'y', 'z')
		return
ret = main()
if ret == -1:
	print(-1)
elif not ret is None:
	for h in range(N):
		print(''.join(ret[h]))
else:
	for h in range(N):
		print(''.join(state[h]))


import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline

def geta(fn=lambda s: s.decode()):
	return map(fn, readline().split())

def gete(fn=lambda s: s.decode()):
	return fn(readline().rstrip())

def main():
	N = gete(int)
	g = [['.'] * N for _ in range(N)]
	d = dict()
	d[3, 1] = ('.zz', 'z..', 'z..')
	d[3, 2] = ('aab', 'b.b', 'baa')
	d[4, 3] = ('aaba', 'ccba', 'abcc', 'abaa')
	d[5, 3] = ('aabbc', 'bc..c', 'bc..b', 'a.ccb', 'abbaa')
	if N == 2:
		print(-1)
		return
	elif N == 3:
		for i in range(3):
			for j in range(3):
				g[i][j] = d[3, 1][i][j]
	elif N & 1 == 0:
		(n, m) = (0, 0)
		while 6 * m <= N:
			if (N - 6 * m) % 4 == 0:
				n = (N - 6 * m) // 4
				break
			m += 1
		for k in range(m):
			for i in range(3):
				for j in range(3):
					g[6 * k + i][6 * k + j] = d[3, 1][i][j]
					g[6 * k + 3 + i][6 * k + 3 + j] = d[3, 1][i][j]
					g[6 * k + i][6 * k + 3 + j] = d[3, 2][i][j]
					g[6 * k + 3 + i][6 * k + j] = d[3, 2][i][j]
		for k in range(n):
			for i in range(4):
				for j in range(4):
					g[6 * m + 4 * k + i][6 * m + 4 * k + j] = d[4, 3][i][j]
	elif N == 7:
		_s = 'aabbcc.'
		for i in range(N):
			g[i][6] = _s[i]
			g[6][i] = _s[i]
		for k in range(2):
			for l in range(2):
				for i in range(3):
					for j in range(3):
						g[3 * k + i][3 * l + j] = d[3, 1][i][j]
	elif N == 11:
		for k in range(1):
			for i in range(3):
				for j in range(3):
					g[6 * k + i][6 * k + j] = d[3, 1][i][j]
					g[6 * k + 3 + i][6 * k + 3 + j] = d[3, 1][i][j]
					g[6 * k + i][6 * k + 3 + j] = d[3, 2][i][j]
					g[6 * k + 3 + i][6 * k + j] = d[3, 2][i][j]
		for k in range(1):
			for i in range(5):
				for j in range(5):
					g[6 + i][6 + j] = d[5, 3][i][j]
	else:
		(n, m) = (0, 0)
		while 5 * m <= N:
			if (N - 5 * m) % 4 == 0:
				n = (N - 5 * m) // 4
				break
			m += 1
		for k in range(m):
			for i in range(5):
				for j in range(5):
					g[5 * k + i][5 * k + j] = d[5, 3][i][j]
		for k in range(n):
			for i in range(4):
				for j in range(4):
					g[5 * m + 4 * k + i][5 * m + 4 * k + j] = d[4, 3][i][j]
	print(*[''.join(g[i]) for i in range(N)], sep='\n')
main()


n = int(input())
if n % 3 == 0:
	m = n // 3
	for i in range(m):
		print('.' * (3 * i) + 'abb' + '.' * (n - 3 - 3 * i))
		print('.' * (3 * i) + 'a.a' + '.' * (n - 3 - 3 * i))
		print('.' * (3 * i) + 'bba' + '.' * (n - 3 - 3 * i))
elif n % 3 == 1:
	if n >= 10:
		print('abaa' + '.' * (n - 4))
		print('abcc' + '.' * (n - 4))
		print('ccba' + '.' * (n - 4))
		print('aaba' + '.' * (n - 4))
		m = (n - 4) // 3
		for i in range(m):
			if i == m - 1:
				print('.' * 4 + 'dd.' + '.' * (n - 10) + 'abb')
				print('.' * 4 + '..d' + '.' * (n - 10) + 'a.a')
				print('.' * 4 + '..d' + '.' * (n - 10) + 'bba')
			else:
				print('.' * (4 + 3 * i) + 'abbdd.' + '.' * (n - 10 - 3 * i))
				print('.' * (4 + 3 * i) + 'a.a..d' + '.' * (n - 10 - 3 * i))
				print('.' * (4 + 3 * i) + 'bba..d' + '.' * (n - 10 - 3 * i))
	elif n == 7:
		print('a.aa..a')
		print('ab....a')
		print('.b..aab')
		print('aabb..b')
		print('.b.aacc')
		print('aba....')
		print('a.a.aa.')
	else:
		print('abaa')
		print('abcc')
		print('ccba')
		print('aaba')
elif n % 3 == 2:
	if n >= 14:
		m = (n - 8) // 3
		print('abaa' + '.' * (n - 4))
		print('abcc' + '.' * (n - 4))
		print('ccba' + '.' * (n - 4))
		print('aaba' + '.' * (n - 4))
		print('....abaa' + '.' * (n - 8))
		print('....abcc' + '.' * (n - 8))
		print('....ccba' + '.' * (n - 8))
		print('....aaba' + '.' * (n - 8))
		m = (n - 8) // 3
		for i in range(m):
			if i == m - 1:
				print('.' * 8 + 'dd.' + '.' * (n - 14) + 'abb')
				print('.' * 8 + '..d' + '.' * (n - 14) + 'a.a')
				print('.' * 8 + '..d' + '.' * (n - 14) + 'bba')
			else:
				print('.' * (8 + 3 * i) + 'abbdd.' + '.' * (n - 14 - 3 * i))
				print('.' * (8 + 3 * i) + 'a.a..d' + '.' * (n - 14 - 3 * i))
				print('.' * (8 + 3 * i) + 'bba..d' + '.' * (n - 14 - 3 * i))
	elif n == 11:
		print('a.aa..a' + '....')
		print('ab....a' + '....')
		print('.b..aab' + '....')
		print('aabb..b' + '....')
		print('.b.aacc' + '....')
		print('aba....' + '....')
		print('a.a.aa.' + '....')
		print('.' * 7 + 'abaa')
		print('.' * 7 + 'abcc')
		print('.' * 7 + 'ccba')
		print('.' * 7 + 'aaba')
	elif n == 8:
		print('abaa....')
		print('abcc....')
		print('ccba....')
		print('aaba....')
		print('....abaa')
		print('....abcc')
		print('....ccba')
		print('....aaba')
	elif n == 5:
		print('abbaa')
		print('a..bc')
		print('bb.bc')
		print('a.aab')
		print('abb.b')
	else:
		print(-1)


list3 = ['aab', 'd.b', 'dcc']
list4 = ['aacd', 'bbcd', 'efgg', 'efhh']
list5 = ['abc..', 'abc..', 'ddehh', 'g.eii', 'gffjj']
list7 = ['.aabbcc', 'dghh...', 'dg.j...', 'eiij...', 'e...kll', 'f...k.n', 'f...mmn']
n = int(input())
if n <= 2:
	print(-1)
elif n % 3 == 0:
	lists = []
	for i in range(n):
		row = '.' * (i // 3 * 3) + list3[i % 3] + '.' * (n - 3 - i // 3 * 3)
		lists.append(row)
	for l in lists:
		print(l)
else:
	kotae = [[], [], [], [], [1, 0, 0], [0, 1, 0], [], [0, 0, 1], [2, 0, 0], [1, 1, 0], [0, 2, 0], [1, 0, 1], [3, 0, 0], [2, 1, 0], [1, 2, 0], [0, 3, 0], [4, 0, 0], [3, 1, 0], [2, 2, 0], [1, 3, 0], [0, 4, 0], [4, 1, 0], [3, 2, 0], [2, 3, 0], [6, 0, 0], [0, 5, 0], [4, 2, 0]]
	if n <= 25:
		loop = kotae[n]
	else:
		mazu = n % 20
		if mazu < 7:
			mazu += 20
		loop = kotae[mazu]
		loop[0] += (n - mazu) // 20 * 5
	lists = []
	now = 0
	for i in range(loop[0] * 4):
		row = '.' * (i // 4) * 4 + list4[i % 4] + '.' * (n - 4 - i // 4 * 4)
		lists.append(row)
	now += loop[0] * 4
	for i in range(loop[1] * 5):
		row = '.' * (now + i // 5 * 5) + list5[i % 5] + '.' * (n - 5 - now - i // 5 * 5)
		lists.append(row)
	now += loop[1] * 5
	for i in range(loop[2] * 7):
		row = '.' * (now + i // 7 * 7) + list7[i % 7] + '.' * (n - 7 - now - i // 7 * 7)
		lists.append(row)
	now += loop[1] * 7
	for l in lists:
		print(l)


import sys
n = int(input())
if n == 2:
	print(-1)
	sys.exit()
if n == 3:
	print('aa.')
	print('..a')
	print('..a')
	sys.exit()
x = n // 4 - 1
y = n % 4 + 4
l = [[['a', 'a', 'b', 'c'], ['d', 'd', 'b', 'c'], ['b', 'c', 'a', 'a'], ['b', 'c', 'd', 'd']], [['a', 'a', 'b', 'b', 'a'], ['b', 'c', 'c', '.', 'a'], ['b', '.', '.', 'c', 'b'], ['a', '.', '.', 'c', 'b'], ['a', 'b', 'b', 'a', 'a']], [['a', 'a', 'b', 'c', '.', '.'], ['d', 'd', 'b', 'c', '.', '.'], ['.', '.', 'a', 'a', 'b', 'c'], ['.', '.', 'd', 'd', 'b', 'c'], ['b', 'c', '.', '.', 'a', 'a'], ['b', 'c', '.', '.', 'd', 'd']], [['a', 'a', 'b', 'b', 'c', 'c', '.'], ['d', 'd', '.', 'd', 'd', '.', 'a'], ['.', '.', 'd', '.', '.', 'd', 'a'], ['.', '.', 'd', '.', '.', 'd', 'b'], ['d', 'd', '.', 'd', 'd', '.', 'b'], ['.', '.', 'd', '.', '.', 'd', 'c'], ['.', '.', 'd', '.', '.', 'd', 'c']]]
if n < 8:
	for i in range(n):
		print(''.join(l[n - 4][i]))
	sys.exit()
ans = []
for i in range(n):
	ans1 = ['.'] * n
	ans.append(ans1)
for i in range(x):
	for j in range(4):
		for k in range(4):
			ans[i * 4 + j][i * 4 + k] = l[0][j][k]
for j in range(y):
	for k in range(y):
		ans[x * 4 + j][x * 4 + k] = l[y - 4][j][k]
for i in range(n):
	print(''.join(ans[i]))


n = int(input())
if n == 2:
	print(-1)
else:
	a3 = ['aa.', '..a', '..a']
	a4 = ['aabc', 'ddbc', 'bcaa', 'bcdd']
	a5 = ['aabba', 'bcc.a', 'b..cb', 'a..cb', 'abbaa']
	a6 = ['aabc..', 'ddbc..', '..aabc', '..ddbc', 'bc..aa', 'bc..dd']
	a7 = ['aabbcc.', 'dd.dd.a', '..d..da', '..d..db', 'dd.dd.b', '..d..dc', '..d..dc']
	if n == 3:
		for p in a3:
			print(p)
	else:
		a44 = ['.' * (n - 4) + x for x in a4]
		if n % 4 == 0:
			lt = []
			for i in range(n // 4):
				for j in range(len(a44)):
					a44[j] = a44[j][n - 4:] + a44[j][:n - 4]
					lt.append(a44[j])
			for st in lt:
				print(st)
		else:
			x = n // 4 - 1
			r = n % 4 + 4
			q = []
			if r == 5:
				q = ['.' * (n - 5) + m for m in a5]
			elif r == 6:
				q = ['.' * (n - 6) + m for m in a6]
			elif r == 7:
				q = ['.' * (n - 7) + m for m in a7]
			lt = []
			for i in range(x):
				for j in range(len(a44)):
					a44[j] = a44[j][n - 4:] + a44[j][:n - 4]
					lt.append(a44[j])
			for j in q:
				lt.append(j)
			for st in lt:
				print(st)


n = int(input())
if n == 2:
	print(-1)
	exit()
if n == 3:
	print('abb')
	print('a.c')
	print('ddc')
	exit()
if n == 5:
	print('aabbc')
	print('hi..c')
	print('hi..d')
	print('g.jjd')
	print('gffee')
	exit()
if n == 7:
	print('..abc..')
	print('..abc..')
	print('aax..aa')
	print('bbx..bb')
	print('cc.yycc')
	print('..abc..')
	print('..abc..')
	exit()
a = [n * ['.'] for _ in range(n)]
if n % 2:
	(a[-5][-5], a[-5][-4], a[-5][-3], a[-5][-2], a[-5][-1]) = list('aabbc')
	(a[-4][-5], a[-4][-4], a[-4][-3], a[-4][-2], a[-4][-1]) = list('hi..c')
	(a[-3][-5], a[-3][-4], a[-3][-3], a[-3][-2], a[-3][-1]) = list('hi..d')
	(a[-2][-5], a[-2][-4], a[-2][-3], a[-2][-2], a[-2][-1]) = list('g.jjd')
	(a[-1][-5], a[-1][-4], a[-1][-3], a[-1][-2], a[-1][-1]) = list('gffee')
	n -= 5
for i in range(0, n, 2):
	(a[i][i], a[i][i + 1]) = ('a', 'a')
	(a[i + 1][i], a[i + 1][i + 1]) = ('b', 'b')
if n % 4 == 0:
	for i in range(0, n, 2):
		(a[n - i - 2][i], a[n - i - 2][i + 1]) = ('c', 'd')
		(a[n - i - 1][i], a[n - i - 1][i + 1]) = ('c', 'd')
else:
	for i in range(0, n - 2, 2):
		(a[i][i + 2], a[i][i + 3]) = ('c', 'd')
		(a[i + 1][i + 2], a[i + 1][i + 3]) = ('c', 'd')
	(a[n - 2][0], a[n - 2][1]) = ('c', 'd')
	(a[n - 1][0], a[n - 1][1]) = ('c', 'd')
for i in a:
	print(''.join(i))


def GCD(x, y):
	if y == 0:
		return x
	else:
		return GCD(y, x % y)
N = int(input())
if N == 2:
	print(-1)
	exit()
if N == 7:
	ans = ['.aabbcc', 'c..ddee', 'c..ffgg', 'hij....', 'hij....', 'klm....', 'klm....']
	for i in ans:
		print(''.join(i))
	exit()
if N == 3:
	print('.aa')
	print('a..')
	print('a..')
	exit()
four = ['aacd', 'bbcd', 'efgg', 'efhh']
five = ['aabbc', 'h.iic', 'hj..d', 'gj..d', 'gffee']
six = ['aacd..', 'bbcd..', 'ef..gg', 'ef..hh', '..iikl', '..jjkl']
ans = [list('.' * N) for i in range(N)]
(a, b, c) = [[0, N // 5, 0], [0, N // 5 - 1, 1], [0, N // 5 - 2, 2], [2, N // 5 - 1, 0], [1, N // 5, 0]][N % 5]
p = 0
for i in range(a):
	for x in range(4):
		for y in range(4):
			ans[p + x][p + y] = four[x][y]
	p += 4
for i in range(b):
	for x in range(5):
		for y in range(5):
			ans[p + x][p + y] = five[x][y]
	p += 5
for i in range(c):
	for x in range(6):
		for y in range(6):
			ans[p + x][p + y] = six[x][y]
	p += 6
for i in ans:
	print(''.join(i))


n = int(input())
if n == 2:
	print(-1)
elif n == 3:
	print('aab')
	print('c.b')
	print('cdd')
elif n == 4:
	print('aabc')
	print('ddbc')
	print('efgg')
	print('efhh')
elif n == 5:
	print('abbcc')
	print('a..da')
	print('b..da')
	print('bqq.b')
	print('ccaab')
elif n % 2 == 0:
	r = n // 2
	for i in range(r - 1):
		if i == 0:
			print('a' + '.' * (r - 2) + 'zz' + '.' * (r - 3) + 'aa')
		elif i % 2 == 1:
			print('.' * (i - 1) + 'ab' + '.' * (n - i * 2 - 3) + 'bb' + '.' * i)
		else:
			print('.' * (i - 1) + 'ba' + '.' * (n - i * 2 - 3) + 'aa' + '.' * i)
	if r % 2 == 0:
		print('z' + '.' * (r - 3) + 'a' + '.' * (n - r) + 'z')
		print('z' + '.' * (n - r) + 'a' + '.' * (r - 3) + 'z')
	else:
		print('z' + '.' * (r - 3) + 'b' + '.' * (n - r) + 'z')
		print('z' + '.' * (n - r) + 'b' + '.' * (r - 3) + 'z')
	for i in range(r - 2, -1, -1):
		if i == 0:
			print('aa' + '.' * (r - 3) + 'zz' + '.' * (r - 2) + 'a')
		elif i % 2 == 1:
			print('.' * i + 'bb' + '.' * (n - i * 2 - 3) + 'ba' + '.' * (i - 1))
		else:
			print('.' * i + 'aa' + '.' * (n - i * 2 - 3) + 'ab' + '.' * (i - 1))
else:
	r = n // 2
	for i in range(r - 1):
		if i == 0:
			print('a' + '.' * (r - 2) + 'zz' + '.' * (r - 2) + 'aa')
		elif i % 2 == 1:
			print('.' * (i - 1) + 'ab' + '.' * (n - i * 2 - 3) + 'bb' + '.' * i)
		else:
			print('.' * (i - 1) + 'ba' + '.' * (n - i * 2 - 3) + 'aa' + '.' * i)
	if r % 2 == 0:
		print('.' * (r - 2) + 'a..p' + '.' * (r - 2) + 'z')
		print('z' + '.' * (r - 2) + '..p' + '.' * (r - 2) + 'z')
		print('z' + '.' * (r - 2) + 'qq.a' + '.' * (r - 2))
	else:
		print('.' * (r - 2) + 'b..p' + '.' * (r - 2) + 'z')
		print('z' + '.' * (r - 2) + '..p' + '.' * (r - 2) + 'z')
		print('z' + '.' * (r - 2) + 'qq.b' + '.' * (r - 2))
	for i in range(r - 2, -1, -1):
		if i == 0:
			print('aa' + '.' * (r - 2) + 'zz' + '.' * (r - 2) + 'a')
		elif i % 2 == 1:
			print('.' * i + 'bb' + '.' * (n - i * 2 - 3) + 'ba' + '.' * (i - 1))
		else:
			print('.' * i + 'aa' + '.' * (n - i * 2 - 3) + 'ab' + '.' * (i - 1))


N = int(input())
if N == 2:
	print(-1)
	exit()
if N == 3:
	print('aa.')
	print('..a')
	print('..a')
	exit()

def f(n, m):
	a = ''
	b = ''
	for i in range(n):
		if i == 2 * m - 2 or i == 2 * m - 1:
			a += 'a'
			b += 'b'
		elif i == n - 2 * m:
			a += 'a'
			b += 'a'
		elif i == n - 2 * m + 1:
			a += 'b'
			b += 'b'
		else:
			a += '.'
			b += '.'
	print(a)
	print(b)

def g(n, m):
	a = ''
	b = ''
	for i in range(n):
		if i == 2 * m - 2:
			a += 'a'
			b += 'a'
		elif i == 2 * m - 1:
			a += 'b'
			b += 'b'
		elif i == n - 2 * m or i == n - 2 * m + 1:
			a += 'a'
			b += 'b'
		else:
			a += '.'
			b += '.'
	print(a)
	print(b)
if N % 4 == 0:
	for i in range(N // 4 - 1):
		f(N, i + 1)
	a = ''
	b = ''
	c = ''
	d = ''
	for i in range(N):
		if i == N // 2 - 2:
			a += 'a'
			b += 'd'
			c += 'c'
			d += 'c'
		elif i == N // 2 - 1:
			a += 'a'
			b += 'd'
			c += 'b'
			d += 'b'
		elif i == N // 2:
			a += 'b'
			b += 'b'
			c += 'a'
			d += 'd'
		elif i == N // 2 + 1:
			a += 'c'
			b += 'c'
			c += 'a'
			d += 'd'
		else:
			a += '.'
			b += '.'
			c += '.'
			d += '.'
	print(a)
	print(b)
	print(c)
	print(d)
	for i in range(N // 4 - 1):
		g(N, N // 4 - i - 1)
if N % 4 == 1:
	for i in range(N // 4 - 1):
		f(N, i + 1)
	a = ''
	b = ''
	c = ''
	d = ''
	e = ''
	for i in range(N):
		if i == N // 2 - 2:
			a += 'a'
			b += 'a'
			c += 'b'
			d += 'b'
			e += 'a'
		elif i == N // 2 - 1:
			a += 'b'
			b += 'c'
			c += '.'
			d += '.'
			e += 'a'
		elif i == N // 2:
			a += 'b'
			b += 'c'
			c += '.'
			d += '.'
			e += 'b'
		elif i == N // 2 + 1:
			a += 'a'
			b += '.'
			c += 'a'
			d += 'a'
			e += 'b'
		elif i == N // 2 + 2:
			a += 'a'
			b += 'b'
			c += 'b'
			d += 'c'
			e += 'c'
		else:
			a += '.'
			b += '.'
			c += '.'
			d += '.'
			e += '.'
	print(a)
	print(b)
	print(c)
	print(d)
	print(e)
	for i in range(N // 4 - 1):
		g(N, N // 4 - i - 1)
if N % 4 == 2:
	for i in range(N // 4 - 1):
		f(N, i + 1)
	a = ''
	b = ''
	c = ''
	d = ''
	e = ''
	f = ''
	for i in range(N):
		if i == N // 2 - 3:
			a += 'a'
			b += 'a'
			c += 'b'
			d += 'b'
			e += 'a'
			f += 'a'
		elif i == N // 2 - 2:
			a += 'b'
			b += 'b'
			c += 'a'
			d += 'a'
			e += 'b'
			f += 'b'
		elif i == N // 2 - 1:
			a += 'a'
			b += '.'
			c += 'b'
			d += '.'
			e += 'a'
			f += '.'
		elif i == N // 2:
			a += 'a'
			b += '.'
			c += 'b'
			d += '.'
			e += 'a'
			f += '.'
		elif i == N // 2 + 1:
			a += '.'
			b += 'b'
			c += '.'
			d += 'a'
			e += '.'
			f += 'b'
		elif i == N // 2 + 2:
			a += '.'
			b += 'b'
			c += '.'
			d += 'a'
			e += '.'
			f += 'b'
		else:
			a += '.'
			b += '.'
			c += '.'
			d += '.'
			e += '.'
			f += '.'
	print(a)
	print(b)
	print(c)
	print(d)
	print(e)
	print(f)
	for i in range(N // 4 - 1):
		g(N, N // 4 - i - 1)
if N % 4 == 3:
	for i in range(N // 4 - 1):
		f(N, i + 1)
	a = ''
	b = ''
	c = ''
	d = ''
	e = ''
	f = ''
	h = ''
	for i in range(N):
		if i == N // 2 - 3:
			a += 'a'
			b += 'b'
			c += 'a'
			d += '.'
			e += '.'
			f += '.'
			h += '.'
		elif i == N // 2 - 2:
			a += 'a'
			b += 'b'
			c += 'a'
			d += '.'
			e += '.'
			f += '.'
			h += '.'
		elif i == N // 2 - 1:
			a += 'b'
			b += 'a'
			c += 'b'
			d += '.'
			e += '.'
			f += '.'
			h += '.'
		elif i == N // 2:
			a += 'b'
			b += 'a'
			c += 'b'
			d += '.'
			e += '.'
			f += '.'
			h += '.'
		elif i == N // 2 + 1:
			a += 'c'
			b += 'c'
			c += '.'
			d += 'b'
			e += 'b'
			f += 'a'
			h += 'a'
		elif i == N // 2 + 2:
			a += '.'
			b += '.'
			c += 'c'
			d += 'a'
			e += 'a'
			f += 'b'
			h += 'b'
		elif i == N // 2 + 3:
			a += '.'
			b += '.'
			c += 'c'
			d += 'b'
			e += 'b'
			f += 'a'
			h += 'a'
		else:
			a += '.'
			b += '.'
			c += '.'
			d += '.'
			e += '.'
			f += '.'
			h += '.'
	print(a)
	print(b)
	print(c)
	print(d)
	print(e)
	print(f)
	print(h)
	for i in range(N // 4 - 1):
		g(N, N // 4 - i - 1)


n = int(input())

def make3board(x):
	m = x // 3
	base = ['aab', 'd.b', 'dcc']
	board = []
	for i in range(m):
		sl = '...' * i
		sr = '...' * (m - 1 - i)
		for bj in base:
			board.append(sl + bj + sr)
	return board

def make4board(x):
	m = x // 4
	base = ['aagh', 'bbgh', 'cdee', 'cdff']
	board = []
	for i in range(m):
		sl = '....' * i
		sr = '....' * (m - 1 - i)
		for bj in base:
			board.append(sl + bj + sr)
	return board

def make5board(x):
	m = x // 5
	base = ['aadde', 'bbg.e', 'ccgff', '..abc', '..abc']
	board = []
	for i in range(m):
		sl = '.....' * i
		sr = '.....' * (m - 1 - i)
		for bj in base:
			board.append(sl + bj + sr)
	return board

def make7board(x):
	m = x // 7
	base = ['aabbcc.', 'dd.dd.c', '..d..dc', '..d..db', 'dd.dd.b', '..d..da', '..d..da']
	return board

def concat_board(board1, board2):
	(x, y) = (len(board1), len(board2))
	board = []
	sr = '.' * y
	board += [board1[i] + sr for i in range(x)]
	sl = '.' * x
	board += [sl + board2[i] for i in range(y)]
	return board
board = []
if n % 3 == 0:
	board = make3board(n)
elif n % 4 == 0:
	board = make4board(n)
elif n % 5 == 0:
	board = make5board(n)
elif n == 7 or n == 11:
	board7 = ['aabbcc.', 'dd.dd.c', '..d..dc', '..d..db', 'dd.dd.b', '..d..da', '..d..da']
	board = concat_board(board7, make4board(n - 7))
else:
	for x in range(4, n, 4):
		y = n - x
		if y % 5 == 0:
			board = concat_board(make4board(x), make5board(y))
			break
if len(board) != 0:
	print(*board, sep='\n')
else:
	print(-1)


n = int(input())
if n == 2:
	print(-1)
else:
	x = []
	if n % 3 == 0:
		for i in range(n // 3):
			x.append('.' * (3 * i) + 'a' + '.' * (n - 3 * i - 1))
			x.append('.' * (3 * i) + 'a' + '.' * (n - 3 * i - 1))
			x.append('.' * (3 * i) + '.aa' + '.' * (n - 3 * i - 3))
	elif n % 6 == 1:
		for i in range(n // 6 - 1):
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ddg.ll' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.g.kk' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.hhj.' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ffiij.' + '.' * (n - 6 * i - 6))
		x.append('.' * (n - 7) + '.aab.c.')
		x.append('.' * (n - 7) + 'd..b.c.')
		x.append('.' * (n - 7) + 'd..eeff')
		x.append('.' * (n - 7) + 'g..mm.l')
		x.append('.' * (n - 7) + 'gnn...l')
		x.append('.' * (n - 7) + 'h...kkj')
		x.append('.' * (n - 7) + 'hii...j')
	elif n % 6 == 2:
		for i in range(n // 6 - 1):
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ddg.ll' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.g.kk' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.hhj.' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ffiij.' + '.' * (n - 6 * i - 6))
		x.append('.' * (n - 8) + '.a.bb.cc')
		x.append('.' * (n - 8) + '.a...m.j')
		x.append('.' * (n - 8) + '..pp.m.j')
		x.append('.' * (n - 8) + 'hh..i.o.')
		x.append('.' * (n - 8) + 'gg..i.o.')
		x.append('.' * (n - 8) + '..n.ll.k')
		x.append('.' * (n - 8) + 'f.n....k')
		x.append('.' * (n - 8) + 'f.dd.ee.')
	elif n % 6 == 4:
		for i in range(n // 6):
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ddg.ll' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.g.kk' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.hhj.' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ffiij.' + '.' * (n - 6 * i - 6))
		x.append('.' * (n - 4) + 'aacb')
		x.append('.' * (n - 4) + 'ffcb')
		x.append('.' * (n - 4) + 'hgdd')
		x.append('.' * (n - 4) + 'hgee')
	else:
		for i in range(n // 6):
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + '.a.b.c' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ddg.ll' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.g.kk' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'e.hhj.' + '.' * (n - 6 * i - 6))
			x.append('.' * (6 * i) + 'ffiij.' + '.' * (n - 6 * i - 6))
		x.append('.' * (n - 5) + 'aabbc')
		x.append('.' * (n - 5) + 'g.h.c')
		x.append('.' * (n - 5) + 'gjh..')
		x.append('.' * (n - 5) + 'dj.ii')
		x.append('.' * (n - 5) + 'deeff')
	for i in range(n):
		print(''.join(x[i]))


N = int(input())
ans = [['.' for i in range(N)] for j in range(N)]
if N == 2:
	print(-1)
	exit()
elif N % 3 == 0:
	if N % 3 == 0:
		for i in range(N // 3):
			ans[3 * i][3 * i] = 'a'
			ans[3 * i][3 * i + 1] = 'a'
			ans[3 * i + 1][3 * i + 2] = 'a'
			ans[3 * i + 2][3 * i + 2] = 'a'
elif N == 11:
	i = 0
	r = 0
	ans[5 * i + 4 * r][5 * i + 4 * r:5 * i + 4 * r + 5] = ['a', 'a', 'b', 'b', 'c']
	ans[5 * i + 4 * r + 1][5 * i + 4 * r:5 * i + 4 * r + 5] = ['b', 'd', 'd', '.', 'c']
	ans[5 * i + 4 * r + 2][5 * i + 4 * r:5 * i + 4 * r + 5] = ['b', '.', '.', 'e', 'b']
	ans[5 * i + 4 * r + 3][5 * i + 4 * r:5 * i + 4 * r + 5] = ['c', '.', '.', 'e', 'b']
	ans[5 * i + 4 * r + 4][5 * i + 4 * r:5 * i + 4 * r + 5] = ['c', 'b', 'b', 'a', 'a']
	ans[5][5:] = ['a', 'a', '.', 'b', 'b', 'a']
	ans[6][5:] = ['.', '.', 'a', 'c', '.', 'a']
	ans[7][5:] = ['.', '.', 'a', 'c', 'b', 'b']
	ans[8][5:] = ['a', 'b', 'b', 'a', 'a', '.']
	ans[9][5:] = ['a', '.', 'a', '.', '.', 'a']
	ans[10][5:] = ['c', 'c', 'a', '.', '.', 'a']
elif N == 7:
	ans[0] = ['.', '.', '.', 'a', '.', 'd', 'e']
	ans[1] = ['.', '.', '.', 'a', '.', 'd', 'e']
	ans[2] = ['.', '.', 'b', 'b', 'c', 'a', 'a']
	ans[3] = ['b', 'b', 'e', '.', 'c', '.', '.']
	ans[4] = ['.', '.', 'e', 'd', 'd', 'e', 'e']
	ans[5] = ['b', 'b', 'f', '.', 'c', '.', '.']
	ans[6] = ['a', 'a', 'f', '.', 'c', '.', '.']
else:
	r = 5 - N % 5
	if r == 5:
		r = 0
	for i in range(0, r):
		ans[4 * i][4 * i] = 'a'
		ans[4 * i][4 * i + 1] = 'a'
		ans[4 * i][4 * i + 2] = 'c'
		ans[4 * i][4 * i + 3] = 'd'
		ans[4 * i + 1][4 * i] = 'b'
		ans[4 * i + 1][4 * i + 1] = 'b'
		ans[4 * i + 1][4 * i + 2] = 'c'
		ans[4 * i + 1][4 * i + 3] = 'd'
		ans[4 * i + 2][4 * i] = 'c'
		ans[4 * i + 2][4 * i + 1] = 'd'
		ans[4 * i + 2][4 * i + 2] = 'a'
		ans[4 * i + 2][4 * i + 3] = 'a'
		ans[4 * i + 3][4 * i] = 'c'
		ans[4 * i + 3][4 * i + 1] = 'd'
		ans[4 * i + 3][4 * i + 2] = 'b'
		ans[4 * i + 3][4 * i + 3] = 'b'
	for i in range((N - 4 * r) // 5):
		ans[5 * i + 4 * r][5 * i + 4 * r:5 * i + 4 * r + 5] = ['a', 'a', 'b', 'b', 'c']
		ans[5 * i + 4 * r + 1][5 * i + 4 * r:5 * i + 4 * r + 5] = ['b', 'd', 'd', '.', 'c']
		ans[5 * i + 4 * r + 2][5 * i + 4 * r:5 * i + 4 * r + 5] = ['b', '.', '.', 'e', 'b']
		ans[5 * i + 4 * r + 3][5 * i + 4 * r:5 * i + 4 * r + 5] = ['c', '.', '.', 'e', 'b']
		ans[5 * i + 4 * r + 4][5 * i + 4 * r:5 * i + 4 * r + 5] = ['c', 'b', 'b', 'a', 'a']
for i in range(N):
	print(''.join(ans[i]))


N = int(input())
lst = [['.'] * N for _ in range(N)]

def calc3(x, y):
	lst[x][y] = 'a'
	lst[x][y + 1] = 'a'
	lst[x][y + 2] = 'b'
	lst[x + 1][y + 2] = 'b'
	lst[x + 2][y + 2] = 'c'
	lst[x + 2][y + 1] = 'c'
	lst[x + 2][y] = 'd'
	lst[x + 1][y] = 'd'
if N % 3 == 0:
	for h in range(0, N, 3):
		for w in range(0, N, 3):
			calc3(h, w)
	for i in lst:
		print(*i, sep='')
	exit()

def calc4(x, y):
	lst[x][y] = 'a'
	lst[x][y + 1] = 'a'
	lst[x + 1][y] = 'b'
	lst[x + 1][y + 1] = 'b'
	lst[x + 2][y + 2] = 'c'
	lst[x + 2][y + 3] = 'c'
	lst[x + 3][y + 2] = 'd'
	lst[x + 3][y + 3] = 'd'
	lst[x + 2][y] = 'e'
	lst[x + 3][y] = 'e'
	lst[x + 2][y + 1] = 'f'
	lst[x + 3][y + 1] = 'f'
	lst[x][y + 2] = 'g'
	lst[x + 1][y + 2] = 'g'
	lst[x][y + 3] = 'h'
	lst[x + 1][y + 3] = 'h'
if N % 4 == 0:
	for h in range(0, N, 4):
		for w in range(0, N, 4):
			calc4(h, w)
	for i in lst:
		print(*i, sep='')
	exit()

def calc5(x, y):
	lst[x][y] = 'a'
	lst[x][y + 1] = 'a'
	lst[x][y + 2] = 'b'
	lst[x][y + 3] = 'b'
	lst[x][y + 4] = 'c'
	lst[x + 1][y + 4] = 'c'
	lst[x + 1][y] = 'd'
	lst[x + 2][y] = 'd'
	lst[x + 1][y + 1] = 'e'
	lst[x + 2][y + 1] = 'e'
	lst[x + 2][y + 4] = 'f'
	lst[x + 3][y + 4] = 'f'
	lst[x + 3][y] = 'g'
	lst[x + 4][y] = 'g'
	lst[x + 3][y + 2] = 'h'
	lst[x + 3][y + 3] = 'h'
	lst[x + 4][y + 1] = 'i'
	lst[x + 4][y + 2] = 'i'
	lst[x + 4][y + 3] = 'j'
	lst[x + 4][y + 4] = 'j'
if N % 5 == 0:
	for h in range(0, N, 5):
		for w in range(0, N, 5):
			calc5(h, w)
	for i in lst:
		print(*i, sep='')
	exit()

def calc7(x, y):
	lst[x][y + 1] = 'a'
	lst[x][y + 2] = 'a'
	lst[x][y + 3] = 'b'
	lst[x][y + 4] = 'b'
	lst[x][y + 5] = 'c'
	lst[x][y + 6] = 'c'
	lst[x + 1][y] = 'd'
	lst[x + 2][y] = 'd'
	lst[x + 1][y + 3] = 'e'
	lst[x + 1][y + 4] = 'e'
	lst[x + 1][y + 5] = 'f'
	lst[x + 1][y + 6] = 'f'
	lst[x + 3][y] = 'g'
	lst[x + 4][y] = 'g'
	lst[x + 3][y + 1] = 'h'
	lst[x + 4][y + 1] = 'h'
	lst[x + 3][y + 2] = 'i'
	lst[x + 4][y + 2] = 'i'
	lst[x + 5][y] = 'j'
	lst[x + 6][y] = 'j'
	lst[x + 5][y + 1] = 'k'
	lst[x + 6][y + 1] = 'k'
	lst[x + 5][y + 2] = 'l'
	lst[x + 6][y + 2] = 'l'
	lst[x + 2][y + 3] = 'm'
	lst[x + 2][y + 4] = 'm'
	lst[x + 2][y + 5] = 'n'
	lst[x + 2][y + 6] = 'n'
if N % 7 == 0:
	for h in range(0, N, 7):
		for w in range(0, N, 7):
			calc7(h, w)
	for i in lst:
		print(*i, sep='')
	exit()
if N <= 2:
	print(-1)
	exit()
count = 0
n = N
while True:
	if n % 5 == 0:
		flag = True
		break
	if n % 7 == 0:
		flag = False
		break
	n -= 4
	count += 1
for i in range(count):
	calc4(4 * i, 4 * i)
if flag:
	for i in range(4 * count, N, 5):
		calc5(i, i)
else:
	for i in range(4 * count, N, 7):
		calc7(i, i)
for i in lst:
	print(*i, sep='')


N = int(input())
if N == 3:
	ans = ['.aa', 'b..', 'b..']
	for i in ans:
		print(i)
elif N >= 4:
	four = ['abcc', 'abdd', 'hhfg', 'eefg']
	five = ['ahhgg', 'ai..f', 'bi..f', 'b.jje', 'ccdde']
	six = ['add.ff', 'a.ce..', 'bbce..', '.ffadd', 'e..a.c', 'e..bbc']
	seven = ['.iijjkk', 'fadd...', 'fa.c...', 'gbbc...', 'g...add', 'h...a.c', 'h...bbc']
	ans = [['.'] * N for i in range(N)]
	now = 0
	while N - now > 7:
		for i in range(4):
			for j in range(4):
				ans[i + now][j + now] = four[i][j]
		now += 4
	if N - now == 4:
		for i in range(4):
			for j in range(4):
				ans[i + now][j + now] = four[i][j]
	elif N - now == 5:
		for i in range(5):
			for j in range(5):
				ans[i + now][j + now] = five[i][j]
	elif N - now == 6:
		for i in range(6):
			for j in range(6):
				ans[i + now][j + now] = six[i][j]
	else:
		for i in range(7):
			for j in range(7):
				ans[i + now][j + now] = seven[i][j]
	for i in range(N):
		print(''.join(ans[i]))
else:
	print(-1)


import sys
input = sys.stdin.readline
N = int(input())
if N == 2:
	print(-1)
	sys.exit()
if N == 7:
	S = ['.hhagg.\n', 'g..a..h\n', 'g.ee..h\n', 'bb..fcc\n', 'gg..f.h\n', '..hd..h\n', '..hdgg.\n']
	print(''.join(S))
	sys.exit()
if N == 11:
	S = ['......abc..\n', '......abc..\n', '.....igg.dd\n', '.....i..hee\n', '....jj..hff\n', '..ll..kmm..\n', 'ff..h.k....\n', 'ee..hn.....\n', 'ddgg.n.....\n', '..abc......\n', '..abc......\n']
	print(''.join(S))
	sys.exit()
ANS = [['.'] * N for i in range(N)]
if N % 3 == 0:
	for i in range(0, N, 3):
		ANS[i][i] = 'a'
		ANS[i][i + 1] = 'a'
		ANS[i + 1][i + 2] = 'a'
		ANS[i + 2][i + 2] = 'a'
else:
	now = 0
	while (N - now) % 4 != 0:
		i = now
		now += 5
		ANS[i][i] = 'a'
		ANS[i][i + 1] = 'a'
		ANS[i][i + 2] = 'b'
		ANS[i][i + 3] = 'b'
		ANS[i][i + 4] = 'c'
		ANS[i + 1][i + 4] = 'c'
		ANS[i + 2][i + 4] = 'd'
		ANS[i + 3][i + 4] = 'd'
		ANS[i + 4][i + 4] = 'e'
		ANS[i + 4][i + 3] = 'e'
		ANS[i + 4][i + 2] = 'f'
		ANS[i + 4][i + 1] = 'f'
		ANS[i + 4][i] = 'g'
		ANS[i + 3][i] = 'g'
		ANS[i + 2][i] = 'h'
		ANS[i + 1][i] = 'h'
		ANS[i + 1][i + 1] = 'i'
		ANS[i + 1][i + 2] = 'i'
		ANS[i + 2][i + 3] = 'j'
		ANS[i + 3][i + 3] = 'j'
	for i in range(now, N, 4):
		ANS[i][i] = 'a'
		ANS[i][i + 1] = 'a'
		ANS[i + 1][i] = 'b'
		ANS[i + 1][i + 1] = 'b'
		ANS[i][i + 2] = 'c'
		ANS[i + 1][i + 2] = 'c'
		ANS[i][i + 3] = 'd'
		ANS[i + 1][i + 3] = 'd'
		ANS[i + 2][i + 2] = 'e'
		ANS[i + 2][i + 3] = 'e'
		ANS[i + 3][i + 2] = 'f'
		ANS[i + 3][i + 3] = 'f'
		ANS[i + 2][i] = 'g'
		ANS[i + 3][i] = 'g'
		ANS[i + 2][i + 1] = 'h'
		ANS[i + 3][i + 1] = 'h'
for ans in ANS:
	print(''.join(ans))


ans = {3: ['aa.', '..a', '..a'], 4: ['aacd', 'bbcd', 'cdaa', 'cdbb'], 5: ['aabbc', 'bcc.c', 'b..ba', 'c..ba', 'cddee'], 6: ['aabbcc', 'bbccdd', 'a.a.a.', 'a.a.a.', '.a.a.a', '.a.a.a'], 7: ['aabbaa.', 'ccaa..b', 'aacc..b', '....bca', '....bca', '....cbc', '....cbc']}
N = int(input())
if N < 8:
	if N in ans:
		for line in ans[N]:
			print(line)
	else:
		print(-1)
else:
	div = N // 4
	for i in range(div - 1):
		for line in ans[4]:
			print('.' * (i * 4) + line + '.' * (N - i * 4 - 4))
	m = N % 4 + 4
	for line in ans[m]:
		print('.' * (N - m) + line)


N = int(input())
if N == 2:
	print(-1)
	exit()
if N == 3:
	print('.aa')
	print('b..')
	print('b..')
	exit()
ans = [['.'] * N for i in range(N)]
a4 = ['aacd', 'bbcd', 'cdaa', 'cdbb']
a5 = ['aabbc', 'h.iic', 'hj..d', 'gj..d', 'gffee']
a6 = ['aacd..', 'bbcd..', 'cd..aa', 'cd..bb', '..aacd', '..bbcd']
a7 = ['aa.bb.c', '.ii..jc', 'h..mmj.', 'h.n...d', '.ln...d', 'gl..kk.', 'g.ff.ee']
k = 0
if N % 4 == 1:
	for (i, row) in enumerate(a5):
		for (j, c) in enumerate(row):
			ans[i][j] = c
	k += 5
elif N % 4 == 2:
	for (i, row) in enumerate(a6):
		for (j, c) in enumerate(row):
			ans[i][j] = c
	k += 6
elif N % 4 == 3:
	for (i, row) in enumerate(a7):
		for (j, c) in enumerate(row):
			ans[i][j] = c
	k += 7
while k < N:
	for (i, row) in enumerate(a4):
		for (j, c) in enumerate(row):
			ans[k + i][k + j] = c
	k += 4
assert k == N
for row in ans:
	print(''.join(row))


n = int(input())
f = ['aabbc', 'hi..c', 'hi..d', 'g.jjd', 'gffee']
x = list('cdcd')
a = [n * ['.'] for _ in range(n)]
z = {2: [-1], 3: ['abb', 'a.c', 'ddc'], 5: ['aabbc', 'hi..c', 'hi..d', 'g.jjd', 'gffee'], 7: ['..abc..', '..abc..', 'aax..aa', 'bbx..bb', 'cc.yycc', '..abc..', '..abc..']}
if n in z:
	print(*z[n])
	exit()
if n % 2:
	for i in range(5):
		for j in range(5):
			a[-i - 1][-j - 1] = f[i][j]
	n -= 5
for i in range(0, n, 2):
	(a[i][i], a[i][i + 1], a[i + 1][i], a[i + 1][i + 1]) = list('aabb')
if n % 4:
	for i in range(0, n, 2):
		(a[i][(i + 2) % n], a[i][(i + 3) % n], a[i + 1][(i + 2) % n], a[i + 1][(i + 3) % n]) = x
else:
	for i in range(0, n, 2):
		(a[n - i - 2][i], a[n - i - 2][i + 1], a[n - i - 1][i], a[n - i - 1][i + 1]) = x
for i in a:
	print(''.join(i))


def comb(n, k, L):
	X = [[0] * n for _ in range(n)]
	for (A, a, b) in L:
		for i in range(len(A)):
			for j in range(len(A)):
				X[i + a][j + b] = A[i][j] + k if A[i][j] else 0
	return X

def ans(A):
	for a in A:
		print(''.join([chr(b + 97) if b else '.' for b in a]))
a3 = [[1, 0, 0], [1, 0, 0], [0, 2, 2]]
a4 = [[1, 2, 3, 3], [1, 2, 4, 4], [5, 5, 6, 7], [8, 8, 6, 7]]
a5 = [[1, 1, 2, 2, 3], [4, 0, 5, 5, 3], [4, 7, 0, 0, 8], [9, 7, 0, 0, 8], [9, 5, 5, 6, 6]]
a6 = [[1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0], [0, 2, 2, 0, 2, 2], [1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0], [0, 2, 2, 0, 2, 2]]
a7 = [[1, 0, 0, 1, 0, 0, 3], [1, 0, 0, 1, 0, 0, 3], [0, 2, 2, 0, 2, 2, 4], [1, 0, 0, 1, 0, 0, 4], [1, 0, 0, 1, 0, 0, 5], [0, 2, 2, 0, 2, 2, 5], [6, 6, 7, 7, 8, 8, 0]]
N = int(input())
if N <= 2:
	print(-1)
	exit()
if N <= 7:
	X = [a3, a4, a5, a6, a7][N - 3]
elif N == 11:
	X = comb(11, 0, [[a4, 0, 0], [a7, 4, 4]])
elif N == 14:
	X = comb(14, 0, [[a7, 0, 0], [a7, 7, 7]])
else:
	b = N % 4
	a = (N - b * 5) // 4
	L = []
	i = 0
	for _ in range(a):
		L.append([a4, i, i])
		i += 4
	for _ in range(b):
		L.append([a5, i, i])
		i += 5
	X = comb(N, 0, L)
ans(X)


n = int(input())
threeT = [['a', 'a', '.'], ['.', '.', 'a'], ['.', '.', 'a']]
fourT = [['a', 'a', 'c', 'd'], ['b', 'b', 'c', 'd'], ['e', 'f', 'g', 'g'], ['e', 'f', 'h', 'h']]
fiveT = [['a', 'a', '.', 'c', 'd'], ['.', 'b', 'b', 'c', 'd'], ['e', '.', 'f', 'f', 'g'], ['e', '.', 'h', '.', 'g'], ['i', 'i', 'h', 'j', 'j']]
sevenT = [['a', 'a', 'b', 'b', 'c', 'c', '.'], ['d', 'd', 'e', 'e', '.', '.', 'f'], ['g', '.', '.', 'h', 'h', '.', 'f'], ['g', 'i', '.', '.', '.', '.', 'j'], ['.', 'i', '.', '.', 'k', 'k', 'j'], ['.', '.', 'l', '.', '.', 'm', 'n'], ['.', '.', 'l', '.', '.', 'm', 'n']]
if n == 2:
	print(-1)
	exit()
if n == 7:
	for i in range(n):
		print(''.join(sevenT[i]))
	exit()
if n == 11:
	for i in range(n):
		br = ['.'] * n
		if i < 7:
			for j in range(7):
				br[j] = sevenT[i][j]
		else:
			for j in range(4):
				br[7 + j] = fourT[i - 7][j]
		print(''.join(br))
	exit()
if n % 3 == 0:
	for i in range(n):
		br = ['.'] * n
		ind = i % 3
		k = i // 3
		for j in range(3):
			br[3 * k + j] = threeT[ind][j]
		print(''.join(br))
	exit()
ac = n % 4
afive = ac
afour = (n - afive * 5) // 4
for i in range(n):
	br = ['.'] * n
	if i // 4 < afour:
		ind = i % 4
		k = i // 4
		for j in range(4):
			br[4 * k + j] = fourT[ind][j]
	else:
		off = 4 * afour
		ind = (i - off) % 5
		k = (i - off) // 5
		for j in range(5):
			br[off + 5 * k + j] = fiveT[ind][j]
	print(''.join(br))


N = int(input())
precomputed = {4: ['abcc', 'abdd', 'eefg', 'hhfg'], 5: ['abc..', 'abc..', 'ddeff', 'g.ehh', 'giijj'], 6: ['abc...', 'abc...', 'd.eeff', 'dghh..', '.g.ijj', 'kk.ill'], 7: ['abc....', 'abc....', 'def....', 'def....', 'g..hhii', 'g..jjkk', '.llmmnn']}
if N == 2:
	print(-1)
elif N == 3:
	print('aa.')
	print('..b')
	print('..b')
else:
	K = N // 4
	M = N % 4
	assert 4 * K + M == N
	K -= 1
	M += 4
	assert K >= 0
	assert M in [4, 5, 6, 7]
	assert 4 * K + M == N
	grid = [['.' for j in range(N)] for i in range(N)]
	for k in range(K):
		for i in range(4):
			for j in range(4):
				grid[4 * k + i][4 * k + j] = precomputed[4][i][j]
	for i in range(M):
		for j in range(M):
			grid[4 * K + i][4 * K + j] = precomputed[M][i][j]
	for row in grid:
		print(''.join(row))


import collections
table = collections.defaultdict(dict)
table[1][3] = '\naa.\n..b\n..b\n'.strip().splitlines()
table[2][3] = '\naab\nd.b\ndcc\n'.strip().splitlines()
table[3][4] = '\naadc\nbbdc\nghff\nghee\n'.strip().splitlines()
table[3][5] = '\nabb.d\na.ccd\neefgg\nhif..\nhi.jj\n'.strip().splitlines()
table[3][7] = '\na.cc.dd\nabb..e.\n..mm.ef\nl...n.f\nlk..n..\n.k..hhg\njj.ii.g\n'.strip().splitlines()

def solve1(n, q):
	dp = [None] * (n + 1)
	dp[0] = 0
	for i in range(n + 1):
		for delta in table[q].keys():
			if i - delta >= 0 and dp[i - delta] is not None:
				dp[i] = delta
	if dp[n] is None:
		return None
	f = [['.' for _ in range(n)] for _ in range(n)]
	k = n
	while k:
		delta = dp[k]
		k -= delta
		for y in range(delta):
			for x in range(delta):
				f[k + y][k + x] = table[q][delta][y][x]
	return [''.join(line) for line in f]

def solve(n):
	return solve1(n, 1) or solve1(n, 2) or solve1(n, 3)

def main():
	n = int(input())
	f = solve(n)
	if f:
		for line in f:
			print(line)
	else:
		print(-1)
main()


import sys
N = int(input())
if N == 2:
	print(-1)
	sys.exit()
ans = [['.'] * N for i in range(N)]
if N % 4 == 0:
	k = N // 4
	for i in range(k):
		num = 4 * i
		for j in range(2):
			ans[j + num][0 + num] = 'a'
			ans[j + num][1 + num] = 'b'
		for j in range(2, 4):
			ans[j + num][2 + num] = 'a'
			ans[j + num][3 + num] = 'b'
		for j in range(2):
			ans[2 + num][j + num] = 'c'
			ans[3 + num][j + num] = 'd'
		for j in range(2, 4):
			ans[0 + num][j + num] = 'c'
			ans[1 + num][j + num] = 'd'
	for u in ans:
		print(''.join(u))
	sys.exit()
n = N
while n % 2 == 0:
	n //= 2
k = N // n
for i in range(k):
	num = n * i
	for j in range(2):
		ans[j + num][num] = 'a'
		ans[j + num][(n - 2) // 2 + num] = 'b'
		ans[j + num][n - 3 + num] = 'c'
	for j in range(n - 2, n):
		ans[2 + num][j + num] = 'a'
		ans[(n + 1) // 2 + num][j + num] = 'b'
		ans[n - 1 + num][j + num] = 'c'
	lsls = ['d', 'e']
	for j in range(2, (n + 1) // 2):
		ans[j + num][j - 2 + num] = lsls[j % 2]
		ans[j + num][j - 1 + num] = lsls[j % 2]
	for j in range((n + 3) // 2, n):
		ans[j + num][j - 2 + num] = lsls[j % 2]
		ans[j + num][j - 3 + num] = lsls[j % 2]
	lsls = ['f', 'g']
	for j in range(2, (n + 1) // 2):
		ans[j + num][n - 1 - j + num] = lsls[j % 2]
		ans[j + 1 + num][n - 1 - j + num] = lsls[j % 2]
	for j in range((n + 3) // 2, n):
		ans[j + num][n - 1 - j + num] = lsls[j % 2]
		ans[j - 1 + num][n - 1 - j + num] = lsls[j % 2]
for u in ans:
	print(''.join(u))


import sys
dominoes = ['\n    aa.\n    ..a\n    ..a\n    ', '\n    aabc\n    ddbc\n    bcaa\n    bcdd\n    ', '\n    aabba\n    bcc.a\n    b..cb\n    a..cb\n    abbaa\n    ', '\n    aabc..\n    ddbc..\n    ..aabc\n    ..ddbc\n    bc..aa\n    bc..dd\n    ', '\n    aabbcc.\n    dd.dd.a\n    ..d..da\n    ..d..db\n    dd.dd.b\n    ..d..dc\n    ..d..dc\n    ']
dominoes = [domino.replace(' ', '').strip('\n') for domino in dominoes]
n = int(input())
if n == 2:
	print(-1)
	exit(0)
if n == 3:
	print(dominoes[0])
	exit(0)
dominoes = [dom.split('\n') for dom in dominoes[1:]]

def write(ix, col):
	for j in range(ix + 4):
		for i in range(col):
			sys.stdout.write('.')
		sys.stdout.write(dominoes[ix][j])
		for i in range(n - col - (ix + 4)):
			sys.stdout.write('.')
		sys.stdout.write('\n')
col = 0
write(n % 4, col)
col += 4 + n % 4
rem = n - col
while rem > 0:
	write(0, col)
	col += 4
	rem -= 4


a3 = '\naab\nb.b\nbaa\n'
a6 = '\naabccd\nb.bd.d\nbaadcc\nccdaab\nd.db.b\ndccbaa\n'
g4 = '\naaca\nbbca\ncabb\ncacc\n'
g4 = list(map(list, g4.split()))
g5 = '\naabba\nbcc.a\nb..cb\na..cb\nabbaa\n'
g5 = list(map(list, g5.split()))
g7 = '\ncaabb..\ncb..cc.\naba....\na.a..aa\nc..a..b\nc..a..b\n.aaccaa\n'
g7 = list(map(list, g7.split()))

def main():
	N = int(input())
	if N == 2:
		print(-1)
	elif N == 3:
		print('\n'.join(a3.split()))
	elif N == 6:
		print('\n'.join(a6.split()))
	else:
		x = [['.'] * N for i in range(N)]
		for v4 in range(N // 4 + 1):
			for v5 in range((N - v4 * 4) // 5 + 1):
				v7 = (N - v4 * 4 - v5 * 5) // 7
				if v4 * 4 + v5 * 5 + v7 * 7 != N:
					continue
				idx = 0
				for i in range(v4):
					for j in range(4):
						x[idx + j][idx:idx + 4] = g4[j]
					idx += 4
				for i in range(v5):
					for j in range(5):
						x[idx + j][idx:idx + 5] = g5[j]
					idx += 5
				for i in range(v7):
					for j in range(7):
						x[idx + j][idx:idx + 7] = g7[j]
					idx += 7
				for q in x:
					print(''.join(q))
				return
main()


N = int(input())
if N == 2:
	print(-1)
	exit()
elif N == 3:
	print('a..')
	print('a..')
	print('.aa')
	exit()
ans = [['.'] * N for _ in range(N)]
u = [['a', 'a'], ['b', 'b']]
v = [['c', 'd'], ['c', 'd']]
if N % 4 == 0:
	for i in range(0, N, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
elif N % 4 == 1:
	for i in range(0, N // 2 - 2, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
	for i in range(N // 2 + 3, N, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
	a = [['c', 'c', 'd', 'd', 'e'], ['f', 'g', '.', '.', 'e'], ['f', 'g', '.', '.', 'h'], ['i', '.', 'k', 'k', 'h'], ['i', 'j', 'j', 'l', 'l']]
	i0 = N // 2 - 2
	for h in range(5):
		for w in range(5):
			ans[i0 + h][i0 + w] = a[h][w]
elif N % 4 == 2:
	for i in range(0, N // 2 - 3, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
	for i in range(N // 2 + 3, N, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
	a = [['c', '.', 'd', 'd', 'e', 'e'], ['c', 'f', '.', 'g', 'g', '.'], ['h', 'f', '.', '.', '.', 'i'], ['h', '.', '.', '.', 'k', 'i'], ['.', 'j', 'j', '.', 'k', 'n'], ['l', 'l', 'm', 'm', '.', 'n']]
	i0 = N // 2 - 3
	for h in range(6):
		for w in range(6):
			ans[i0 + h][i0 + w] = a[h][w]
elif N % 4 == 3:
	for i in range(0, N // 2 - 3, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
	for i in range(N // 2 + 4, N, 2):
		for h in range(2):
			for w in range(2):
				ans[i + h][i + w] = u[h][w]
		for h in range(2):
			for w in range(2):
				ans[i + h][N - i - w - 1] = v[h][w]
	a = [['c', '.', '.', 'd', 'd', 'e', 'e'], ['c', 'f', '.', '.', 'g', 'g', '.'], ['h', 'f', 'i', '.', '.', '.', '.'], ['h', '.', 'i', '.', '.', '.', 'k'], ['.', '.', '.', 'j', 'j', 'm', 'k'], ['.', 'l', 'l', '.', '.', 'm', 'p'], ['n', 'n', 'o', 'o', '.', '.', 'p']]
	i0 = N // 2 - 3
	for h in range(7):
		for w in range(7):
			ans[i0 + h][i0 + w] = a[h][w]
[print(''.join(ans[i])) for i in range(N)]


n = int(input())
if n == 2:
	print(-1)
if n == 3:
	print('aa.')
	print('..b')
	print('..b')
if n == 4:
	ans = ['aabc', 'ddbc', 'bcaa', 'bcdd']
	print(*ans, sep='\n')
if n == 5:
	ans = ['aabbc', 'dde.c', '..eab', 'a..ab', 'accdd']
	print(*ans, sep='\n')
if n == 6:
	ans = ['aa.bbc', '..de.c', '..deff', 'aabcc.', 'd.b..a', 'dcc..a']
	print(*ans, sep='\n')
if n == 7:
	ans = ['aab.cc.', '..bd..e', 'ff.d..e', '..g.hhi', '..gj..i', 'kllj...', 'k..mmnn']
	print(*ans, sep='\n')
if n >= 8:
	ans = [['.' for i in range(n)] for j in range(n)]
	ch = [list('aabc'), list('ddbc'), list('bcaa'), list('bcdd')]
	x = n // 4 - 1
	y = n % 4 + 4
	for i in range(x):
		for j in range(4):
			for k in range(4):
				ans[i * 4 + j][i * 4 + k] = ch[j][k]
	if y == 4:
		for j in range(4):
			for k in range(4):
				ans[x * 4 + j][x * 4 + k] = ch[j][k]
	elif y == 5:
		ch2 = ['aabbc', 'dde.c', '..eab', 'a..ab', 'accdd']
		for j in range(5):
			for k in range(5):
				ans[x * 4 + j][x * 4 + k] = ch2[j][k]
	elif y == 6:
		ch2 = ['aa.bbc', '..de.c', '..deff', 'aabcc.', 'd.b..a', 'dcc..a']
		for j in range(6):
			for k in range(6):
				ans[x * 4 + j][x * 4 + k] = ch2[j][k]
	elif y == 7:
		ch2 = ['aab.cc.', '..bd..e', 'ff.d..e', '..g.hhi', '..gj..i', 'kllj...', 'k..mmnn']
		for j in range(7):
			for k in range(7):
				ans[x * 4 + j][x * 4 + k] = ch2[j][k]
	for row in ans:
		print(*row, sep='')


def search(field, xs, ys, n, q, c, r):
	if r == 0:
		return field
	for i in range(n):
		if xs[i] >= q:
			continue
		can_vertical = i < n - 1 and xs[i + 1] < q
		for j in range(n):
			if ys[j] >= q:
				continue
			if field[i][j] != 0:
				continue
			if can_vertical and field[i + 1][j] == 0:
				field[i][j] = field[i + 1][j] = c
				xs[i] += 1
				xs[i + 1] += 1
				ys[j] += 1
				result = search(field, xs, ys, n, q, c + 1, r - 1)
				if result is not None:
					return result
				field[i][j] = field[i + 1][j] = 0
				xs[i] -= 1
				xs[i + 1] -= 1
				ys[j] -= 1
			if j < n - 1 and ys[j + 1] < q and (field[i][j + 1] == 0):
				field[i][j] = field[i][j + 1] = c
				xs[i] += 1
				ys[j] += 1
				ys[j + 1] += 1
				result = search(field, xs, ys, n, q, c + 1, r - 1)
				if result is not None:
					return result
				field[i][j] = field[i][j + 1] = 0
				xs[i] -= 1
				ys[j] -= 1
				ys[j + 1] -= 1
	return None

def search_main(n, q=3):
	print(n, q)
	field = [[0] * n for _ in range(n)]
	xs = [0] * n
	ys = [0] * n
	remain = n * 2 * q // 3
	result = search(field, xs, ys, n, q, 1, remain)
	if result is None:
		print(None)
	else:
		for row in result:
			print(' '.join(('{:02d}'.format(x) for x in row)))

def solve(n):
	if n <= 2:
		print(-1)
		return
	if n == 3:
		print('aab\nc.b\ncdd')
		return
	field = [['.'] * n for _ in range(n)]
	r = n % 4
	repeat = [n, n - 5, n - 6, n - 7]
	for i in range(0, repeat[r], 4):
		field[i + 0][i:i + 4] = list('aacd')
		field[i + 1][i:i + 4] = list('bbcd')
		field[i + 2][i:i + 4] = list('efgg')
		field[i + 3][i:i + 4] = list('efhh')
	if r == 1:
		field[n - 5][n - 5:n] = list('abc..')
		field[n - 4][n - 5:n] = list('abc..')
		field[n - 3][n - 5:n] = list('deeff')
		field[n - 2][n - 5:n] = list('d.ghh')
		field[n - 1][n - 5:n] = list('iigjj')
	elif r == 2:
		field[n - 6][n - 6:n] = list('abc...')
		field[n - 5][n - 6:n] = list('abc...')
		field[n - 4][n - 6:n] = list('d.eeff')
		field[n - 3][n - 6:n] = list('dghh..')
		field[n - 2][n - 6:n] = list('.g.ijj')
		field[n - 1][n - 6:n] = list('kk.ill')
	elif r == 3:
		field[n - 7][n - 7:n] = list('abc....')
		field[n - 6][n - 7:n] = list('abc....')
		field[n - 5][n - 7:n] = list('def....')
		field[n - 4][n - 7:n] = list('def....')
		field[n - 3][n - 7:n] = list('g..hhii')
		field[n - 2][n - 7:n] = list('g..jjkk')
		field[n - 1][n - 7:n] = list('.llmmnn')
	print('\n'.join(map(''.join, field)))
n = int(input())
solve(n)


import sys
sys.setrecursionlimit(10 ** 6)
readline = sys.stdin.readline
n = int(input())
a21 = [['a', 'a'], ['b', 'b']]
a22 = [['c', 'd'], ['c', 'd']]
a3 = [['a', 'a', '.'], ['.', '.', 'b'], ['.', '.', 'b']]
a4 = [['q', 'q', 'r', 's'], ['t', 't', 'r', 's'], ['u', 'x', 'v', 'v'], ['u', 'x', 'w', 'w']]
a5 = [['c', 'c', 'd', 'd', 'l'], ['e', 'f', 'f', '.', 'l'], ['e', '.', '.', 'h', 'g'], ['i', '.', '.', 'h', 'g'], ['i', 'j', 'j', 'k', 'k']]
a7 = [['c', 'c', 'd', 'd', '.', '.', 'e'], ['.', 'f', 'f', '.', '.', 'g', 'e'], ['.', '.', 'h', 'h', '.', 'g', 'i'], ['j', '.', '.', '.', 'k', '.', 'i'], ['j', 'l', '.', '.', 'k', '.', '.'], ['m', 'l', '.', '.', 'n', 'n', '.'], ['m', '.', '.', 'o', 'o', 'p', 'p']]
if n == 2:
	print(-1)
else:
	if n == 3:
		ans = a3
	elif n % 2 == 0:
		ans = [['.'] * n for i in range(n)]
		for i in range(n // 2):
			for j in range(2):
				for k in range(2):
					ans[2 * i + j][2 * i + k] = a21[j][k]
		for i in range(n // 2):
			for j in range(2):
				for k in range(2):
					ans[2 + 2 * i + j - n][2 * i + k] = a22[j][k]
	elif n % 4 == 1:
		ans = [['.'] * n for i in range(n)]
		for i in range(5):
			for j in range(5):
				ans[i][j] = a5[i][j]
		for i in range((n - 5) // 2):
			for j in range(2):
				for k in range(2):
					ans[5 + 2 * i + j][5 + 2 * i + k] = a21[j][k]
		for i in range((n - 5) // 2):
			for j in range(2):
				for k in range(2):
					c = 5 + 2 + 2 * i + j
					d = 5 + 2 * i + k
					if c >= n:
						c = 5 + j
					ans[c][d] = a22[j][k]
	elif n % 4 == 3:
		ans = [['.'] * n for i in range(n)]
		for i in range(7):
			for j in range(7):
				ans[i][j] = a7[i][j]
		for i in range((n - 7) // 2):
			for j in range(2):
				for k in range(2):
					ans[7 + 2 * i + j][7 + 2 * i + k] = a21[j][k]
		for i in range((n - 7) // 2):
			for j in range(2):
				for k in range(2):
					c = 7 + 2 + 2 * i + j
					d = 7 + 2 * i + k
					if c >= n:
						c = 7 + j
					ans[c][d] = a22[j][k]
	for i in ans:
		print(*i, sep='')


n = int(input())
if n == 2:
	print(-1)
elif n == 3:
	print('aab')
	print('d.b')
	print('dcc')
elif n % 4 == 0:
	for i in range(n // 4):
		temp = ['.' * n] * 4
		temp[0] = temp[0][:4 * i] + 'aabd' + temp[0][(i + 1) * 4:]
		temp[1] = temp[1][:4 * i] + 'ccbd' + temp[1][(i + 1) * 4:]
		temp[2] = temp[2][:4 * i] + 'efgg' + temp[2][(i + 1) * 4:]
		temp[3] = temp[3][:4 * i] + 'efhh' + temp[3][(i + 1) * 4:]
		print(temp[0])
		print(temp[1])
		print(temp[2])
		print(temp[3])
elif n % 4 == 1:
	temp = [''] * 5
	temp[0] = 'aabbc' + '.' * (n - 5)
	temp[1] = 'fg..c' + '.' * (n - 5)
	temp[2] = 'fg..d' + '.' * (n - 5)
	temp[3] = 'h.jjd' + '.' * (n - 5)
	temp[4] = 'hiiee' + '.' * (n - 5)
	print(temp[0])
	print(temp[1])
	print(temp[2])
	print(temp[3])
	print(temp[4])
	for i in range(n // 4 - 1):
		temp = ['.' * n] * 4
		temp[0] = temp[0][:4 * i + 5] + 'aabd' + temp[0][(i + 1) * 4 + 5:]
		temp[1] = temp[1][:4 * i + 5] + 'ccbd' + temp[1][(i + 1) * 4 + 5:]
		temp[2] = temp[2][:4 * i + 5] + 'efgg' + temp[2][(i + 1) * 4 + 5:]
		temp[3] = temp[3][:4 * i + 5] + 'efhh' + temp[3][(i + 1) * 4 + 5:]
		print(temp[0])
		print(temp[1])
		print(temp[2])
		print(temp[3])
elif n % 4 == 2:
	temp = [''] * 6
	temp[0] = 'a.ccaa' + '.' * (n - 6)
	temp[1] = 'ab.bb.' + '.' * (n - 6)
	temp[2] = 'cb...c' + '.' * (n - 6)
	temp[3] = 'c...bc' + '.' * (n - 6)
	temp[4] = '.bb.ba' + '.' * (n - 6)
	temp[5] = 'aacc.a' + '.' * (n - 6)
	print(temp[0])
	print(temp[1])
	print(temp[2])
	print(temp[3])
	print(temp[4])
	print(temp[5])
	for i in range(n // 4 - 1):
		temp = ['.' * n] * 4
		temp[0] = temp[0][:4 * i + 6] + 'aabd' + temp[0][(i + 1) * 4 + 6:]
		temp[1] = temp[1][:4 * i + 6] + 'ccbd' + temp[1][(i + 1) * 4 + 6:]
		temp[2] = temp[2][:4 * i + 6] + 'efgg' + temp[2][(i + 1) * 4 + 6:]
		temp[3] = temp[3][:4 * i + 6] + 'efhh' + temp[3][(i + 1) * 4 + 6:]
		print(temp[0])
		print(temp[1])
		print(temp[2])
		print(temp[3])
else:
	temp = [''] * 7
	temp[0] = 'a.aa.aa' + '.' * (n - 7)
	temp[1] = 'a...bc.' + '.' * (n - 7)
	temp[2] = '....bcd' + '.' * (n - 7)
	temp[3] = 'a..ee.d' + '.' * (n - 7)
	temp[4] = 'abb..a.' + '.' * (n - 7)
	temp[5] = '.cc..ab' + '.' * (n - 7)
	temp[6] = 'dd.aa.b' + '.' * (n - 7)
	print(temp[0])
	print(temp[1])
	print(temp[2])
	print(temp[3])
	print(temp[4])
	print(temp[5])
	print(temp[6])
	for i in range(n // 4 - 1):
		temp = ['.' * n] * 4
		temp[0] = temp[0][:4 * i + 7] + 'aabd' + temp[0][(i + 1) * 4 + 7:]
		temp[1] = temp[1][:4 * i + 7] + 'ccbd' + temp[1][(i + 1) * 4 + 7:]
		temp[2] = temp[2][:4 * i + 7] + 'efgg' + temp[2][(i + 1) * 4 + 7:]
		temp[3] = temp[3][:4 * i + 7] + 'efhh' + temp[3][(i + 1) * 4 + 7:]
		print(temp[0])
		print(temp[1])
		print(temp[2])
		print(temp[3])


N = int(input())
if N == 2:
	print(-1)
elif N == 3:
	ptn = ['abb', 'a.c', 'ddc']
	print('\n'.join(ptn))
else:
	ptns = {4: ['abcc', 'abdd', 'eegh', 'ffgh'], 5: ['abc..', 'abc..', 'ghhdd', 'g.iee', 'jjiff'], 6: ['abc...', 'abc...', 'ddeeff', 'gghhii', '...jkl', '...jkl'], 7: ['abc....', 'abc....', 'def....', 'def....', 'm..gghh', 'm..iijj', '.nnkkll']}
	x = N // 4 - 1
	y = N - 4 * x
	ansss = [['.'] * N for _ in range(N)]
	for k in range(x):
		for i in range(4):
			for j in range(4):
				ansss[4 * k + i][4 * k + j] = ptns[4][i][j]
	for i in range(y):
		for j in range(y):
			ansss[4 * x + i][4 * x + j] = ptns[y][i][j]
	print('\n'.join([''.join(anss) for anss in ansss]))


n = int(input())
if n % 3 == 0:
	for i in range(n // 3):
		print('a..' * (n // 3))
		print('a..' * (n // 3))
		print('.aa' * (n // 3))
elif n % 2 == 0 and n >= 4:
	x = 'aacd' + '.' * (n - 4)
	y = 'bbcd' + '.' * (n - 4)
	for i in range(n // 2):
		print(x)
		print(y)
		x = x[2:] + x[:2]
		y = y[2:] + y[:2]
elif n >= 13:
	x = 'aacd' + '.' * (n - 13)
	y = 'bbcd' + '.' * (n - 13)
	for i in range((n - 9) // 2):
		print(x + '.' * 9)
		print(y + '.' * 9)
		x = x[2:] + x[:2]
		y = y[2:] + y[:2]
	for i in range(3):
		print('.' * (n - 9) + 'a..a..a..')
		print('.' * (n - 9) + 'a..a..a..')
		print('.' * (n - 9) + '.aa.aa.aa')
elif n == 5:
	print('aabba')
	print('bc..a')
	print('bc..b')
	print('a.ddb')
	print('abbaa')
elif n == 7:
	print('aabbcc.')
	print('dd.dd.a')
	print('..e..ea')
	print('..e..eb')
	print('dd.dd.b')
	print('..e..ec')
	print('..e..ec')
elif n == 11:
	print('aabbcc.....')
	print('dd.dd.a....')
	print('..e..ea....')
	print('..e..eb....')
	print('dd.dd.b....')
	print('..e..ec....')
	print('..e..ec....')
	print('.......aacd')
	print('.......bbcd')
	print('.......cdaa')
	print('.......cdbb')
else:
	print(-1)


def join(xs, N):
	n = len(xs)
	r = ''
	s = 0
	for (i, x) in enumerate(xs):
		x = x.strip()
		t = len(x.split())
		(S, E) = ('.' * s, '.' * (N - t - s))
		for l in x.split():
			r += S + l + E + '\n'
		s += t
	return r
s7 = '\n.bc.a..\n.bc.a..\n..aabba\naab...a\nx.baa..\nx..b.aa\naa.b.xx\n'
s6 = '\n..aabx\nd...bx\ndla...\n.lab..\nxx.bxx\nddaall'
s5 = '\naa.bx\nd..bx\ndee.a\ni.rra\nijjxx\n'
s4 = '\nxyzz\nxyrr\nzzxy\nrrxy'
s3 = '\njj.\n..j\n..j'
s = [s4, s5, s6, s7]
N = int(input())
if N < 3:
	print(-1)
elif N == 3:
	print(s3.strip())
elif N <= 7:
	print(s[N - 4].strip())
else:
	print(join([s[0]] * (N // 4 - 1) + [s[N % 4]], N))


N = int(input())
A = [[] for _ in range(8)]
(a, b, c, d, e, f, g) = list('abcdefg')
o = '.'
A[3] = [[o, a, a], [b, o, o], [b, o, o]]
A[4] = [[a, a, b, c], [d, d, b, c], [b, c, a, a], [b, c, d, d]]
A[5] = [[o, o, a, b, c], [o, o, a, b, c], [a, a, d, d, e], [b, b, f, o, e], [c, c, f, g, g]]
A[6] = [[o, a, a, c, c, d], [b, o, o, e, o, d], [b, o, o, e, f, f], [c, c, d, o, a, a], [e, o, d, b, o, o], [e, f, f, b, o, o]]
A[7] = [[o, o, o, o, a, b, a], [o, o, o, o, a, b, a], [o, o, o, o, b, a, b], [o, o, o, o, b, a, b], [a, a, b, b, o, c, c], [b, b, a, a, d, o, o], [a, a, b, b, d, o, o]]
if N == 2:
	print(-1)
	exit()
if N == 3:
	for i in range(3):
		print(''.join(A[3][i]))
	exit()
D = [[o] * N for _ in range(N)]
(div, mod) = divmod(N, 4)
for i in range(div - 1):
	x = i * 4
	for j in range(4):
		for k in range(4):
			D[x + j][x + k] = A[4][j][k]
x = (div - 1) * 4
for i in range(4 + mod):
	for j in range(4 + mod):
		D[x + i][x + j] = A[4 + mod][i][j]
for i in D:
	print(''.join(i))