Language: C++

#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <chrono>
#include <random>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <ctime>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define ad push_back
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define y1 EsiHancagorcRepa
 
 
const int N=2e3+6;
const ll MOD=998244353;

char mat1[3][3]={{'.','.','a'},{'.','.','a'},{'b','b','.'}};
char mat2[3][3]={{'a','a','b'},{'b','.','b'},{'b','a','a'}};
char c[N][N];
bool col[N][N];
void add(int si,int sj,int dl){
	FORT(i,si,si+2)FORT(j,sj,sj+2){
		c[i][j]=mat1[i-si][j-sj]+dl;
		if (mat1[i-si][j-sj]=='.')c[i][j]='.';
	}
}
void add2(int si,int sj,int dl){
	FORT(i,si,si+2)FORT(j,sj,sj+2){
		c[i][j]=mat2[i-si][j-sj]+dl;
		if (mat2[i-si][j-sj]=='.')c[i][j]='.';
	}
}

void make(int m,int dl){
	int tv;
	if (m%2==0){
		tv=m/2-1-m/3;
	}
	else{
		tv=m/2-m/3;
	}
	FOR(i,m/3){
		FORT(j,i,i+tv-1){
			col[i][j%(m/3)]=true;
		}
	}
}

int main(){
	fastio;
	int n;
	cin>>n;
	c[0][0]='.';
	assert(n==8);
	if (n%3 && n%2==0){
		assert(0);
		cout<<-1<<endl;
		return 0;
	}
	if (n%3==0){
		FOR(i,n/3){
			FOR(j,n/3){
				if (i%2==j%2){
					add(i*3,j*3,0);
				}
				else{
					add(i*3,j*3,2);
				}
			}
		}
	}
	else if (n%3==1){
		make(n-1);
		FOR(i,n/2){
			if (i%2){
				c[0][2*i+1]=c[0][2*i+2]='w';
				c[2*i+1][0]=c[2*i+2][0]='y';
			}
			else{
				c[0][2*i+1]=c[0][2*i+2]='x';
				c[2*i+1][0]=c[2*i+2][0]='z';
			}
		}
		FOR(i,n/3){
			FOR(j,n/3){
				if (i%2==j%2){
					if (col[i][j])add2(i*3+1,j*3+1,0);
					else add(i*3+1,j*3+1,0);
				}
				else{
					if (col[i][j])add2(i*3+1,j*3+1,2);
					else add(i*3+1,j*3+1,2);
				}
			}
		}
	}
	else{
		if (n%2)make(n-2);
		else make(n-2,-1);
		FOR(i,n/2){
			if (i%2){
				c[0][2*i]=c[0][2*i+1]='w';
				c[2*i][n-1]=c[2*i+1][n-1]='y';
			}
			else{
				c[0][2*i]=c[0][2*i+1]='x';
				c[2*i][n-1]=c[2*i+1][n-1]='z';
			}
		}
		FOR(i,n/2){
			if (i%2){
				c[n-1][2*i+1]=c[n-1][2*i+2]='q';
				c[2*i+1][0]=c[2*i+2][0]='t';
			}
			else{
				c[n-1][2*i+1]=c[n-1][2*i+2]='s';
				c[2*i+1][0]=c[2*i+2][0]='v';
			}
		}
		FOR(i,n/3){
			FOR(j,n/3){
				if (i%2==j%2){
					if (col[i][j])add2(i*3+1,j*3+1,0);
					else add(i*3+1,j*3+1,0);
				}
				else{
					if (col[i][j])add2(i*3+1,j*3+1,2);
					else add(i*3+1,j*3+1,2);
				}
			}
		}
	}
	FOR(i,n){
		FOR(j,n){
			cout<<c[i][j];
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:104:21: error: too few arguments to function 'void make(int, int)'
  104 |                 make(n-1);
      |                 ~~~~^~~~~
a.cc:65:6: note: declared here
   65 | void make(int m,int dl){
      |      ^~~~
a.cc:129:29: error: too few arguments to function 'void make(int, int)'
  129 |                 if (n%2)make(n-2);
      |                         ~~~~^~~~~
a.cc:65:6: note: declared here
   65 | void make(int m,int dl){
      |      ^~~~