#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int used[1009][1009];
int lx[100009], ly[100009];
int A[100009], B[100009], S[100009];

bool Output(int N, int M) {
	for (int i = 0; i < 100000; i++) { lx[i] = (1 << 30), ly[i] = (1 << 30); }
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			lx[used[i][j]] = min(lx[used[i][j]], i);
			ly[used[i][j]] = min(ly[used[i][j]], j);
		}
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (used[i][j] == 0) cout << ".";
			else {
				int col = (lx[used[i][j]] % 4) * 4 + (ly[used[i][j]] % 4);
				cout << (char)('a' + col);
			}
		}
		cout << endl;
	}

	vector<int> res;
	for (int i = 0; i < N; i++) {
		vector<int> vec;
		for (int j = 0; j < N; j++) {
			if (used[i][j] >= 1) vec.push_back(used[i][j]);
		}
		sort(vec.begin(), vec.end());
		vec.erase(unique(vec.begin(), vec.end()), vec.end());
		res.push_back(vec.size());
	}
	for (int i = 0; i < N; i++) {
		vector<int> vec;
		for (int j = 0; j < N; j++) {
			if (used[j][i] >= 1) vec.push_back(used[j][i]);
		}
		sort(vec.begin(), vec.end());
		vec.erase(unique(vec.begin(), vec.end()), vec.end());
		res.push_back(vec.size());
	}
	sort(res.begin(), res.end());
	res.erase(unique(res.begin(), res.end()), res.end());
	
	if (res.size() == 1) return true;
	return false;
}

bool solve(int N) {
	if (N == 2) {
		cout << "-1" << endl;
		return true;
	}
	if (N == 4) {
		cout << "aabd" << endl;
		cout << "ccbd" << endl;
		cout << "efgg" << endl;
		cout << "efhh" << endl;
		return true;
	}
	if (N == 5) {
		cout << "a.ccd" << endl;
		cout << "abb.d" << endl;
		cout << "eeffg" << endl;
		cout << "hi..g" << endl;
		cout << "hi.jj" << endl;
		return true;
	}
	if (N % 3 == 0) {
		int cnts = 0;
		for (int i = 0; i < N / 3; i++) {
			cnts++;
			used[i * 3 + 0][i * 3 + 0] = cnts;
			used[i * 3 + 1][i * 3 + 0] = cnts;
			cnts++;
			used[i * 3 + 2][i * 3 + 1] = cnts;
			used[i * 3 + 2][i * 3 + 2] = cnts;
		}
		return Output(N, cnts);
	}
	else {
		int c1 = N, c2 = N;
		for (int i = N - 1; i >= 0; i--) {
			if ((N - i) % 2 == 1) {
				if (c1 >= 3) { c1 -= 3; A[i] = 3; }
				else { A[i] = c1; c1 = 0; }
			}
			else {
				if (c2 >= 3) { c2 -= 3; A[i] = 3; }
				else { A[i] = c2; c2 = 0; }
			}
		}
		S[0] = A[0];
		for (int i = 1; i < N; i++) {
			S[i] = (A[i] - S[i - 1]);
		}
		for (int i = 0; i < N; i++) B[i] = 3;

		// 縦方向
		int cnts = 0;
		for (int i = 0; i < N; i++) {
			int rev = (3 - A[i]); if (rev == 0) continue;
			for (int j = 0; j < N - 1; j++) {
				if (B[j] == 0 || B[j + 1] == 0) continue;
				if (used[i][j] >= 1 || used[i][j + 1] >= 1) continue;
				cnts++;
				used[i][j + 0] = cnts; B[j + 0]--;
				used[i][j + 1] = cnts; B[j + 1]--;
				rev--; if (rev == 0) break;
			}
		}

		// 横方向
		for (int i = N - 1; i >= 0; i--) {
			int rev = B[i]; if (rev == 0) continue;
			for (int j = 0; j < N - 1; j++) {
				if (S[j] == 0) continue;
				if (j + 4 == N && S[j] == 1 && S[j + 2] == 2) continue;
				if (used[j][i] >= 1 || used[j + 1][i] >= 1) continue;
				cnts++;
				used[j + 0][i] = cnts;
				used[j + 1][i] = cnts;
				S[j]--;
				rev--; if (rev == 0) break;
			}
		}

		return Output(N, cnts);
	}
}

int main() {
	int N; cin >> N;
	bool I = solve(N);
	return 0;
}

Measured memory_bytes: 8324