#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
const long long MOD = 998244353;
using namespace std;

int a[1005][1005];

int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);
    if(n==2) {
        printf("-1\n"); return 0;
    }

    int i,j;
    if(n%3==0) {
        for(i=0; i<n/3; i++) {
            int curr=i*3;
            a[curr][curr+1]=1;
            a[curr][curr+2]=1;
            a[curr+1][curr]=2;
            a[curr+2][curr]=2;
        }
    }
    else {
        int mm=0;
        if(n%6==1) {
            mm=7;
            a[0][4]=a[1][4]=1;
            a[0][5]=a[1][5]=2;
            a[0][6]=a[1][6]=1;
            a[2][4]=a[3][4]=2;
            a[2][5]=a[3][5]=1;
            a[2][6]=a[3][6]=2;

            a[4][0]=a[4][1]=1;
            a[5][0]=a[5][1]=2;
            a[6][0]=a[6][1]=1;
            a[4][2]=a[4][3]=2;
            a[5][2]=a[5][3]=1;
            a[6][2]=a[6][3]=2;

            a[4][5]=a[4][6]=3;
            a[5][4]=a[6][4]=4;
        }
        else if(n%6==2) {
            mm=8;
            a[0][0]=a[0][1]=a[2][2]=a[2][3]=1;
            a[1][0]=a[1][1]=a[3][2]=a[3][3]=2;
            a[0][2]=a[1][2]=a[2][0]=a[3][0]=3;
            a[0][3]=a[1][3]=a[2][1]=a[3][1]=4;


            a[4][4]=a[4][5]=a[6][6]=a[6][7]=1;
            a[5][4]=a[5][5]=a[7][6]=a[7][7]=2;
            a[4][6]=a[5][6]=a[6][4]=a[7][4]=3;
            a[4][7]=a[5][7]=a[6][5]=a[7][5]=4;
        }
        else if(n%6==4) {
            mm=4;
            a[0][0]=a[0][1]=a[2][2]=a[2][3]=1;
            a[1][0]=a[1][1]=a[3][2]=a[3][3]=2;
            a[0][2]=a[1][2]=a[2][0]=a[3][0]=3;
            a[0][3]=a[1][3]=a[2][1]=a[3][1]=4;
        }
        else {
            mm=5;
            a[0][0]=a[0][1]=1;
            a[1][0]=a[1][1]=2;
            a[2][0]=a[2][1]=1;
            a[3][2]=a[4][2]=1;
            a[3][3]=a[4][3]=2;
            a[3][4]=a[4][4]=1;
            int j=0, k=2;
            a[j][k+1]=a[j][k+2]=4;
            a[j][k]=3;
            a[j+1][k]=3;
            a[j+1][k+2]=3;
            a[j+2][k+2]=3;
            a[j+2][k]=a[j+2][k+1]=4;
        }
        for(i=mm; i<n; i+=6) {
            a[i][i+1]=1;
            a[i][i+2]=1;
            a[i+1][i]=2;
            a[i+2][i]=2;
            a[i+3][i+4]=1;
            a[i+3][i+5]=1;
            a[i+4][i+3]=2;
            a[i+5][i+3]=2;

            int j=i; int k=i+3;
            a[j][k+1]=a[j][k+2]=4;
            a[j][k]=3;
            a[j+1][k]=3;
            a[j+1][k+2]=3;
            a[j+2][k+2]=3;
            a[j+2][k]=a[j+2][k+1]=4;
            j=i+3; k=i;
            a[j][k+1]=a[j][k+2]=4;
            a[j][k]=3;
            a[j+1][k]=3;
            a[j+1][k+2]=3;
            a[j+2][k+2]=3;
            a[j+2][k]=a[j+2][k+1]=4;
        }
    }

    for(i=0; i<n; i++) {
        for(j=0; j<n; j++) {
            if(a[i][j]==1) printf("a");
            else if(a[i][j]==2) printf("b");
            else if(a[i][j]==3) printf("c");
            else if(a[i][j]==4) printf("d");
            else printf(".");
        }
        printf("\n");
    }

    return 0;
}

Measured memory_bytes: 5120