#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define test() int t;cin>>t;loop(test,1,t+1)
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define nl cout<<"\n"
#define sp cout<<" "
#define F first
#define S second
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<pii>
#define vll vector<pll>
#define MOD 1000000007
#define all(x) x.begin(),x.end()

template<class C> void min_self( C &a, C b ){ a = min(a,b); }
template<class C> void max_self( C &a, C b ){ a = max(a,b); }

ll mod( ll n, ll m=MOD ){ n%=m,n+=m,n%=m;return n; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

unordered_map<long long, int, custom_hash> safe_map;

const int MAXN = 1e5+5;
const int LOGN = 21;
const ll INF = 1e14;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

int extended( int a, int b, int &x, int &y )
{
    if( a == 0 )
    {
        x = 0, y = 1;
        return b;
    }

    int x1, y1;
    int gcd = extended(b%a, a, x1, y1);

    x = y1 - (b/a) * x1;
    y = x1;

    return gcd;
}

vector< vector<string> > ans;

vector<string> grid;

void insert( int x, int y, int val )
{
    for(int i=0;i<val;i++)
    {
        for(int j=0;j<val;j++)
        {
            grid[x+i][y+j] = ans[val][i][j];
        }
    }
}

void print( vector<string>s )
{
    for( auto x : s )
    {
        cout<<x,nl;
    }
}

int main() 
{
    fastio();
    ans.resize(12);

    ans[3] = {
        "aa.",
        "..a",
        "..a"
    };

    ans[4] = {
        "aabc",
        "ddbc",
        "bcdd",
        "bcaa"
    };

    ans[5] = {
        "aabbc",
        "bc..c",
        "bc..a",
        "a.bba",
        "accdd"
    };

    ans[7] = {
        "aa.bb.c",
        ".b..aac",
        "aba....",
        "a.a...b",
        "...ccab",
        "abb..a.",
        "a.cc.bb"
    };

    int n;
    cin>>n;
    grid.resize(n, string(n,'.'));

    if( n == 2 || n == 1 )
    {
        cout<<-1,nl;
        return 0;
    }
    if( n >= 12 )
    {
        int k = (n+4)/5;
        int x = -n + 5*k;
        int y = n - 4*k;

        int now = 0;
        while( x-- )
        {
            insert(now,now,4);
            now += 4;
        }
        while(y--)
        {
            insert(now,now,5);
            now += 5;
        }
        print(grid);
    }
    else
    {
        if( n == 3 || n == 4 || n == 5 || n == 7 )
        {
            print(ans[n]);
        }
        else
        {
            if( n == 6 )
            {
                insert(0,0,3);
                insert(3,3,3);
                print(grid);
            }
            else if( n == 8 )
            {
                insert(0,0,4);
                insert(4,4,4);
                print(grid);
            }
            else if( n == 9 )
            {
                insert(0,0,3);
                insert(3,3,3);
                insert(6,6,3);
                print(grid);
            }
            else if( n == 10 )
            {
                insert(0,0,5);
                insert(5,5,5);
                print(grid);
            }
            else
            {
                insert(0,0,4);
                insert(4,4,7);
                print(grid);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3328