#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;


template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


vector<vector<int>> solve(int h, int w, int k){
    vector<int> vh(h, 0), vw(w, 0);

    vector<vector<int>> v(h, vector<int>(w, 0));
    int cnt = 0;
    auto check = [&](int x){
        int cn = vh[0];
        bool fl = (cn == k);
        for(int i = 0; i < h; ++i){
            if(cn != vh[i])
                fl = false;
            if(vh[i] > 4)
                return -1;
            if(i < x && vh[i] < vh[x])
                return -1;
        }
        for(int j = 0; j < w; ++j){
            if(cn != vw[j])
                fl = false;
            if(vw[j] > 4)
                return -1;
        }
        return int(fl);
    };
    function<bool(int,int)> f = [&](int x, int y){
        if(v[x][y] == 0){
            if(x != h - 1 && !v[x][y] && !v[x + 1][y]){
                ++vh[x];
                ++vh[x + 1];
                ++vw[y];
                v[x][y] = ++cnt;
                v[x + 1][y] = cnt;

                int re = check(x);
                if(re == 1)
                    return true;
                else if(re != -1){
                    if(y == w - 1 && x != h - 1 && f(x + 1, 0))return true;
                    if(y != w - 1 && f(x, y + 1))return true;
                }

                --vh[x];
                --vh[x + 1];
                --vw[y];
                v[x][y] = 0;
                v[x + 1][y] = 0;
                --cnt;
            }
            if(y != w - 1 && !v[x][y] && !v[x][y + 1]){
                ++vh[x];
                ++vw[y];
                ++vw[y + 1];
                v[x][y] = ++cnt;
                v[x][y + 1] = cnt;

                int re = check(x);
                if(re == 1)
                    return true;
                else if(re != -1){
                    if(y == w - 1 && x != h - 1 && f(x + 1, 0))return true;
                    if(y != w - 1 && f(x, y + 1))return true;
                }

                --vh[x];
                --vw[y];
                --vw[y + 1];
                v[x][y] = 0;
                v[x][y + 1] = 0;
                --cnt;
            }
        }
        if(y == w - 1 && x != h - 1 && f(x + 1, 0))return true;
        if(y != w - 1 && f(x, y + 1))return true;
        return false;
    };
    if(f(0, 0)){
        return v;
    }
    return v;
}


signed main(){
    int n;

    auto v33 = solve(3, 3, 2);
    auto v44 = solve(4, 4, 3);
    auto v45 = solve(4, 5, 3);
    auto v54 = solve(5, 4, 3);
    auto v55 = solve(5, 5, 3);
    auto v56 = solve(5, 6, 3);
    auto v65 = solve(6, 5, 3);
    auto v66 = solve(6, 6, 3);

    for(int i = 0; i < 4; ++i)
        for(int j = 0; j < 4; ++j)
            if(v44[i][j])
                v44[i][j] += 13;
    for(int i = 0; i < 5; ++i)
        for(int j = 0; j < 5; ++j)
            if(v55[i][j])
                v55[i][j] += 13;
    for(int i = 0; i < 6; ++i)
        for(int j = 0; j < 6; ++j)
            if(v66[i][j])
                v66[i][j] += 10;


    cin >> n;
    auto g = [&](int x){return char(x ? 'a' - 1 + x : '.');};
    if(n == 2){
        cout << -1 << endl;
    }
    else if(n % 3 == 0){
        for(int i = 0; i < n; ++i){
            for(int j = 0; j < n; ++j)
                cout << g(v33[i % 3][j % 3]);
            cout << endl;
        }
    }
    else if(n == 7){
        cout << "abc....\n";
        cout << "abc....\n";
        cout << "def....\n";
        cout << "def....\n";
        cout << "g..hhii\n";
        cout << "g..jjkk\n";
        cout << ".llmmnn\n";
    }
    else if(n == 11){
        vector<string> v(n);
        for(int i = 0; i < n; ++i)
            v[i].assign(n, '*');
        for(int i = 0; i < 5; ++i)
            for(int j = 0; j < 5; ++j)
                v[i][j] = g(v55[i][j]);
        for(int i = 0; i < 6; ++i)
            for(int j = 0; j < 5; ++j)
                v[i + 5][j] = g(v65[i][j]);
        for(int i = 0; i < 5; ++i)
            for(int j = 0; j < 6; ++j)
                v[i][j + 5] = g(v56[i][j]);
        for(int i = 0; i < 6; ++i)
            for(int j = 0; j < 6; ++j)
                v[i + 5][j + 5] = g(v66[i][j]);
        for(auto& s : v)
            cout << s << endl;
    }
    else{
        vector<string> v(n);
        for(int i = 0; i < n; ++i)
            v[i].assign(n, '.');
        int cnt = 0;
        int m = n;
        while(m % 5 != 0)
            ++cnt, m -= 4;
        if(m < 0){
            abort();
        }
        for(int i = 0; i < n; ++i)
            for(int j = 0; j < n; ++j){
                bool fx = (i < 4 * cnt);
                bool fy = (j < 4 * cnt);
                if(fx && fy)
                    v[i][j] = g(v44[i % 4][j % 4]);
                if(fx && !fy)
                    v[i][j] = g(v45[i % 4][(j - 4 * cnt) % 5]);
                if(!fx && fy)
                    v[i][j] = g(v54[(i - 4 * cnt) % 5][j % 4]);
                if(!fx && !fy)
                    v[i][j] = g(v55[(i - 4 * cnt) % 5][(j - 4 * cnt) % 5]);
            }
        for(auto& s : v)
            cout << s << endl;
    }
}



Measured memory_bytes: 2304