#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#include <functional>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<ll, ll, ll, ll> tlglglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
typedef unsigned int uint;
typedef unsigned long long ull;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template <class T> using VVV = V<VV<T>>;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;
void yesno(bool ok, string yes = "Yes", string no = "No") {
    if (ok) {
        cout << yes << endl;
    } else {
        cout << no << endl;
    }
}

ll three[3][3] = {{0, 0, 1}, {1, -1, 1}, {1, 0, 0}};
ll four[4][4] = {{0, 0, 1, 2}, {3, 3, 1, 2}, {2, 1, 3, 3}, {2, 1, 0, 0}};
ll five[5][5] = {{0, 1, 2, 2, -1}, {0, 1, -1, -1, 2}, {3, 4, 4, -1, 2}, {3, -1, 3, 1, 1}, {4, 4, 3, 0, 0}};
ll six[6][6] = {{0, 1, 2, -1, -1, -1}, {0, 1, 2, -1, -1, -1}, {3, 3, 4, 4, 5, 5}, {6, 6, 7, 7, 8, 8},
                    {-1, -1, -1, 2, 1, 0}, {-1, -1, -1, 2, 1, 0}};
ll seven[7][7] = {{0, 0, 1, 1, 2, 2, -1}, {3, 3, 4, 4, -1, -1, 2}, {5, 5, 6, 6, -1, -1, 2}, {-1, -1, -1, -1, 6, 4, 1},
                    {-1, -1, -1, -1, 6, 4, 1}, {-1, -1, -1, -1, 5, 3, 0}, {-1, -1, -1, -1, 5, 3, 0}};
ll bo[1010][1010];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    if (N == 2) {
        cout << -1 << endl;
    } else if (N == 3) {
        REP(i, 0, 3) {
            string s = "";
            REP(j, 0, 3) {
                if (three[i][j] == -1) {
                    s += '.';    
                } else {
                    s += three[i][j] + 'a';
                }
            }
            cout << s << endl;
        }
    } else {
        REP(i, 0, N) {
            fill(bo[i], bo[i] + N, -1);
        }
        ll div = N / 4;
        REP(i, 0, div - 1) {
            REP(j, 0, 4) {
                REP(k, 0, 4) {
                    bo[i * 4 + j][i * 4 + k] = four[j][k];
                }
            }
        }
        ll rem = N % 4;
        ll base = (div - 1) * 4;
        if (rem == 0) {
            REP(i, 0, 4) {
                REP(j, 0, 4) {
                    bo[base + i][base + j] = four[i][j];
                }
            }
        } else if (rem == 1) {
            REP(i, 0, 5) {
                REP(j, 0, 5) {
                    bo[base + i][base + j] = five[i][j];
                }
            }
        } else if (rem == 2) {
            REP(i, 0, 6) {
                REP(j, 0, 6) {
                    bo[base + i][base + j] = six[i][j];
                }
            }
        } else {
            REP(i, 0, 7) {
                REP(j, 0, 7) {
                    bo[base + i][base + j] = seven[i][j];
                }
            }
        }
        REP(i, 0, N) {
            string s = "";
            REP(j, 0, N) {
                if (bo[i][j] == -1) {
                    s += '.';
                } else {
                    s += bo[i][j] + 'a';
                }
            }
            cout << s << endl;
        }
    }
}


Measured memory_bytes: 9088