#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <random>

using namespace std;

#define int long long

vector<vector<int>> solivoli;
vector<vector<int>> soli;
vector<vector<int>> voli;
vector<vector<int>> volians5;
vector<vector<int>> volians7;

void gen(int n, vector<vector<int>> &ct, int c1, int c2, int pnt, vector<vector<int>> &ans, int lim) {
    // cout << c1 << ' ' << c2 << endl;
    if (c1 == 0 && c2 == 0) {
        ans = ct;
        cerr << "succes" << endl;
        return;
    }
    vector<int> cr(n);
    vector<int> cc(n);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (ct[i][j] == -1) continue;
            if (i + 1 < n && ct[i][j] == ct[i + 1][j]) {
                cc[j]++;
                cr[i]++;
                cr[i + 1]++;
            } 
            if (j + 1 < n && ct[i][j] == ct[i][j + 1]) {
                cr[i]++;
                cc[j]++;
                cc[j + 1]++;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (ct[i][j] != -1) continue;
            if (i + 1 < n && ct[i + 1][j] == -1 && c1 > 0 && cc[j] < lim && cr[i] < lim && cr[i + 1] < lim) {
                ct[i][j] = pnt;
                ct[i + 1][j] = pnt;
                gen(n, ct, c1 - 1, c2, pnt + 1, ans, lim);
                if (!ans.empty()) {
                    return;
                }
                ct[i][j] = -1;
                ct[i + 1][j] = -1;
            } 
            if (j + 1 < n && ct[i][j + 1] == -1 && c2 > 0 && cr[i] < lim && cc[j] < lim && cc[j + 1] < lim) {
                ct[i][j] = pnt;
                ct[i][j + 1] = pnt;
                gen(n, ct, c1, c2 - 1, pnt + 1, ans, lim);
                if (!ans.empty()) {
                    return;
                }
                ct[i][j] = -1;
                ct[i][j + 1] = -1;
            }
        }
    }
}

void init() {
    {
        int n = 6;
        vector<vector<int>> tmp(n, vector<int> (n, -1));
        gen(n, tmp, n, n, 3, solivoli, 3);
    }
    {
        int n = 4;
        vector<vector<int>> tmp(n, vector<int> (n, -1));
        gen(n, tmp, n, n, 3, soli, 3);
    }
    {
        int n = 3;
        vector<vector<int>> tmp(n, vector<int> (n, -1));
        gen(n, tmp, 1, 1, 1, voli, 1);
    }
    {
        int n = 5;
        vector<vector<int>> tmp(n, vector<int> (n, -1));
        gen(n, tmp, n, n, 3, volians5, 3);
    }
    {
        int n = 7;
        vector<vector<int>> tmp(n, vector<int> (n, -1));
        gen(n, tmp, n, n, 3, volians7, 3);
    }  
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    init();

    int n;
    cin >> n;
    vector<vector<int>> ans(n, vector<int> (n, -1));
    if (n == 7) {
        ans = volians7;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (ans[i][j] == -1) {
                    cout << '.'; 
                } else {
                    cout << (char)(ans[i][j] + 'a');
                }
            }
            cout << endl;
        }
        return 0;
    }
    if (n % 3 == 0) {
        for (int i = 0; i < n; i += 3) {
            for (int di = 0; di < 3; di++) {
                for (int dj = 0; dj < 3; dj++) {
                    ans[i + di][i + dj] = voli[di][dj];
                }
            }
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (ans[i][j] == -1) {
                    cout << '.'; 
                } else {
                    cout << (char)(ans[i][j] + 'a');
                }
            }
            cout << endl;
        }
        return 0;
    }
    int wn = n;
    if (n % 2 == 1 && n >= 5) {
        for (int i = n - 5; i < n; i += 5) {
            for (int di = 0; di < 5; di++) {
                for (int dj = 0; dj < 5; dj++) {
                    ans[i + di][i + dj] = volians5[di][dj];
                }
            }
        }
        n -= 5;
    }   
    if (n % 2 == 0 && n != 2) {
        int c1 = 0;
        int c2 = 0;
        int ln = n;
        while (ln % 4) {
            ln -= 6;
            c2++;
        }
        c1 = ln / 4;
        for (int i = 0; i < 4 * c1; i += 4) {
            for (int di = 0; di < 4; di++) {
                for (int dj = 0; dj < 4; dj++) {
                    ans[i + di][i + dj] = soli[di][dj];
                }
            }
        }
        for (int i = 4 * c1; i < n; i += 6) {
            for (int di = 0; di < 6; di++) {
                for (int dj = 0; dj < 6; dj++) {
                    ans[i + di][i + dj] = solivoli[di][dj];
                }
            }
        }
       for (int i = 0; i < wn; i++) {
            for (int j = 0; j < wn; j++) {
                if (ans[i][j] == -1) {
                    cout << '.'; 
                } else {
                    cout << (char)(ans[i][j] + 'a');
                }
            }
            cout << endl;
        }
        return 0;
    }
    cout << -1 << endl;
}


Measured memory_bytes: 10368