#include <bits/stdc++.h>

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

const int dx[] = { 1,0 };
const int dy[] = { 0,1 };
const int maxn = 1e3+3;
const int magic = 3;
int dp[maxn];
char A[maxn][maxn]; set<int> seen; const VI xs = { 4,5,6,7 };

const string *g0,*g1,*g2;
const string g3[] = {
    "aab",
    "d.b",
    "dcc",
};
const string g4[] = {
    "abcc",
    "abdd",
    "eefg",
    "hhfg",
};
const string g5[] = {
    "abc..",
    "abc..",
    "deeff",
    "d.ghh",
    "iigjj",
};
const string g6[] = {
    "abc...",
    "abc...",
    "d.eeff",
    "dghh..",
    ".g.ijj",
    "kk.ill",
};
const string g7[] = {
    "abc....",
    "abc....",
    "def....",
    "def....",
    "g..hhii",
    "g..jjkk",
    ".llmmnn",
};
const string* G[] = { g0,g1,g2,g3,g4,g5,g6,g7 };

const int ij2v(const int i, const int j, const int n)
{ return i*n+j; }
const void v2ij(const int v, int& i, int& j, const int n)
{ i = v/n; j = v%n; }

void print(const int n)
{
    FOR(i,0,n) {
        FOR(j,0,n)
            cout << A[i][j];
        cout << endl;
    }
}

void dfs(const int v, char c, const int n)
{
    if (in_(n,seen))
        return;
    int i,j; v2ij(v,i,j,n);
    if (v >= n) {
        set<char> cnt; const int ii = i-1;
        FOR(jj,0,n) if (A[ii][jj] != '.')
            cnt.insert(A[ii][jj]);
        if (cnt.size() != magic)
            return;
    }
    if (v == n*n) {
        set<int> row, col;
        FOR(ii,0,n) {
            set<char> cnt;
            FOR(jj,0,n) if (A[ii][jj] != '.')
                cnt.insert(A[ii][jj]);
            row.insert(cnt.size());
        }
        FOR(jj,0,n) {
            set<char> cnt;
            FOR(ii,0,n) if (A[ii][jj] != '.')
                cnt.insert(A[ii][jj]);
            col.insert(cnt.size());
        }
        if (row.size() == 1 && col.size() == 1) {
            if (*row.begin() == magic && *col.begin() == magic) {
                if (!in_(n,seen)) {
                    cout << "good: " << n << endl;
                    print(n);
                    seen.insert(n);
                }
            }
        }
        return;
    }
    if (A[i][j] == '.') {
        FOR(d,0,2) {
            const int x = i+dx[d];
            const int y = j+dy[d];
            if (0 <= x && x < n && 0 <= y && y < n && A[x][y] == '.') {
                A[i][j] = A[x][y] = c;
                dfs(v+1,c+1,n);
                A[i][j] = A[x][y] = '.';
            }
        }
    }
    dfs(v+1,c,n);
}

int dfs(const int n)
{
    if (n < 4)
        return false;
    if (n == 4 || n == 5 || n == 6 || n == 7) {
        FOR(i,0,n) FOR(j,0,n)
            A[i][j] = G[n][i][j];
        return true;
    }
    int& ans = dp[n];
    if (-1 == ans) {
        ans = false;
        FOR_ALL(x,xs) {
            if (ans |= dfs(n-*x)) {
                for (int i = n-*x, ii = 0; i < n; i++, ii++) {
                    for (int j = n-*x, jj = 0; j < n; j++, jj++) {
                        A[i][j] = G[*x][ii][jj];
                    }
                }
                break;
            }
        }
    }
    return ans;
}

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    /* FOR(n,4,8) { */
    /*     FOR(i,0,n) FOR(j,0,n) { */
    /*         A[i][j] = '.'; */
    /*     } */
    /*     dfs(0,'a',n); */
    /* } */
    /* return 0; */
    int n;
    while (cin >> n) {
        FOR(i,0,n) FOR(j,0,n)
            A[i][j] = '.';
        switch (n) {
            case 2:
                cout << -1 << endl;
                break;
            case 3:
                FOR(i,0,n)
                    cout << g3[i] << endl;
                break;
            default:
                memset(dp,-1,sizeof(dp));
                dfs(n);
                print(n);
                break;
        }
    }
    return 0;
}


Measured memory_bytes: 2176