#include #include using namespace std; using namespace __gnu_pbds; // --------------------------- TEMPLATE/METAP --------------------------- struct custom_hash { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM); } }; // --------------------------- MACROS & CONSTANTS --------------------------- #define ll long long #define endl '\n' const ll MOD = 1e9+7; // --------------------------- FUNCTIONS --------------------------- bool isPrime(ll n) { if (n <= 1) return false; for (ll i = 2; i * i <= n; ++i) if (n % i == 0) return false; return true; } // --------------------------- OBSERVATIONS --------------------------- /* OB1: */ /* OB2: */ /* Final: */ // --------------------------- MAIN --------------------------- int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); ll n; cin >> n; if (n % 2) {cout << "NO" << endl; return 0;} vector> mat(n, vector (n, 0)); for (int i = 0; i < n; ++i) { if (i < n / 2) { for (int j = 0; j < i; ++j) { mat[i][j] = 2; } mat[i][i] = 1; } else { for (int j = 0; j <= i; ++j) { mat[i][j] = 2; } } } for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cout << mat[i][j]; } cout << endl; } return 0; }