#include <bits/stdc++.h>
#include <sys/types.h>
#include <unistd.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

template<typename T> vector<T> make_vector(size_t sz){
	return vector<T>(sz);
}

template<typename T,typename... Ts> 
auto make_vector(size_t sz, Ts... ts){
	return vector<decltype(make_vector<T>(ts...))>(sz, make_vector<T>(ts...));
}

template<typename T,typename U,typename... V> 
typename enable_if<is_same<T, U>::value!=0>::type 
fill_value(U &u, const V... v){
	u=U(v...);
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_value(U &u, const V... v){
	for(auto &e:u){
		fill_value<T>(e,v...);
	}
}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

const pid_t pid = getpid();
// Problem Specific Parameter:

const string five[5] = {
	"aabbc", 
	"h.jjc",
	"hi..d",
	"gi..d",
	"gffee"
};

const string seven[7] = {
	".aabbcc", 
	"a.gg.gg",
	"af..f..",
	"bf..f..",
	"b.gg.gg",
	"cf..f..",
	"cf..f.."
};

const string eleven[11] = {
	".aabbcc....", 
	"a.gg.gg....",
	"af..f......",
	"bf..f......",
	"b.gg.gg....",
	"cf..f......",
	"cf..f......",
	".......aacd",
	".......bbcd",
	".......cdaa",
	".......cdbb"
};

int main(void){
	int n;
	cin >> n;

	if(n == 5 or n == 7 or n == 11) {
		if(n == 5) {
			rep(i, n) cout << five[i] << endl;
		} 

		if(n == 7) {
			rep(i, n) cout << seven[i] << endl;
		}

		if(n == 11) {
			rep(i, n) cout << eleven[i] << endl;
		}

		return 0;
	}

	vector<int> ans_seq;
	
	rep(a, 501) rep(b, 501) {
		const int val = 3 * a + 2 * b;
		if(ans_seq.size()) continue;
		if(n != val) continue;

		if((a == 0 and b >= 2) or (a >= 0 and b == 0) or (a >= 3 and b >= 2)){
			ans_seq.push_back(3 * a);
			ans_seq.push_back(2 * b);
		}
	}

	if(ans_seq.size()) {
		vector<string> ans(n, string(n, '.'));
		const int three_num = ans_seq[0] / 3;
		
		if (ans_seq[1] == 0) {
			rep(i, three_num) {
				const int row_base = 3 * i;
				const int col_base = 3 * i;
				ans[row_base + 0][col_base + 1] = 'a';
				ans[row_base + 0][col_base + 2] = 'a';
				ans[row_base + 1][col_base + 0] = 'b';
				ans[row_base + 2][col_base + 0] = 'b';
			}

		} else {
  
			rep(i, three_num) {
				const int row_base = 3 * i;
				rep(j, 3) {
					const int col_base = 3 * ((i + j) % three_num);
					ans[row_base + 0][col_base + 1] = 'a';
					ans[row_base + 0][col_base + 2] = 'a';
					ans[row_base + 1][col_base + 0] = 'b';
					ans[row_base + 2][col_base + 0] = 'b';
				}
			}

			int offset = ans_seq[0];

			const int two_num = ans_seq[1] / 2;


			rep(i, two_num) {
				const int row_base = offset + 2 * i;
				rep(j, 2) {
					const int col_base = offset + 2 * ((i + j) % two_num);
					if(j == 0) {
						ans[row_base + 0][col_base + 0] = 'a';
						ans[row_base + 0][col_base + 1] = 'a';
						ans[row_base + 1][col_base + 0] = 'b';
						ans[row_base + 1][col_base + 1] = 'b';
					} else {
						ans[row_base + 0][col_base + 0] = 'c';
						ans[row_base + 1][col_base + 0] = 'c';
						ans[row_base + 0][col_base + 1] = 'd';
						ans[row_base + 1][col_base + 1] = 'd';
					}
				}
			}
		}

		rep(i, n) cout << ans[i] << endl;

	} else {
		cout << -1 << endl;
	}

	return 0;
}

Measured memory_bytes: 2304