//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef vector<string> vst;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vst mp3 = {"aaX","XXa","XXa"};
    vst mp4 = {"aacd","bbcd","cdaa","cdbb"};
    vst mp5 = {"Xaabc","bbXbc","ccaad","aXbXd","aXbaa"};
    vst mp6 = {"aabaaX","cXbXXb","cddXXb","aaXaac","XXcbXc","XXcbdd"};
    vst mp7 = {"aaccXXa","bbddXXa","XXXXabc","XXXXabc","XXXXcdb","XXXXcdb","aabbaaX"};
    vector<vector<char> > ans(n,vector<char>(n,'.'));
    vector<vector<char> > mp9(9,vector<char>(9,'.'));
    REP(i,3){
        REP(j,3){
            REP(k,3){
                REP(l,3){
                    mp9[i*3+k][j*3+l] = mp3[k][l];
                }
            }
        }
    }
    if(n<=2){
        cout << -1 << endl;
        return 0;
    }else if(n==3){
        REP(i,n){
            REP(j,n){
                if(mp3[i][j]=='X'){
                    cout << '.';
                }else{
                    cout << mp3[i][j];
                }
            }
            cout << endl;
        }
        return 0;
    }else if(n==7){
        REP(i,n){
            REP(j,n){
                if(mp7[i][j]=='X'){
                    cout << '.';
                }else{
                    cout << mp7[i][j];
                }
            }
            cout << endl;
        }
        return 0;
    }else if(n==8){
        int x = 0;
        REP(k,2){
            REP(i,4){
                REP(j,4){
                    if(mp4[i][j]!='X'){
                        ans[i+x][j+x] = mp4[i][j];
                    }
                }
            }
            x+=4;
        }
    }else{
        int m6 = n%6;
        if(m6==0||m6>=4){
            int x = 0;
            while(x+6<=n){
                REP(i,6){
                    REP(j,6){
                        if(mp6[i][j]!='X'){
                            ans[i+x][j+x] = mp6[i][j];
                        }
                    }
                }
                x+=6;
            }
            if(m6==4){
                REP(i,4){
                    REP(j,4){
                        if(mp4[i][j]!='X'){
                            ans[i+x][j+x] = mp4[i][j];
                        }
                    }
                }
            }else if(m6==5){
                REP(i,5){
                    REP(j,5){
                        if(mp5[i][j]!='X'){
                            ans[i+x][j+x] = mp5[i][j];
                        }
                    }
                }
            }
        }else{
            int x = 0;
            if(m6==1){
                REP(i,4){
                    REP(j,4){
                        if(mp4[i][j]!='X'){
                            ans[i+x][j+x] = mp4[i][j];
                        }
                    }
                }
                x+=4;
            }else if(m6==2){
                REP(i,5){
                    REP(j,5){
                        if(mp5[i][j]!='X'){
                            ans[i+x][j+x] = mp5[i][j];
                        }
                    }
                }
                x+=5;
            }
            REP(i,9){
                REP(j,9){
                    if(mp9[i][j]!='X'){
                        ans[i+x][j+x] = mp9[i][j];
                    }
                }
            }
            x+=9;
            while(x<n){
                 REP(i,6){
                    REP(j,6){
                        if(mp6[i][j]!='X'){
                            ans[i+x][j+x] = mp6[i][j];
                        }
                    }
                }
                x+=6;
            }
        }
    
    }
    REP(i,n){
        REP(j,n){
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 2304