/*

n % 3 == 0

aa....
..b...
..b...
...cc.
.....d
.....d

aa.zz.
..b..w
..b..w
oo.cc.
..i..d
..i..d

n % 4 == 0

aacd
bbcd
efgg
efhh

5 and/or 6

aab..
..bzz
ce...
ce...
..ww.

*/

#include <bits/stdc++.h>
using namespace std;

int n;
int id[25][25];

int different_in_row(int row) {
	set<int> s;
	for(int c = 0; c < n; c++) {
		if(id[row][c]) {
			s.insert(id[row][c]);
		}
	}
	return s.size();
}
int different_in_col(int col) {
	set<int> s;
	for(int r = 0; r < n; r++) {
		if(id[r][col]) {
			s.insert(id[r][col]);
		}
	}
	return s.size();
}

set<int> found;

map<int, vector<string>> shape;

set<int> done;

void rec(int row, int col, int nxt, bool print) {
	if(row == 0 && col == 0) {
		done.clear();
		for(int i = 0; i < n; ++i) {
			for(int j = 0; j < n; ++j) {
				id[i][j] = 0;
			}
		}
	}
	// cout << n << " " << print << endl;
	if(found.count(n)) {
		return;
	}
	assert(n >= 2);
	// if(row >= 1 && different_in_col(col - 1) > different_in_row(0)) {
		// return;
	// }
	if(row == n - 1) {
		if(different_in_col(col - 1) != different_in_row(0)) {
			return;
		}
	}
	if(col == n) {
		int me = different_in_row(row);
		if(n == 4 || n == 5 || n == 6) {
			if(me != 3) {
				return;
			}
		}
		if(me != different_in_row(0)) {
			return;
		}
		col = 0;
		row++;
	}
	if(row == n) {
		// static set<int> done;
		int me = different_in_row(0);
		if(me == 0 || done.count(me)) {
			return;
		}
		done.insert(me);
		// printf("%d\n", me);	
		vector<string> grid(n, string(n, '.'));
		for(int r = 0; r < n; r++) {
			for(int c = 0; c < n; c++) {
				if(id[r][c] == 0) {
					// printf(".");
				}
				else {
					grid[r][c] = 'a' + id[r][c];
					// printf("%c", 'a' + id[r][c]);
				}
			}
		}
		if(print) {
			for(string s : grid) {
				cout << s << endl;
			}
		}
		else {
			shape[n] = grid;
		}
		// puts("");
		found.insert(n);
		// puts("");
		return;
	}
	rec(row, col + 1, nxt, print);
	if(id[row][col] == 0) {
		if(row + 1 < n) {
			id[row][col] = id[row+1][col] = nxt;
			rec(row, col + 1, nxt + 1, print);
			id[row][col] = id[row+1][col] = 0;
		}
		if(col + 1 < n && !id[row][col+1]) {
			id[row][col] = id[row][col+1] = nxt;
			rec(row, col + 1, nxt + 1, print);
			id[row][col] = id[row][col+1] = 0;
		}
	}
}

int main() {
	cin >> n;
	if(n == 2) {
		cout << -1 << endl;
		return 0;
	}
	if(n == 7) {
		cout << "....bcd\n\
....bcd\n\
....efg\n\
....efg\n\
hhii..j\n\
kkll..j\n\
mmnnoo." << endl;
return 0;
}
	if(n < 7) {
		rec(0, 0, 1, true);
		return 0;
	}
	assert(n >= 8);
	// 4 5 6
	vector<string> grid(n, string(n, '.'));
	
	vector<vector<int>> pieces(n + 1);
	pieces[4] = {4};
	pieces[5] = {5};
	pieces[6] = {6};
	for(int i = 8; i <= n; i++) {
		for(int x : {4, 5, 6}) {
			if(!pieces[i-x].empty()) {
				pieces[i] = pieces[i-x];
				pieces[i].push_back(x);
				break;
			}
		}
	}
	// for(int a : pieces[n]) {
		// printf("%d ", a);
	// }
	// puts("");
	// return 0;
	
	int memo_n = n;
	for(int a : {4, 5, 6}) {
		n = a;
		// found.clear();
		rec(0, 0, 1, false);
		// cerr << a << " " << shape.count(a) << endl;
	}
	n = memo_n;
	
	int corner = 0;
	
	for(int a : pieces[n]) {
		for(int i = 0; i < a; ++i) {
			for(int j = 0; j < a; ++j) {
				grid[corner+i][corner+j] = shape[a][i][j];
			}
		}
		corner += a;
	}
	
	for(string s : grid) {
		printf("%s\n", s.c_str());
	}
}







Measured memory_bytes: 3328