构造解
根据样例:偶数时可构造由‘饼’
ww bb
ww bb
拼出来,注意向邻的饼不同
看起来:奇数无解
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<cctype>
#include<cassert>
#include<climits>
using namespace std;
#define For(i,n) for(int i=1;i<=n;i++)
#define Rep(i,n) for(int i=0;i<n;i++)
#define Fork(i,k,n) for(int i=k;i<=n;i++)
#define ForD(i,n) for(int i=n;i;i--)
#define Forp(x) for(int p=pre[x];p;p=next[p])
#define RepD(i,n) for(int i=n;i>=0;i--)
#define MEM(a) memset(a,0,sizeof(a))
#define MEMI(a) memset(a,127,sizeof(a))
#define MEMi(a) memset(a,128,sizeof(a))
#define INF (2139062143)
#define F (1000000009)
typedef long long ll;
int n;
int main()
{
//freopen("CF323A.in","r",stdin);
cin>>n;
if (n%2)
{
puts("-1");return 0;
}
else
{
For(k,n)
{
For(i,n)
{
For(j,n) if (((i-1)/2+(j-1)/2+k)%2) cout<<'b';else cout<<'w';cout<<endl;
}
cout<<endl;
}
}
//while (1);
return 0;
}