#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define ln '\n'
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
typedef long long ll;
typedef unsigned long long ull; 
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const vector<string> S3 = {"a..",
                     "a..",
                     ".aa"};
const vector<string> S4 = {"aacd",
                     "bbcd",
                     "cdaa",
                     "cdbb"};
const vector<string> S5 = {"cchjj",
                     "..hib",
                     "g..ib",
                     "gaa.f",
                     "eeddf"};
const vector<string> S6 = {"iieb..",
                     "..ebhh",
                     "..gglf",
                     "d...lf",
                     "dcc..a",
                     "kk.jja"};
const vector<string> S7 = {"mnn..a.",
                     "m.h..a.",
                     "..hiigg",
                     "kk.ff.e",
                     "cc..j.e",
                     "..bdj..",
                     "..bd.ll"};   
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    if (N==2) {
        cout << -1 << ln;
        return 0;
    }
    if (N==3) {
        rep(i,3) {
            rep(j,3) cout << S3[i][j];
            cout << ln;
        }
        return 0;
    }
    vector<vector<char>> ans(N, vector<char>(N,'.'));
    for (int i = 0; i*4 <= N; i++) {
        for (int j = 0; j*5 <= N-i*4; j++) {
            for (int k = 0; k*6 <= N-i*4-j*5; k++) {
                if ((N-i*4-j*5-k*6)%7==0) {
                    int l = (N-i*4-j*5-k*6)/7;
                    int cur = 0;
                    rep(_,i) {
                        rep(y,4) {
                            rep(x,4) {
                                ans[cur+y][cur+x] = S4[y][x];
                            }
                        }
                        cur += 4;
                    }
                    rep(_,j) {
                        rep(y,5) {
                            rep(x,5) {
                                ans[cur+y][cur+x] = S5[y][x];
                            }
                        }
                        cur += 5;
                    }
                    rep(_,k) {
                        rep(y,6) {
                            rep(x,6) {
                                ans[cur+y][cur+x] = S6[y][x];
                            }
                        }
                        cur += 6;
                    }
                    rep(_,l) {
                        rep(y,7) {
                            rep(x,7) {
                                ans[cur+y][cur+x] = S7[y][x];
                            }
                        }
                        cur += 7;
                    }

                    rep(p,N) {
                        rep(q,N) cout << ans[p][q];
                        cout << ln;
                    }
                    return 0;
                }

            }
        }
    }
}


Measured memory_bytes: 2304