#include <bits/stdc++.h>
using namespace std;
char a[6][6]={"aacd","bbcd","cdaa","cdbb"};
char b[8][8]={"aabba","bcc.a","b..cb","a..cb","abbaa"};
char c[8][8]={"bbacc.","a.a..c","abb..c","cc.bba","..ca.a","..cabb"};
char d[9][9]={"eeffee.","aa.aa.e","..a..ae","..a..af","aa.aa.f","..a..ae","..a..ae"};
char ans[1002][1002];
void f(int n,int k){
    if(n==1)return;
    int i,j;
    char q='a';
    char w='b';
    if(k%2)q='c',w='d';
    char c=q;
    for(i=1 ; i<n ; i+=2){
        a[k][i-1+k]=a[k][i+k]=c;
        if(c==q)c=w;
        else c=q;
    }
    for(i=1 ; i<n ; i+=2){
        a[i+k][n-1+k]=a[i-1+k][n-1+k]=c;
        if(c==q)c=w;
        else c=q;
    }
    for(i=n-1 ; i>=1 ; i-=2){
        a[n-1+k][i+k]=a[n-1+k][i+k-1]=c;
        if(c==q)c=w;
        else c=q;
    }
    for(i=n-1 ; i>=1 ; i-=2){
        a[i+k][k]=a[i-1+k][k]=c;
        if(c==q)c=w;
        else c=q;
    }
    f(n-2,k+1);
}
void check(int n){
    int i,j;
    int s=0;
    for(i=0 ; i<n ; i++){
        if(a[0][i]!='.' && a[0][i]!=a[0][i+1])s++;
    }
    for(i=0 ; i<n ; i++){
        int cnt=0;
        for(j=0 ; j<n ; j++){
            if(a[i][j]!='.' && a[i][j]!=a[i][j+1])cnt++;
        }
        if(cnt!=s)cout<<"!";
    }
    for(i=0 ; i<n ; i++){
        int cnt=0;
        for(j=0 ; j<n ; j++){
            if(a[j][i]!='.' && a[j+1][i]!=a[j][i])cnt++;
        }
        if(cnt!=s)cout<<"!";
    }
}
int main(){
    cin.tie(0);
    int n;
    ios_base::sync_with_stdio(0);
    cin>>n;
    int i,j;
    int k=0;
    int m=n;
    if(n==2 ){
        cout<<-1;
        return 0;
    }
    if(n==7){
        for(i=0 ; i<7 ; i++)cout<<d[i]<<endl;
        return 0;
    }
    if(n==3){
        cout<<"aa."<<endl<<"..a"<<endl<<"..a";
        return 0;
    }
    while(n){
        if(n==11){
            n-=5;
            for(i=0 ; i<5 ; i++){
                for(j=0 ; j<5 ; j++){
                    ans[n+i][n+j]=b[i][j];
                }
            }
            n-=6;
            for(i=0 ; i<6 ; i++){
                for(j=0 ; j<6 ; j++)
                    ans[i][j]=c[i][j];
            }
            break;
        }
        if(n==5){
            n-=5;
            for(i=0 ; i<5 ; i++){
                for(j=0 ; j<5 ; j++){
                    ans[i][j]=b[i][j];
                }
            }
            break;
        }
        if(n==6){
            n-=6;
            for(i=0 ; i<6 ; i++){
                for(j=0 ; j<6 ; j++)
                    ans[i][j]=c[i][j];
            }
            break;
        }
        n-=4;
        for(i=0 ; i<4 ; i++){
            for(j=0 ; j<4 ; j++){
                ans[n+i][n+j]=a[i][j];
            }
        }
    }

    for(i=0 ; i<m ; i++){
        for(j=0 ; j<m ; j++){
            if(ans[i][j]==0)cout<<'.';
            else cout<<ans[i][j];
        }
        cout<<"\n";
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

vector<string> three = {
    "add",
    "a.c",
    "bbc",
};

vector<string> four = {
    "afgg",
    "afhh",
    "bbde",
    "ccde",
};

vector<string> five = {
    "ahhii", "ag..j", "bg..j", "b.ffe", "ccdde",
};

vector<string> six = {
    "aa.bbc", "de...c", "deff..", "..gghi", "j...hi", "jkk.ll",
};

vector<string> seven = {
    "a.jj.kk", "ai..ll.", ".i.mm.o", "b.h...o", "b.h..g.", ".ff..ge", "cc.dd.e",
};

int n;

// 4,5,6,7
void solve(int a, int b, int c, int d) {
    vector<string> ans(n, string(n, '.'));
    int id = 0;
    for(int i = 0; i < a; i++) {
        for(int y = id; y < id + 4; y++) {
            for(int x = id; x < id + 4; x++) {
                ans[y][x] = four[y - id][x - id];
            }
        }
        id += 4;
    }
    for(int i = 0; i < b; i++) {
        for(int y = id; y < id + 5; y++) {
            for(int x = id; x < id + 5; x++) {
                ans[y][x] = five[y - id][x - id];
            }
        }
        id += 5;
    }
    for(int i = 0; i < c; i++) {
        for(int y = id; y < id + 6; y++) {
            for(int x = id; x < id + 6; x++) {
                ans[y][x] = six[y - id][x - id];
            }
        }
        id += 6;
    }
    for(int i = 0; i < d; i++) {
        for(int y = id; y < id + 7; y++) {
            for(int x = id; x < id + 7; x++) {
                ans[y][x] = seven[y - id][x - id];
            }
        }
        id += 7;
    }
    for(int i = 0; i < n; i++) {
        cout << ans[i] << endl;
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    if(n <= 2) {
        cout << -1 << endl;
        return 0;
    }
    if(n == 3) {
        for(int i = 0; i < three.size(); i++) {
            cout << three[i] << endl;
        }
        return 0;
    }
    for(int i = 0; i * 7 <= n; i++) {
        for(int j = 0; j * 6 <= n; j++) {
            for(int k = 0; k * 5 <= n; k++) {
                int sum = i * 7 + j * 6 + k * 5;
                if(sum <= n && (n - sum) % 4 == 0) {
                    int l = (n - sum) / 4;
                    solve(l, k, j, i);
                    return 0;
                }
            }
        }
    }
    cout << -1 << endl;
}