#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef priority_queue<P,vector<P>,greater<P>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}
void outi(ll i){cout<<i<<endl;}
void outvi(vi v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
void outvvi(vvi v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<endl;}}

int main(){
    ll n;cin>>n;
    if(n==2){
        cout<<-1<<endl;
        return 0;
    }
    if(n%3==0){
        rep(i,n){
            rep(j,n){
                if(i%3==0&&j%3!=2)cout<<'a';
                else if(i%3!=0&&j%3==2)cout<<'a';
                else cout<<'.';
            }
            cout<<endl;
        }
        return 0;
    }
    if(n%4==0){
        rep(i,n){
            rep(j,n){
                if(i%4==0&&j%4<2)cout<<'a';
                if(i%4==1&&j%4<2)cout<<'b';
                if(j%4==2&&i%4<2)cout<<'c';
                if(j%4==3&&i%4<2)cout<<'d';
                if(j%4==0&&i%4>1)cout<<'e';
                if(j%4==1&&i%4>1)cout<<'f';
                if(i%4==2&&j%4>1)cout<<'g';
                if(i%4==3&&j%4>1)cout<<'h';
            }
            cout<<endl;
        }
        return 0;
    }
    ll x,y;
    if(n%4==1){
        x=n-9;
        y=1;
    }
    else if(n%4==2){
        x=n-18;
        y=2;
    }
    else{
        x=n-27;
        y=3;
    }
    if(x>=0&&y>=0){
        rep(i,n){
        rep(j,n){
            if(i<x&&j<x){
                if(i/4==j/4){
                    if(i%4==0&&j%4<2)cout<<'a';
                    if(i%4==1&&j%4<2)cout<<'b';
                    if(j%4==2&&i%4<2)cout<<'c';
                    if(j%4==3&&i%4<2)cout<<'d';
                    if(j%4==0&&i%4>1)cout<<'e';
                    if(j%4==1&&i%4>1)cout<<'f';
                    if(i%4==2&&j%4>1)cout<<'g';
                    if(i%4==3&&j%4>1)cout<<'h';
                }
                else cout<<'.';
            }
            else if(i>=x&&j>=x){
                if((i-x)/9==(j-x)/9){
                    if((i-x)%3==0&&(j-x)%3!=2)cout<<'k';
                    else if((i-x)%3!=0&&(j-x)%3==2)cout<<'k';
                    else cout<<'.';
                }
                else cout<<'.';
            }
            else cout<<'.';
        }
        cout<<endl;
        }
        return 0;
    }
    if(n%2==0){
    if((n-4)%6==0){
        x=4;y=n-4;
    }
    else {
        x=8;y=n-8;
    }
    rep(i,n){
        rep(j,n){
            if(i<x&&j<x){
                if(i/4==j/4){
                    if(i%4==0&&j%4<2)cout<<'a';
                    if(i%4==1&&j%4<2)cout<<'b';
                    if(j%4==2&&i%4<2)cout<<'c';
                    if(j%4==3&&i%4<2)cout<<'d';
                    if(j%4==0&&i%4>1)cout<<'e';
                    if(j%4==1&&i%4>1)cout<<'f';
                    if(i%4==2&&j%4>1)cout<<'g';
                    if(i%4==3&&j%4>1)cout<<'h';
                }
                else cout<<'.';
            }
            else if(i>=x&&j>=x){
                if((i-x)/6==(j-x)/6){
                    if((i-x)%3==0){
                        if((j-x)%6==2||(j-x)%6==3)cout<<'b';
                        else cout<<'a';
                    }
                    else if((j-x)%2){
                        if((i-x)%6<3)cout<<'c';
                        else cout<<'.';
                    }
                    else{
                        if((i-x)%6>2)cout<<'c';
                        else cout<<'.';
                    }
                }
                else cout<<'.';
            }
            else cout<<'.';
        }
        cout<<endl;
    }
    return 0;
    }
    if(n==5){
        cout<<"aab.c"<<endl;
        cout<<"d.b.c"<<endl;
        cout<<"deeff"<<endl;
        cout<<"ghii."<<endl;
        cout<<"gh.jj"<<endl;
    }
    if(n==11){
        cout<<"aab.c";
        cout<<"......"<<endl;
        cout<<"d.b.c";
        cout<<"......"<<endl;
        cout<<"deeff";
        cout<<"......"<<endl;
        cout<<"ghii.";
        cout<<"......"<<endl;
        cout<<"gh.jj";
        cout<<"......"<<endl;
        rep(i,6){
            cout<<".....";
            rep(j,6){
                if(i%3==0){
                    if(j%6==2||j%6==3)cout<<'b';
                    else cout<<'a';
                }
                else if(j%2){
                    if(i%6<3)cout<<'c';
                    else cout<<'.';
                }
                else{
                    if(i%6>2)cout<<'c';
                    else cout<<'.';
                }
            }
            cout<<endl;
        }
    }
    if(n==19){
        cout<<"aab.c.............."<<endl;
        cout<<"d.b.c.............."<<endl;
        cout<<"deeff.............."<<endl;
        cout<<"ghii..............."<<endl;
        cout<<"gh.jj.............."<<endl;
        cout<<".....aab.c........."<<endl;
        cout<<".....d.b.c........."<<endl;
        cout<<".....deeff........."<<endl;
        cout<<".....ghii.........."<<endl;
        cout<<".....gh.jj........."<<endl;
        rep(i,9){
            cout<<"..........";
            rep(j,9){
                if(i/9==j/9){
                    if(i%3==0&&j%3!=2)cout<<'k';
                    else if(i%3!=0&&j%3==2)cout<<'k';
                    else cout<<'.';
                }
                else cout<<'.';
            }
            cout<<endl;
        }
    }
    if(n==23){
        cout<<"aab.c.................."<<endl;
        cout<<"d.b.c.................."<<endl;
        cout<<"deeff.................."<<endl;
        cout<<"ghii..................."<<endl;
        cout<<"gh.jj.................."<<endl;
        cout<<".....aab.c............."<<endl;
        cout<<".....d.b.c............."<<endl;
        cout<<".....deeff............."<<endl;
        cout<<".....ghii.............."<<endl;
        cout<<".....gh.jj............."<<endl;
        cout<<"..........aab.c........"<<endl;
        cout<<"..........d.b.c........"<<endl;
        cout<<"..........deeff........"<<endl;
        cout<<"..........ghii........."<<endl;
        cout<<"..........gh.jj........"<<endl;
        rep(i,8){
            cout<<"...............";
            rep(j,8){
                if(i/4==j/4){
                if(i%4==0&&j%4<2)cout<<'a';
                if(i%4==1&&j%4<2)cout<<'b';
                if(j%4==2&&i%4<2)cout<<'c';
                if(j%4==3&&i%4<2)cout<<'d';
                if(j%4==0&&i%4>1)cout<<'e';
                if(j%4==1&&i%4>1)cout<<'f';
                if(i%4==2&&j%4>1)cout<<'g';
                if(i%4==3&&j%4>1)cout<<'h';
                }
                else cout<<'.';
            }
            cout<<endl;
        }
    }
    if(n==7){
        cout<<"aa.bb.c"<<endl;
        cout<<"d.ee..c"<<endl;
        cout<<"d.h..ff"<<endl;
        cout<<"ggh..i."<<endl;
        cout<<".k.jji."<<endl;
        cout<<".kl.m.."<<endl;
        cout<<"..l.mhh"<<endl;
    }
}

Measured memory_bytes: 1280