#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

char mp[1111][1111];
char san[3][3] = {
{'a','.','.'},
{'a','.','.'},
{'.','b','b'}};

char san2[3][3] = {
{'z','w','w'},
{'z','.','x'},
{'y','y','x'}};

char four[4][4] = {
{'a','a','c','d'},
{'b','b','c','d'},
{'c','d','a','a'},
{'c','d','b','b'}};

char five[5][5] = {
{'a','h','h','g','g'},
{'a','i','.','.','f'},
{'b','i','.','.','f'},
{'b','.','j','j','e'},
{'c','c','d','d','e'}};
char seven[7][7] = {
{'a','b','c','.','.','.','.'},
{'a','b','c','.','.','.','.'},
{'.','.','.','d','e','f','f'},
{'.','.','.','d','e','g','g'},
{'k','k','l','.','.','c','c'},
{'m','.','l','a','a','.','.'},
{'m','n','n','b','b','.','.'}};

void yon(int a, int b){
	REP(i, 4){
		REP(j, 4){
			mp[i+a][j+b] = four[i][j];
		}
	}
}

void roku(int a, int b){
	REP(i, 6){
		REP(j, 6){
			if(((i / 3) + (j / 3)) % 2)mp[i+a][j+b] = san[i%3][j%3];
			else mp[i+a][j+b] = san2[i%3][j%3];
		}
	}
}

void kyuu(int a, int b){
	REP(i, 9){
		REP(j, 9){
			mp[i+a][j+b] = san[i%3][j%3];
		}
	}
}

void go(int a, int b){
	REP(i, 5){
		REP(j, 5){
			mp[i+a][j+b] = five[i][j];
		}
	}
}

void seica(int n, int cou){
	for(int i = 0;;i++){
		int j = (n - cou) - i * 6;
		if(j < 0)continue;
		if(j % 9 == 0){
			j /= 9;
			REP(ii, i){
				roku(cou, cou);
				cou +=6;
			}
			REP(jj, j){
				kyuu(cou, cou);
				cou +=9;
			}
			return;
		}
	}
}

int main(){
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

	REP(i, 1111)REP(j, 1111)mp[i][j] = '.';

	ll n;cin >> n;
	if(n % 3 == 0){
		REP(i, n){
			REP(j, n){
				cout << san[i%3][j%3];
			}
			cout << endl;
		}
	}
	else if(n % 5 == 0){
		REP(i, n){
			REP(j, n){
				cout << five[i%5][j%5];
			}
			cout << endl;
		}
	}
	else if(n % 7 == 0){
		REP(i, n){
			REP(j, n){
				cout << seven[i%7][j%7];
			}
			cout << endl;
		}
	}
	else if(n % 4 == 0){
		REP(i, n){
			REP(j, n){
				cout << four[i%4][j%4];
			}
			cout << endl;
		}
	}
	else if(n > 5 && n % 3 == 2) {
		int cou = 0;
		go(cou, cou);
		cou += 5;
		seica(n, cou);
		REP(i, n){
			REP(j, n){
				cout << mp[i][j];
			}
			cout << endl;
		}
	}
	else if(n > 8 && n % 3 == 1){
		int cou = 0;
		yon(cou, cou);
		cou += 4;
		seica(n, cou);
		REP(i, n){
			REP(j, n){
				cout << mp[i][j];
			}
			cout << endl;
		}
	}
	else {
		cout << -1 << endl;
	}

	return 0;
}

#include"bits/stdc++.h"
#include<cassert>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const int mod = 1000000007;
const int inf = 1ll << 61;
typedef pair<int, int> P;
typedef pair<P, int>PP;
int n;
int board[1005][1005];
void paint4(int ni, int nj) {
	board[ni][nj] = 1;
	board[ni][nj + 1] = 1;
	board[ni][nj + 2] = 3;
	board[ni][nj + 3] = 4;
	board[ni + 1][nj] = 2;
	board[ni + 1][nj + 1] = 2;
	board[ni + 1][nj + 2] = 3;
	board[ni + 1][nj + 3] = 4;
	board[ni + 2][nj] = 5;
	board[ni + 2][nj + 1] = 6;
	board[ni + 2][nj + 2] = 7;
	board[ni + 2][nj + 3] = 7;
	board[ni + 3][nj] = 5;
	board[ni + 3][nj + 1] = 6;
	board[ni + 3][nj + 2] = 8;
	board[ni + 3][nj + 3] = 8;
}
void paint(int ni, int nj, int N) {
	board[ni][nj] = 1;
	board[ni][nj + 1] = 1;
	board[ni][nj + 2] = 2;
	board[ni + 1][nj] = 3;
	board[ni + 1][nj + 2] = 2;
	board[ni + 2][nj] = 3;
	board[ni + 2][nj + 1] = 4;
	board[ni + 2][nj + 2] = 4;
	for (int i = ni; i<ni + 3; i++) {
		for (int j = nj + 3; j < nj + N; j += 2) {
			if (((j - 3) / 2) & 1) {
				board[i][j] = 5 + i % 2;
				board[i][j + 1] = 5 + i % 2;
			}
			else {
				board[i][j] = 6 + i % 2;
				board[i][j + 1] = 6 + i % 2;
			}
		}
	}
	for (int i = ni + 3; i < ni + N; i += 2) {
		for (int j = nj; j<nj + 3; j++) {
			if (((i - 3) / 2) & 1) {
				board[i][j] = 7 + j % 2;
				board[i + 1][j] = 7 + j % 2;
			}
			else {
				board[i][j] = 8 + j % 2;
				board[i + 1][j] = 8 + j % 2;
			}
		}
	}
}
bool hante() {
	set<int>S1;
	rep(i, n)if (board[i][0])S1.insert(board[i][0]);
	if (S1.size() != 4)return false;
	rep(i, n) {
		set<int>S;
		rep(j, n)if (board[i][j])S.insert(board[i][j]);
		if (S1.size() != S.size())return false;
	}
	rep(i, n) {
		set<int>S;
		rep(j, n)if (board[j][i])S.insert(board[j][i]);
		if (S1.size() != S.size())return false;
	}
	return true;

}
void disp() {
	rep(i, n) {
		rep(j, n) {
			if (board[i][j] == 0)cout << '.';
			else cout << (char)('a' + board[i][j]);
		}
		cout << endl;
	}
	cout << endl;
}
void search(int ni, int nj, int num) {
	if (ni == n) {
		if (hante())disp();
		return;
	}
	int mi = ni, mj = nj + 1;
	if (mj == n) {
		mj = 0; mi++;
	}
	if (board[ni][nj] == 0) {
		if (nj != n - 1 && board[ni][nj + 1] == 0) {
			board[ni][nj] = num;
			board[ni][nj + 1] = num;
			search(mi, mj, num + 1);
			board[ni][nj] = 0;
			board[ni][nj + 1] = 0;
		}
		if (ni != n - 1 && board[ni + 1][nj] == 0) {
			board[ni][nj] = num;
			board[ni + 1][nj] = num;
			search(mi, mj, num + 1);
			board[ni][nj] = 0;
			board[ni + 1][nj] = 0;
		}
	}
	search(mi, mj, num);
}
signed main() {
	cin >> n;

	//	search(0,0,1);

	if (n == 2)cout << -1 << endl;
	else if (n == 7) {
		string s[7] = {
			"..bcd..",
			"..bcd..",
			"hhqq.oo",
			"ii..wnn",
			"jj..wpp",
			"..akl..",
			"..akl.."
		};
		rep(i, 7)cout << s[i] << endl;
	}
	else if (n == 11) {
		string s[11] = {
			"..bcd......",
			"..bcd......",
			"hhqq.oo....",
			"ii..wnn....",
			"jj..wpp....",
			"..akl......",
			"..akl......",
			".......aabc",
			".......ddbc",
			".......abff",
			".......abgg"
		};
		rep(i, 11)cout << s[i] << endl;
	}
	else if (n % 3 == 0) {
		for (int i = 0; i<n; i += 3)paint(i, i, 3);
		disp();
	}
	else {
		rep(i, n + 1) {
			rep(j, n + 1) {
				if (5 * i + 4 * j == n) {
					for (int m = 0; m < 5 * i; m += 5)paint(m, m, 5);
					for (int m = 5 * i; m < n; m += 4)paint4(m, m);
					goto X;
				}
			}
		}
	X:;
		disp();
	}
}
