#include <bits/stdc++.h>
using namespace std;
inline int read(){
    int x = 0; char c = getchar();
    while (!isdigit(c)) c = getchar();
    while (isdigit(c)) x = x * 10 + c - '0',c = getchar();
    return x;
}
inline void write(int x){if (x > 9) write(x/10); putchar(x%10+'0'); }
int n; char mp[1050][1050];
int id[1050][1050]; 

int dt[] = {1,0,-1,0,1};
inline char Calc(int x,int y,int xx,int yy){
	static char tt; static bool ff; static int i,nx,ny;
	for (tt='a';tt<='z';++tt){
		ff=1;
		for (i = 0; i <= 3; ++i){
			nx = x + dt[i],ny = y + dt[i+1];
			if (!(nx==x&&ny==y) && !(nx==xx&&ny==yy) && tt==mp[nx][ny]) ff=0;
		}
		for (i = 0; i <= 3; ++i){
			nx = xx + dt[i],ny = yy + dt[i+1];
			if (!(nx==x&&ny==y) && !(nx==xx&&ny==yy) && tt==mp[nx][ny]) ff=0;
		}
		if (ff) return tt;
	}
}
inline void Work(){
	int c,i,j,ii,jj; char tt; bool ff;
	for (i = 1; i <= n; ++i) for (j = 1; j <= n; ++j) mp[i][j] = '.';
	for (i = 1; i <= n; ++i) for (j = 1; j <= n; ++j) if (id[i][j]){
		if (mp[i][j]!='.') continue;
		if (id[i][j+1]==id[i][j]) ii = i,jj = j+1; else ii = i+1,jj = j;
		tt = Calc(i,j,ii,jj);
		mp[i][j]=mp[ii][jj]=tt;
	}
	for (i = 1; i <= n; ++i,putchar('\n')) for (j = 1; j <= n; ++j) putchar(mp[i][j]); 
}
int cnt=0;
inline void Mk(int x,int y,int xx,int yy){ id[x][y] = id[xx][yy] = ++cnt; }
inline void mk(int bx,int by,int x,int y,int xx,int yy){ Mk(x+bx,y+by,xx+bx,yy+by); }
int dp[1050],lst[1050];
int main(){
	cin>>n;
	if (n==2) {puts("-1");return 0;}
	if (n%3==0){
		int k=n/3,i,bas;
		for (i=1;i<=k;++i){//3-1 
			bas = i*3-3;
			id[1+bas][1+bas] = id[1+bas][2+bas] = 2*k-1;
			id[2+bas][3+bas] = id[3+bas][3+bas] = 2*k;
		}
		Work();
		return 0;
	}
	if (n%4==0){
		int k=n/4,b,i;
		for (i=1;i<=k;++i){//4-3
			b=i*4-4;
			mk(b,b,1,1,2,1);
			mk(b,b,1,2,2,2);
			mk(b,b,1,3,1,4);
			mk(b,b,2,3,2,4);
			
			mk(b,b,3,1,3,2);
			mk(b,b,4,1,4,2);
			mk(b,b,3,3,4,3);
			mk(b,b,3,4,4,4);
		}
		Work();
		return 0; 
	}
	if (n%5==0){
		int k=n/5,b,i;
		for (i=1;i<=k;++i){//5-3
			b=i*5-5;
			mk(b,b,1,1,2,1);
			mk(b,b,1,2,2,2);
			mk(b,b,1,3,2,3);
			mk(b,b,3,1,4,1);
			mk(b,b,5,1,5,2);
			mk(b,b,3,2,3,3);
			mk(b,b,3,4,3,5);
			mk(b,b,4,4,4,5);
			mk(b,b,5,4,5,5);
			mk(b,b,4,3,5,3);
		}
		Work();
		return 0; 
	}
	if (n%7==0){
		int k=n/7,b,i;
		for (i=1;i<=k;++i){//7-3
			b=i*7-7;
			mk(b,b,1,1,2,1);
			mk(b,b,1,2,2,2);
			mk(b,b,1,3,2,3);
			mk(b,b,3,1,4,1);
			mk(b,b,3,2,4,2);
			mk(b,b,3,3,4,3);
			mk(b,b,5,1,6,1);
			mk(b,b,7,2,7,3);
			mk(b,b,5,4,5,5);
			mk(b,b,5,6,5,7);
			mk(b,b,6,4,6,5);
			mk(b,b,6,6,6,7);
			mk(b,b,7,4,7,5);
			mk(b,b,7,6,7,7);
		}
		Work();
		return 0;
	}
	int i;
	for (i = 4; i <= n; ++i){
		if (i==4||i==5||i==7) dp[i]=1,lst[i]=i;
		else{
			if (dp[i-4]){ dp[i]=1; lst[i]=4;continue; }
			if (dp[i-5]){ dp[i]=1; lst[i]=5;continue; }
			if (dp[i-7]){ dp[i]=1; lst[i]=7;continue; }
		}
	}
	int now = n; int b=0;
	while (now){
		if (lst[now]==4){
			mk(b,b,1,1,2,1);
			mk(b,b,1,2,2,2);
			mk(b,b,1,3,1,4);
			mk(b,b,2,3,2,4);
			
			mk(b,b,3,1,3,2);
			mk(b,b,4,1,4,2);
			mk(b,b,3,3,4,3);
			mk(b,b,3,4,4,4);
			b+=4;now-=4; 
		}
		else if (lst[now]==5){
			mk(b,b,1,1,2,1);
			mk(b,b,1,2,2,2);
			mk(b,b,1,3,2,3);
			mk(b,b,3,1,4,1);
			mk(b,b,5,1,5,2);
			mk(b,b,3,2,3,3);
			mk(b,b,3,4,3,5);
			mk(b,b,4,4,4,5);
			mk(b,b,5,4,5,5);
			mk(b,b,4,3,5,3);
			b+=5;now-=5; 
		}
		else if (lst[now]==7){
			mk(b,b,1,1,2,1);
			mk(b,b,1,2,2,2);
			mk(b,b,1,3,2,3);
			mk(b,b,3,1,4,1);
			mk(b,b,3,2,4,2);
			mk(b,b,3,3,4,3);
			mk(b,b,5,1,6,1);
			mk(b,b,7,2,7,3);
			mk(b,b,5,4,5,5);
			mk(b,b,5,6,5,7);
			mk(b,b,6,4,6,5);
			mk(b,b,6,6,6,7);
			mk(b,b,7,4,7,5);
			mk(b,b,7,6,7,7);
			b+=7,now-=7;
		}
	}
	Work();
    return 0;
}


Measured memory_bytes: 6272