func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MX = 300003;   int h[4][4];   bool res[4][MX];   int len;   int calc(int i) {     if (h[0][i] <= h[0][1]) {       int x = h[0][1] - h[0][i];       if ((h[1][i] < x) || (h[1][i] - x) % 2) return -1;       int k = (h[1][i] - x) / 2;       if (k > h[0][i]) return -1;       return h[0][i] - k;     } else {       int x = h[0][i] - h[0][1];       if (h[1][i] < x || (h[1][i] - x) % 2) return -1;       int k = (h[1][i] - x) / 2;       if (k > h[0][1]) return -1;       return h[0][1] - k;     }   }   bool solve() {     for (int j = 0; j < h[0][1]; ++j) res[1][j] = 1;     int a = calc(2);     int c = calc(3);     if (a == -1 || c == -1) return false;     int b = h[0][2] - a;     int d = h[0][3] - c;     int x1, y1;     if (a >= c) {       x1 = a - c;       y1 = a;       h[2][3] -= a - c;       for (int i = 0; i < a; ++i) res[2][i] = 1;       for (int i = a - c; i < a; ++i) res[3][i] = 1;     } else {       x1 = c - a;       y1 = c;       h[2][3] -= c - a;       for (int i = c - a; i < c; ++i) res[2][i] = 1;       for (int i = 0; i < c; ++i) res[3][i] = 1;     }     int x2, y2;     if (b >= d) {       x2 = h[0][1] + b - d;       y2 = h[0][1] + b;       h[2][3] -= b - d;       for (int i = h[0][1]; i < h[0][1] + b; ++i) res[2][i] = 1;       for (int i = h[0][1] + b - d; i < h[0][1] + b; ++i) res[3][i] = 1;     } else {       x2 = h[0][1] + d - b;       y2 = h[0][1] + d;       h[2][3] -= d - b;       for (int i = h[0][1] + d - b; i < h[0][1] + d; ++i) res[2][i] = 1;       for (int i = h[0][1]; i < h[0][1] + d; ++i) res[3][i] = 1;     }     if (h[2][3] < 0 || h[2][3] % 2) return false;     int py = y1;     while (y1 < h[0][1] && x1 < py && h[2][3] > 0) {       swap(res[2][x1], res[2][y1]);       ++x1;       ++y1;       h[2][3] -= 2;     }     len = y2;     py = y2;     while (x2 < py && h[2][3] > 0) {       swap(res[2][x2], res[2][y2]);       ++x2;       ++y2;       ++len;       h[2][3] -= 2;     }     return h[2][3] == 0;   }   int main() {     for (int i = 0; i < 4; ++i)       for (int j = i + 1; j < 4; ++j) scanf( %d , h[i] + j);     if (solve()) {       printf( %d n , len);       for (int i = 0; i < 4; ++i) {         for (int j = 0; j < len; ++j) printf( %c ,  a  + res[i][j]);         printf(  n );       }     } else       puts( -1 );     return 0;   }   