func_code_string: #include <bits/stdc++.h>   const double EPS = 1e-24;   const long long int MOD = 1000000007ll;   const long long int MOD1 = 1000000009ll;   const long long int MOD2 = 1100000009ll;   const double PI = 3.14159265359;   int INF = 2147483645;   long long int INFINF = 9223372036854775807;   template <class T>   T Max2(T a, T b) {     return a < b ? b : a;   }   template <class T>   T Min2(T a, T b) {     return a < b ? a : b;   }   template <class T>   T Max3(T a, T b, T c) {     return Max2(Max2(a, b), c);   }   template <class T>   T Min3(T a, T b, T c) {     return Min2(Min2(a, b), c);   }   template <class T>   T Max4(T a, T b, T c, T d) {     return Max2(Max2(a, b), Max2(c, d));   }   template <class T>   T Min4(T a, T b, T c, T d) {     return Min2(Min2(a, b), Min2(c, d));   }   using namespace std;   int bit_count(long long int _x) {     int _ret = 0;     while (_x) {       if (_x % 2 == 1) _ret++;       _x /= 2;     }     return _ret;   }   int bit(long long int _mask, long long int _i) {     return (_mask & (1 << _i)) == 0 ? 0 : 1;   }   long long int powermod(long long int _a, long long int _b, long long int _m) {     long long int _r = 1;     while (_b) {       if (_b % 2 == 1) _r = (_r * _a) % _m;       _b /= 2;       _a = (_a * _a) % _m;     }     return _r;   }   int x[5], y[5];   bool issquare[30010];   int sz, sz2;   char s[110][110];   char c[5];   void type2(int a1, int a2, int b1, int b2, int c1, int c2, int i1, int i2,              int i3) {     for (int i = 1; i <= a1; i++)       for (int j = 1; j <= a2; j++) s[i][j] = c[i1];     for (int i = a1 + 1; i <= a1 + b1; i++)       for (int j = 1; j <= b2; j++) s[i][j] = c[i2];     for (int i = 1; i <= c1; i++)       for (int j = a2 + 1; j <= a2 + c2; j++) s[i][j] = c[i3];   }   void print() {     cout << sz <<   n ;     for (int i = 1; i <= sz; i++) {       for (int j = 1; j <= sz; j++) cout << s[i][j];       cout <<   n ;     }   }   int main() {     std::ios::sync_with_stdio(false);     srand(time(NULL));     for (int i = 1; i <= 3; i++) cin >> x[i] >> y[i];     c[1] =  A ;     c[2] =  B ;     c[3] =  C ;     for (int i = 2; i * i <= 30010; i++) issquare[i * i] = true;     sz2 = 0;     for (int i = 1; i <= 3; i++) sz2 += x[i] * y[i];     if (!issquare[sz2]) {       cout <<  -1 ;       return 0;     }     for (int i = 2; i * i <= 30010; i++) {       if (i * i == sz2) {         sz = i;         break;       }     }     for (int i = 1; i <= 3; i++)       if (x[i] > y[i]) swap(x[i], y[i]);     if (y[1] == sz && y[2] == sz && y[3] == sz && x[1] + x[2] + x[3] == sz) {       cout << sz <<   n ;       for (int i = 1; i <= x[1]; i++) {         for (int j = 1; j <= y[1]; j++) cout <<  A ;         cout <<   n ;       }       for (int i = 1; i <= x[2]; i++) {         for (int j = 1; j <= y[2]; j++) cout <<  B ;         cout <<   n ;       }       for (int i = 1; i <= x[3]; i++) {         for (int j = 1; j <= y[3]; j++) cout <<  C ;         cout <<   n ;       }       return 0;     }     for (int i = 1; i <= 3; i++)       for (int j = 1; j <= 3; j++)         for (int k = 1; k <= 3; k++) {           if (i == j || j == k || i == k) continue;           if (x[j] + x[k] == sz && y[j] == y[k]) {             if (x[i] == sz && y[i] == sz - y[j]) {               type2(x[j], y[j], x[k], y[k], x[i], y[i], j, k, i);               print();               return 0;             }             if (y[i] == sz && x[i] == sz - y[j]) {               type2(x[j], y[j], x[k], y[k], y[i], x[i], j, k, i);               print();               return 0;             }           } else if (x[j] + y[k] == sz && y[j] == x[k]) {             if (x[i] == sz && y[i] == sz - y[j]) {               type2(x[j], y[j], y[k], x[k], x[i], y[i], j, k, i);               print();               return 0;             }             if (y[i] == sz && x[i] == sz - y[j]) {               type2(x[j], y[j], y[k], x[k], y[i], x[i], j, k, i);               print();               return 0;             }           } else if (y[j] + x[k] == sz && x[j] == y[k]) {             if (x[i] == sz && y[i] == sz - x[j]) {               type2(y[j], x[j], x[k], y[k], x[i], y[i], j, k, i);               print();               return 0;             }             if (y[i] == sz && x[i] == sz - x[j]) {               type2(y[j], x[j], x[k], y[k], y[i], x[i], j, k, i);               print();               return 0;             }           } else if (y[j] + y[k] == sz && x[j] == x[k]) {             if (x[i] == sz && y[i] == sz - x[j]) {               type2(y[j], x[j], y[k], x[k], x[i], y[i], j, k, i);               print();               return 0;             }             if (y[i] == sz && x[i] == sz - x[j]) {               type2(y[j], x[j], y[k], x[k], y[i], x[i], j, k, i);               print();               return 0;             }           }         }     cout <<  -1 ;     return 0;   }   