#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}
/*
aaeeb
h...b
h...f
d...f
dggcc
*/

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

int N;
char S[1011][1011];

bool in(int y, int x) {
    return 0 <= y && y < N && 0 <= x && x < N;
}

int C(int r, int c) {
    int mask = 0;
    REP (d, 4) {
	int y = r + dy[d];
	int x = c + dx[d];
	if (in(y, x) && S[y][x] != '.') mask |= 1<<(S[y][x] - 'a');
    }
    return mask;
}
void H(int r, int c) {
    assert(S[r][c] == '.');
    assert(S[r][c+1] == '.');

    int mask = C(r, c) | C(r, c+1);
    REP (t, 26) if (~mask>>t&1) {
	S[r][c] = S[r][c+1] = t + 'a';
	break;
    }
    assert(S[r][c] != '.');
}
void V(int r, int c) {
    assert(S[r][c] == '.');
    assert(S[r+1][c] == '.');

    int mask = C(r, c) | C(r+1, c);
    REP (t, 26) if (~mask>>t&1) {
	S[r][c] = S[r+1][c] = t + 'a';
	break;
    }
    assert(S[r][c] != '.');
}


bool A[1011][1011];
void rec(int r, int c, int n, int k=0) {
    assert(n >= 3);
    assert(k >= 1);

    if (n == 3) {
	if (k == 1) {
	    H(r, c+1);
	    V(r+1, c);
	} else if (k == 2) {
	    H(r, c);
	    V(r, c+2);
	    V(r+1, c);
	    H(r+2, c+1);
	}
	return;
    } else if (n == 4) {
	H(r, c);
	H(r+1, c);
	V(r, c+2);
	V(r, c+3);
	V(r+2, c);
	V(r+2, c+1);
	H(r+2, c+2);
	H(r+3, c+2);
	return;
    }

    for (int b=3; b<n; b++) if (n % b == 0 && A[b][k]) {
	for (int s=0; s<n; s+=b) {
	    rec(r+s, c+s, b, k);
	}
	return;
    }
    for (int b=3; b<n; b++) if (n % b == 0 && k % (n/b) == 0 && A[b][k/(n/b)]) {
	for (int y=0; y<n; y+=b) {
	    for (int x=0; x<n; x+=b) {
		rec(r+y, c+x, b, k/(n/b));
	    }
	}
	return;
    }

    if (n % 2 == 0 && k==n/2-1 && A[n-2][k-2]) {
	for (int s=2; s<n; s+=2) {
	    H(r, c+s);
	    H(r+1, c+s);
	    V(r+s, c);
	    V(r+s, c+1);
	}
	rec(r+2, c+2, n-2, k-2);
	return;
    }

    if (n % 2 == 1 && k == n/2 && A[n-1][k-1]) {
	for (int s=1; s<n; s+=2) {
	    H(r, c+s);
	    V(r+s, c);
	}
	rec(r+1, c+1, n-1, k-1);
	return;
    }

    if (n % 2 == 1 && k == n/2+1 && A[n-2][k-2]) {
	for (int i=0; i+2<=n; i+=2) {
	    H(r, c+i);
	    V(r+i, c+n-1);
	    H(r+n-1, c+1+i);
	    V(r+1+i, c);
	}
	rec(r+1, c+1, n-2, k-2);
	return;
    }

    for (int b=3; b*2<=n; b++) if (n % b == 0) {
	int a = n/b;
	for (int bj=1; bj<=k; bj++) if (A[b][bj] && A[n-b][k-bj] && k >= bj*(a-1) && A[b][k-bj*(a-1)]) {
	    rec(r, c, b, k-bj*(a-1));
	    rec(r+b, c+b, n-b, k-bj);
	    for (int s=b; s<n; s+=b) {
		rec(r, c+s, b, bj);
		rec(r+s, c, b, bj);
	    }
	    return;
	}

	if (a >= 2) {
	    for (int bj=1; bj*2<=k; bj++) 
		if (A[b][bj]
			&& A[n-b-b][k-bj-bj]
			&& k >= bj*(a-2)
			&& (k-bj*(a-2)) % 2 == 0
			&& A[b][(k-bj*(a-2))/2]) {
		    int tmp = (k-bj*(a-2))/2;
		    rec(r, c, b, tmp);
		    rec(r, c+n-b, b, tmp);
		    rec(r+n-b, c, b, tmp);
		    rec(r+n-b, c+n-b, b, tmp);

		    for (int s=b; s+b<n; s+=b) {
			rec(r, c+s, b, bj);
			rec(r+s, c, b, bj);
			rec(r+n-b, c+s, b, bj);
			rec(r+s, c+n-b, b, bj);
		    }

		    rec(r+b, c+b, n-b-b, k-bj-bj);
		    return;
		}
	}
    }

    assert(false);
}

void MAIN() {
    N = 1001;
    A[3][1] = true;
    A[3][2] = true;
    A[4][3] = true;

    for (int i=4; i<=N; i++) {
	for (int k=3; k<i; k++) if (i/k==0) {
	    REP (j, 1011) if (A[k][j]) {
		A[i][j] = true;
		A[i][i/k*j] = true;
	    }
	}
	if (i % 2 == 0) {
	    REP (j, 1011) if (A[i/2][j]) A[i][j*2] = true;

	    int r = i/2-1;
	    if (r >= 2 && A[i-2][r-2]) A[i][r] = true;
	}
	if (i % 2 == 1) {
	    if (A[i-1][i/2-1]) A[i][i/2] = true;
	    if (A[i-2][i/2-1]) A[i][i/2+1] = true;
	}
	for (int b=3; b*2<=i; b++) if (i % b == 0) {
	    for (int bj=1; bj<1011; bj++) if (A[b][bj]) {
		for (int j=1; j<1011; j++) if (A[i-b][j]) {
		    int r = j + bj - (i/b-1)*bj;
		    if (0 <= r && r < 1011 && A[b][r]) {
			A[i][j+bj] = true;
		    }
		}
		for (int j=1; j<1011; j++) if (A[i-b-b][j]) {
		    int r = j + bj + bj - (i/b-2)*bj;
		    if (0 <= r && r % 2 == 0 && A[b][r/2]) {
			A[i][j+bj+bj] = true;
		    }
		}
	    }
	}
    }
    ///int cnt = 0;
    ///REP (i, N) {
    ///    int a = 0;
    ///    REP (j, N) if (A[i][j]) {
    ///        a++;
    ///    }
    ///    if (a == 0) printf("%d %d\n", i, a);
    ///    if (a == 0) cnt++;
    ///}
    ///printf("%d\n", cnt);

    scanf("%d", &N);
    if (N <= 2) {
	puts("-1");
    } else {
	REP (i, N) REP (j, N) S[i][j] = '.';
	REP (i, 1011) if (A[N][i]) {
	    rec(0, 0, N, i);
	    //eprintf("%d\n", i);
	    break;
	}
	REP (i, N) puts(S[i]);
    }
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 3200