#include #include using namespace std; using namespace atcoder; #define rep(i, l, r) for (ll i = (l); i < (r); ++i) #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() using ll = long long; using ull = unsigned long long; using ld = long double; using pl = pair; using vi = vector; using vl = vector; using vvl = vector>; using vvvl = vector>>; template using pq_ = priority_queue, greater>; #define sz(x) (int)(x).size() typedef pair pii; using mint=modint998244353; // g++ a.cpp -std=c++23 -I. // g++ -std=c++23 -I. a.cpp -o main // g++ -std=c++23 -I. anaive.cpp -o naive // g++ -std=c++23 -I. agene.cpp -o gene #include #include namespace mp = boost::multiprecision; using Bint = mp::cpp_int; using Real = mp::number>; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; cin>>n; ll a,b,c; cin>>a>>b>>c; vvl z(n,vl(n)); vl d; rep(i,0,a)d.push_back(1); rep(i,0,b)d.push_back(2); rep(i,0,c)d.push_back(3); ll now=0; rep(i,0,n){ rep(j,0,n){ if((i+j)%2==0){ z[i][j]=d[now]; now++; } } } rep(i,0,n){ rep(j,0,n){ if((i+j)%2==1){ z[i][j]=d[now]; now++; } } } rep(i,0,n){ rep(j,0,n){ cout<