#define _CRT_SECURE_NO_WARNINGS

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <queue>

using namespace std;

typedef long long ll;

const int MAXN = 1000 + 5;

int t;

int n;
char grid[MAXN][MAXN];
int dir[4][2] = { {1,0},{-1,0},{0,1},{0,-1} };

char grid3[3][4] =
{
	"aab",
	"b.b",
	"baa",
};

char grid4[4][5] =
{
	"aaba",
	"ccba",
	"abcc",
	"abaa",
};

char grid5[5][6] =
{
	"aabba",
	"bba.a",
	"ccabb",
	"..bac",
	"..bac",
};

char grid6[6][7] =
{
	"aabbaa",
	"bbaabb",
	"acb...",
	"acb...",
	"...aba",
	"...aba",
};

char grid7[7][8] =
{
	"aabbaa.",
	"bbaab..",
	"aa..baa",
	"..ab..b",
	"..ab..b",
	"....aba",
	"....aba",
};

bool isValid(int x, int y, char c)
{
	for (int i = 0; i < 4; ++i) {
		int xx = x + dir[i][0];
		int yy = y + dir[i][1];
		if (xx >= 0 && xx < n&&yy >= 0 && yy < n) {
			if (grid[xx][yy] == c) return false;
		}
	}
	return true;
}

bool isRowValidNow(int row)
{
	int piece = -1;
	for (int i = row-1; i <= row; ++i) {
		int rr = 0;
		for (int j = 0; j < n; ++j) {
			if (grid[i][j] != '.') {
				if (j == 0 || grid[i][j - 1] != grid[i][j]) {
					rr++;
				}
			}
		}
		if (piece == -1) piece = rr;
		if (rr != piece) {
			return false;
		}
	}
	if (piece > 0) return true;
	return false;
}

bool dfs(int x, int y)
{
	static long long cnt = 0;
	cnt++;
	if (cnt % 1000000 == 0) {
		cout << cnt << endl;
		cout << x << "," << y << endl;
	}
	if ((x == n - 1 && y == n - 1) || x >= n){
		int flag = false;
		if (x < n && grid[x][y] == '#') {
			grid[x][y] = '.';
			flag = true;
		}
		int piece = -1;
		for (int i = 0; i < n; ++i) {
			int rr = 0;
			int cc = 0;
			for (int j = 0; j < n; ++j) {
				if (grid[i][j] != '.') {
					if (j == 0 || grid[i][j - 1] != grid[i][j]) {
						rr++;
					}
				}

				if (grid[j][i] != '.') {
					if (j == 0 || grid[j-1][i] != grid[j][i]) {
						cc++;
					}
				}
			}
			if (piece == -1) piece = rr;
			if (rr != piece || cc != piece) {
				if(flag) grid[x][y] = '#';
				return false;
			}
		}
		//grid[x][y] = '#';
		if (piece > 0) return true;
		if (flag) grid[x][y] = '#';
		return false;
	}
	if (grid[x][y] == '#') {
		if (y < n - 1 && grid[x][y+1] == '#') {//横着放
			bool canSet = false;
			for (char c = 'a'; c <= 'z'; c += 1) {
				if (isValid(x, y, c) && isValid(x, y+1, c)) {
					grid[x][y] = grid[x][y + 1] = c;
					canSet = true;
					break;
				}
			}
			if (canSet) {
				int xx = x;
				int yy = y + 2;
				if (yy == n) {
					xx++; yy = 0;
					if (x > 0 && isRowValidNow(x)) {
						if (dfs(xx, yy)) return true;
					}
					else if (x == 0)
						if (dfs(xx, yy)) return true;
				}
				else {
					if (dfs(xx, yy)) return true;
				}
				grid[x][y] = grid[x][y + 1] = '#';
			}
		}
		if (x < n - 1 && grid[x + 1][y] == '#') {//竖着放
			bool canSet = false;
			for (char c = 'a'; c <= 'z'; c += 1) {
				if (isValid(x, y, c) && isValid(x+1, y, c)) {
					grid[x][y] = grid[x+1][y] = c;
					canSet = true;
					break;
				}
			}
			if (canSet) {
				int xx = x;
				int yy = y + 1;
				if (yy == n) {
					xx++; yy = 0;
					if (x > 0 && isRowValidNow(x)) {
						if (dfs(xx, yy)) return true;
					}
					else if (x == 0)
						if (dfs(xx, yy)) return true;
				}
				else {
					if (dfs(xx, yy)) return true;
				}
				grid[x][y] = grid[x + 1][y] = '#';
			}
		}
		//不放
		grid[x][y] = '.';
		int xx = x;
		int yy = y + 1;
		if (yy == n) { 
			xx++; yy = 0; 
			if (x > 0 && isRowValidNow(x)) {
				if (dfs(xx, yy)) return true;
			}
			else if (x == 0)
				if (dfs(xx, yy)) return true;
		}
		else {
			if (dfs(xx, yy)) return true;
		}
		grid[x][y] = '#';
		return false;
	}
	else {
		y++;
		if (y == n) { 
			x++; y = 0; 
			if (x - 1 > 0 && isRowValidNow(x - 1)) {
				return dfs(x, y);
			}
			else if (x == 0)
				return dfs(x, y);
		}
		return dfs(x, y);
	}
}

void brute_force(int n)
{
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < n; ++j) grid[i][j] = '#';

	dfs(0, 0);

	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) cout << grid[i][j];
		cout << endl;
	}
}

inline void print(int x, int y, int m)
{
	if (m == 4) {
		cout << grid4[x][y];
	}
	else if (m == 5) {
		cout << grid5[x][y];
	}
	else if (m == 6) {
		cout << grid6[x][y];
	}
	else if (m == 7) {
		cout << grid7[x][y];
	}
}

int main()
{
	//freopen("in.txt", "r", stdin);
	ios::sync_with_stdio(false);
	while (cin >> n) {
		//brute_force(n);
		if (n <= 2) cout << -1 << endl;
		else if (n == 3) {
			for (int i = 0; i < 3; ++i) cout << grid3[i] << endl;
		}
		else {
			int mm = n % 4;
			int dd = n / 4;
			mm += 4;
			dd -= 1;
			int rr = dd * 4;
			for (int i = 0; i < n; ++i) {
				if (i < rr) {
					for (int j = 0; j < n; ++j) {
						if (j >= (i / 4) * 4 && j < (i / 4 + 1) * 4)
							cout << grid4[i % 4][j % 4];
						else
							cout << '.';
					}
					cout << endl;
				}
				else {
					for (int j = 0; j < rr; ++j) {
						cout << '.';
					}
					for (int j = 0; j < mm; ++j) {
						print(i - rr, j, mm);
					}
					cout << endl;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1280