#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>

using namespace std;

#define LL long long

const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};

int div(int x, int a, int b) {
	for (int i = 0; i * a <= x; ++i) {
		if ((x - i * a) % b == 0) {
			return i;
		}
	}
	return -1;
}
char **c;

int aa[26];

int n;

bool flag = false;

bool valid(int x, int y) {
	return (x >= 0 && x < n && y >= 0 && y < n);
}

void addc(int x, int y) {
	if (valid(x, y)) {
		aa[c[x][y] - 'a'] += 1;
	}
}

char get_c(int x, int y, int d) {
	memset(aa, 0, sizeof(aa));
	if (d == 0) { // horizontal, (x, y) - (x + 1, y)
		addc(x - 1, y); addc(x, y - 1); addc(x, y + 1);
		addc(x + 2, y); addc(x + 1, y + 1); addc(x + 1, y - 1);
	}
	else {
		addc(x - 1, y); addc(x, y - 1); addc(x + 1, y);
		addc(x - 1, y + 1); addc(x + 1, y + 1); addc(x, y + 2);
	}
	for (int i = 0; i < 26; ++i) {
		if (aa[i] == 0) {
			return char('a' + i);
		}
	}
	return '0';
}

void add_vd(int x, int y) {
	char s = get_c(x, y, 1);
	c[x][y] = s;
	c[x][y + 1] = s;
}
void add_hd(int x, int y) {
	char s = get_c(x, y, 0);
	c[x][y] = s;
	c[x + 1][y] = s;
}

void add(int x, int y, int d) {
	if (d == 0) {
		add_hd(x, y);
	}
	else {
		add_vd(x, y);
	}
}

void make3(int x, int y, int d) {
	if (d == 1) {
		add_vd(x, y); add_hd(x + 1, y + 2); return ;
	}
	if (d == 2) {
		add_vd(x, y); add_hd(x, y + 2); add_hd(x + 1, y); add_vd(x + 2, y + 1); return ;
	}
	cout << "error 3" << endl;
}

void make4(int x, int y, int d) {
	if (d == 3) {
		add_vd(x, y); add_vd(x + 1, y); add_vd(x + 2, y + 2); add_vd(x + 3, y + 2);
		add_hd(x, y + 2); add_hd(x, y + 3); add_hd(x + 2, y); add_hd(x + 2, y + 1);
		return ;
	}
	cout << "error 4" << endl;
}

void make6(int x, int y, int d) {
	if (d == 1) {
		make3(x, y, 1); make3(x + 3, y + 3, 1); return;
	}
	if (d == 2) {
		make3(x, y, 2); make3(x + 3, y + 3, 2); return;
	}
	if (d == 3) {
		make3(x, y, 2); make3(x + 3, y + 3, 2);
		make3(x, y + 3, 1); make3(x + 3, y, 1);
		return ;
	}
	if (d == 4) {
		make3(x, y, 2); make3(x + 3, y, 2);
		make3(x, y + 3, 2); make3(x + 3, y + 3, 2);
	}
	cout << "error 6" << endl;
}

void make9(int x, int y, int d) {
	if (d == 1) {
		make6(x, y, 1); make3(x + 6, y + 6, 1); return ;
	}
	if (d == 2) {
		make6(x, y, 2); make3(x + 6, y + 6, 2); return ;
	}
	if (d == 3) {
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				make3(x + i * 3, y + j * 3, 1);
			}
		}
		return ;
	}
	if (d == 4) {
		make6(x, y, 3); make3(x + 6, y, 1); make3(x + 6, y + 3, 1);
		make6(x, y + 6, 1); make3(x + 3, y + 6, 1); make3(x + 6, y + 6, 2); return ;
	}
	if (d == 5) {
		make6(x, y, 3); make3(x + 6, y, 2); make3(x + 6, y + 3, 2);
		make6(x, y + 6, 2); make3(x + 3, y + 6, 2); make3(x + 6, y + 6, 1); return ;
	}
	if (d == 6) {
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				make3(x + i * 3, y + j * 3, 2);
			}
		}
		return ;
	}
}

void make5(int x, int y, int d) {
	const int aa[10][3] = {{0, 0, 0}, {0, 1, 0}, {0, 2, 0}, {2, 0, 0}, {2, 1, 1}, {2, 3, 1}, {3, 2, 0}, 
	{3, 3, 1}, {4, 0, 1}, {4, 3, 1}};
	if (d == 3) {
		for (int i = 0; i < 10; ++i) {
			add(x + aa[i][0], y + aa[i][1], aa[i][2]);
		}
		return ;
	}
	cout << "error 5" << endl;
}
void make7(int x, int y, int d) {
	const int aa[14][3] = {{0, 0, 0}, {0, 1, 0}, {0, 2, 0}, {2, 0, 0}, {2, 1, 0}, {2, 2, 0}, {4, 0, 0}, 
	{4, 3, 1}, {4, 5, 1}, {5, 3, 1}, {5, 5, 1}, {6, 1, 1}, {6, 3, 1}, {6, 5, 1}};
	if (d == 3) {
		for (int i = 0; i < 14; ++i) {
			add(x + aa[i][0], y + aa[i][1], aa[i][2]);
		}

		return ;
	}
	cout << "error 7" << endl;
}

void work() {
	if (n % 3 == 0) {
		for (int i = 0; i * 3 < n; ++i) {
			make3(i * 3, i * 3, 1);
		}
		flag = true;
		return ;
	}
	if (n % 4 == 0) {
		for (int i = 0; i * 4 < n; ++i) {
			make4(i * 4, i * 4, 3);
		}
		flag = true;
		return ;
	}
	int d49 = div(n, 4, 9);
	if (d49 != -1) {
		for (int i = 0; i < d49; ++i) {
			make4(i * 4, i * 4, 3);
		}
		for (int i = 0; i * 9 < n - (4 * d49); ++i) {
			make9(4 * d49 + i * 9, 4 * d49 + i * 9, 3);
		}
		flag = true;
		return ;
	}
	int d46 = div(n, 4, 6);
	if (d46 != -1) {
		for (int i = 0; i < d46; ++i) {
			make4(i * 4, i * 4, 3);
		}
		for (int i = 0; i * 6 < n - (4 * d46); ++i) {
			make6(4 * d46 + i * 6, 4 * d46 + i * 6, 3);
		}
		flag = true;
		return ;
	}
	if (n == 19) {
		make4(0, 0, 3);
		make6(4, 4, 3);
		make9(10, 10, 3);
		flag = true;
		return ;
	}
	if (n == 23) {
		make4(0, 0, 3);
		make6(4, 4, 3);
		make9(10, 10, 3);
		make4(19, 19, 3);
		flag = true;
		return ;
	}
	if (n == 5) {
		make5(0, 0, 3);
		flag = true;
		return ;
	}
	if (n == 7) {
		make7(0, 0, 3);
		flag = true;
		return ;
	}
	if (n == 11) {
		make5(0, 0, 3);
		make6(5, 5, 3);
		flag = true;
		return;
	}
}

int main() {
	scanf("%d", &n);
	c = new char*[n];
	for (int i = 0; i < n; ++i) {
		c[i] = new char[n];
		for (int j = 0; j < n; ++j) {
			c[i][j] = '.';
		}
	}
	work();

	if (flag) {
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < n; ++j) {
				putchar(c[i][j]);
			}
			putchar('\n');
		}
	}
	else {
		cout << "-1" << endl;
	}
	return 0;
}

Measured memory_bytes: 2176