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

#ifdef LOCAL
#include "debug_utils.h"
#else
#define print(...) ;
#define printn(...) ;
#endif

#define rep(i, a, b) for(auto i = (a); i < (b); i++)
#define rrep(i, a, b) for(auto i = (a); i > (b); i--)
#define all(v) (v).begin(), (v).end()
#define pb push_back

typedef unsigned long long ull;
typedef long long ll;
 
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdd;
typedef vector<long long> vll;

const int MAXN = 1e3 + 10;

char s[MAXN][MAXN];
int n;

void gen31(int x, int y, int base = 0) {
	s[x][y] = s[x][y + 1] = 'a' + base;
	s[x + 1][y + 2] = s[x + 2][y + 2] = 'b' + base;
}
void gen32(int x, int y, int base = 0) {
	s[x][y] = s[x][y + 1] = 'a' + base;
	s[x][y + 2] = s[x + 1][y + 2] = 'b' + base;
	s[x + 2][y + 1] = s[x + 2][y + 2] = 'c' + base;
	s[x + 1][y] = s[x + 2][y] = 'd' + base;
}
void gen4(int x, int y, int base = 0) {
	char cur = 'a' + base;
	s[x][y] = s[x][y + 1] = cur++;
	s[x + 1][y] = s[x + 1][y + 1] = cur++;

	s[x + 2][y + 2] = s[x + 2][y + 3] = cur++;
	s[x + 3][y + 2] = s[x + 3][y + 3] = cur++;

	s[x + 2][y] = s[x + 3][y] = cur++;
	s[x + 2][y + 1] = s[x + 3][y + 1] = cur++;

	s[x][y + 2] = s[x + 1][y + 2] = cur++;
	s[x][y + 3] = s[x + 1][y + 3] = cur++;
}

void gen_m3(int x, int y, int len) {
	if(len == 0)return;
	// if(len == 3) gen31(x, y);
	if(len == 6) {
		gen31(x, y, 0);
		gen31(x + 3, y + 3, 4);
		gen32(x, y + 3, 8);
		gen32(x + 3, y, 12);
	}
	else if(len == 9) {
		gen32(x, y, 0);
		gen31(x, y + 3, 4);
		gen31(x + 3, y, 8);

		gen31(x + 6, x + 6, 0);
		gen32(x + 3, y + 6, 4);
		gen32(x + 6, y + 3, 8);
	}
	else {
		gen_m3(x, y, 6);
		gen_m3(x + 6, y + 6, len - 6);
	}
}

void gen_m4(int x, int y, int len) {
	if(len == 0) return;
	gen4(x, y, 0);
	gen_m4(x + 4, y + 4, len - 4);
}


char a[100][100];
int row[100] = {}, col[100] = {};
bool dfs(int x, int y, int len, int tot) {
	if(x == len + 1) {
		rep(i, 1, len + 1) 
			if(row[i] != tot || col[i] != tot) 
				return false;
		return true;
	}
	if(y == len + 1)
		return dfs(x + 1, 1, len, tot);
	if(a[x][y] != '.' || row[x] == tot || col[y] == tot)
		return dfs(x, y + 1, len, tot);
	if(y + 1 <= len && a[x][y + 1] == '.' && col[y + 1] < tot) {
		set<char> cs;
		rep(i, x - 1, x + 2)
			rep(j, y - 1, y + 3) {
				if(i == x && (j == y || j == y + 1))
					continue;
				cs.insert(a[i][j]);
			}
		char c = 'a';
		while(cs.count(c)) c++;
		a[x][y] = a[x][y + 1] = c;
		row[x]++;
		col[y]++;
		col[y + 1]++;
		if(dfs(x, y + 1, len, tot)) return true;
		a[x][y] = a[x][y + 1] = '.';
		row[x]--;
		col[y]--;
		col[y + 1]--;
	}
	if(x + 1 <= len && a[x + 1][y] == '.' && row[x + 1] < tot) {
		set<char> cs;
		rep(i, x - 1, x + 3)
			rep(j, y - 1, y + 2) {
				if(j == y && (i == x || i == x + 1))
					continue;
				cs.insert(a[i][j]);
			}
		char c = 'a';
		while(cs.count(c)) c++;
		a[x][y] = a[x + 1][y] = c;
		row[x]++;
		row[x + 1]++;
		col[y]++;
		if(dfs(x, y + 1, len, tot)) return true;
		a[x][y] = a[x + 1][y] = '.';
		row[x]--;
		row[x + 1]--;
		col[y]--;
	}
	return dfs(x, y + 1, len, tot);
}
bool gen(int len) {
	rep(i, 1, len + 1)
		rep(j, 1, len + 1)
			a[i][j] = '.';
	rep(tot, 1, len * len / 2 * 3 / (2 * len) + 1) {
		if(tot % 3) continue;
		print("trying tot", tot);
		if(dfs(1, 1, len, tot)) {
			return true;
		}
	}
	return false;
}

void gen11() {
	vector<string> tmp = {
		"aabbaa.....",
		"ccddcc.....",
		"aabbaa.....",
		"......bbab.",
		"......ccab.",
		"......ab..a",
		"......ab..a",
		"........abc",
		"........abc",
		"........cda",
		"........cda"
	};
	for(auto x : tmp) cout << x << endl;
}

int main(int argc, char * argv[]) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    // if(argc > 1 && !strcmp(argv[1], debug.debug)) debug.on = true;

    cin >> n;
    rep(i, 0, n)
    	rep(j, 0, n)
    		s[i][j] = '.';

    if(n == 2) {
    	cout << -1 << endl;
    	return 0;
    }
    else if(n == 11) {
    	gen11();
    	return 0;
    }
    else if(n == 5 || n == 7) {
    	if(!gen(n)) {
    		cout << -1 << endl;
    		return 0;
    	}
	    rep(i, 0, n) {
	    	rep(j, 0, n) {
	    		s[i][j] = a[i + 1][j + 1];
	    	}
	    }
    }
    else if(n == 3) {
    	gen31(0,0,0);
    }
    else {
    	rep(i, 0, n + 1) {
    		if(i == 1)continue;
    		if(i * 3 > n) break;
    		if((n - 3 * i) % 4 == 0) {
    			gen_m3(0, 0, 3 * i);
    			gen_m4(3 * i, 3 * i, n - 3 * i);
    			break;
    		}
    	}
    }

    rep(i, 0, n) {
    	rep(j, 0, n)
    		cout << s[i][j];
    	cout << endl;
    }


    return 0;
}
















Measured memory_bytes: 2176