#include <bits/stdc++.h>
int main() {
  int x1, x2, x3, y1, y2, y3, temp, maxx, maxy, i, j, k, temp1, temp2, p, q, r,
      s;
  scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3);
  if (x1 < y1) {
    temp = x1;
    x1 = y1;
    y1 = temp;
  }
  if (x2 < y2) {
    temp = x2;
    x2 = y2;
    y2 = temp;
  }
  if (x3 < y3) {
    temp = x3;
    x3 = y3;
    y3 = temp;
  }
  if (x1 >= x2) {
    if (x1 == x2) {
      if (y1 >= y2) {
        maxx = x1;
        maxy = y1;
        i = 1;
      } else {
        maxx = x2;
        maxy = y2;
        i = 2;
      }
    } else {
      i = 1;
      maxx = x1;
      maxy = y1;
    }
  } else {
    i = 2;
    maxx = x2;
    maxy = y2;
  }
  if (x3 >= maxx) {
    if (x3 == maxx) {
      if (y3 >= maxy) {
        i = 3;
      }
    } else {
      i = 3;
    }
  }
  if (i == 1) {
    p = x2 + x3;
    q = y2 + y3;
    r = x2 + y3;
    s = y2 + x3;
    if (x1 == x2) {
      if (x2 == x3) {
        if (x1 == y1 + y2 + y3) {
          printf("%d\n", x1);
          for (j = 0; j < y1; j++) {
            for (k = 0; k < x1; k++) {
              printf("A");
            }
            printf("\n");
          }
          for (j = 0; j < y2; j++) {
            for (k = 0; k < x1; k++) {
              printf("B");
            }
            printf("\n");
          }
          for (j = 0; j < y3; j++) {
            for (k = 0; k < x1; k++) {
              printf("C");
            }
            printf("\n");
          }
        } else {
          printf("-1");
        }
      } else {
        printf("-1");
      }
      return 0;
    }
    if (p == x1 && y2 == x1 - y1 && y3 == x1 - y1) {
      printf("%d\n", x1);
      for (j = 0; j < y1; j++) {
        for (k = 0; k < x1; k++) {
          printf("A");
        }
        printf("\n");
      }
      for (j = 0; j < x1 - y1; j++) {
        for (k = 0; k < x1; k++) {
          if (k < x2) {
            printf("B");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (q == x1 && x2 == x1 - y1 && x3 == x1 - y1) {
      printf("%d\n", x1);
      for (j = 0; j < y1; j++) {
        for (k = 0; k < x1; k++) {
          printf("A");
        }
        printf("\n");
      }
      for (j = 0; j < x1 - y1; j++) {
        for (k = 0; k < x1; k++) {
          if (k < y2) {
            printf("B");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (r == x1 && y2 == x1 - y1 && x3 == x1 - y1) {
      printf("%d\n", x1);
      for (j = 0; j < y1; j++) {
        for (k = 0; k < x1; k++) {
          printf("A");
        }
        printf("\n");
      }
      for (j = 0; j < x1 - y1; j++) {
        for (k = 0; k < x1; k++) {
          if (k < x2) {
            printf("B");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (s == x1 && x2 == x1 - y1 && y3 == x1 - y1) {
      printf("%d\n", x1);
      for (j = 0; j < y1; j++) {
        for (k = 0; k < x1; k++) {
          printf("A");
        }
        printf("\n");
      }
      for (j = 0; j < x1 - y1; j++) {
        for (k = 0; k < x1; k++) {
          if (k < y2) {
            printf("B");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else {
      printf("-1");
      return 0;
    }
  } else if (i == 2) {
    p = x1 + x3;
    q = y1 + y3;
    r = x1 + y3;
    s = y1 + x3;
    if (x1 == x2) {
      if (x2 == x3) {
        if (x1 == y1 + y2 + y3) {
          printf("%d\n", x2);
          for (j = 0; j < y1; j++) {
            for (k = 0; k < x1; k++) {
              printf("A");
            }
            printf("\n");
          }
          for (j = 0; j < y2; j++) {
            for (k = 0; k < x1; k++) {
              printf("B");
            }
            printf("\n");
          }
          for (j = 0; j < y3; j++) {
            for (k = 0; k < x1; k++) {
              printf("C");
            }
            printf("\n");
          }
        } else {
          printf("-1");
        }
      } else {
        printf("-1");
      }
      return 0;
    }
    if (p == x2 && y1 == x2 - y2 && y3 == x2 - y2) {
      printf("%d\n", x2);
      for (j = 0; j < y2; j++) {
        for (k = 0; k < x2; k++) {
          printf("B");
        }
        printf("\n");
      }
      for (j = 0; j < x2 - y2; j++) {
        for (k = 0; k < x2; k++) {
          if (k < x1) {
            printf("A");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (q == x2 && x1 == x2 - y2 && x3 == x2 - y2) {
      printf("%d\n", x2);
      for (j = 0; j < y2; j++) {
        for (k = 0; k < x2; k++) {
          printf("B");
        }
        printf("\n");
      }
      for (j = 0; j < x2 - y2; j++) {
        for (k = 0; k < x2; k++) {
          if (k < y1) {
            printf("A");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (r == x2 && y1 == x2 - y2 && x3 == x2 - y2) {
      printf("%d\n", x2);
      for (j = 0; j < y2; j++) {
        for (k = 0; k < x2; k++) {
          printf("B");
        }
        printf("\n");
      }
      for (j = 0; j < x2 - y2; j++) {
        for (k = 0; k < x2; k++) {
          if (k < x1) {
            printf("A");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (s == x2 && x1 == x2 - y2 && y3 == x2 - y2) {
      printf("%d\n", x2);
      for (j = 0; j < y2; j++) {
        for (k = 0; k < x2; k++) {
          printf("B");
        }
        printf("\n");
      }
      for (j = 0; j < x2 - y2; j++) {
        for (k = 0; k < x2; k++) {
          if (k < y1) {
            printf("A");
          } else {
            printf("C");
          }
        }
        printf("\n");
      }
      return 0;
    } else {
      printf("-1");
      return 0;
    }
  } else if (i == 3) {
    p = x2 + x1;
    q = y2 + y1;
    r = x2 + y1;
    s = y2 + x1;
    if (x1 == x2) {
      if (x2 == x3) {
        if (x1 == y1 + y2 + y3) {
          printf("%d\n", x3);
          for (j = 0; j < y1; j++) {
            for (k = 0; k < x1; k++) {
              printf("A");
            }
            printf("\n");
          }
          for (j = 0; j < y2; j++) {
            for (k = 0; k < x1; k++) {
              printf("B");
            }
            printf("\n");
          }
          for (j = 0; j < y3; j++) {
            for (k = 0; k < x1; k++) {
              printf("C");
            }
            printf("\n");
          }
        } else {
          printf("-1");
        }
      } else {
        printf("-1");
      }
      return 0;
    }
    if (p == x3 && y2 == x3 - y3 && y1 == x3 - y3) {
      printf("%d\n", x3);
      for (j = 0; j < y3; j++) {
        for (k = 0; k < x3; k++) {
          printf("C");
        }
        printf("\n");
      }
      for (j = 0; j < x3 - y3; j++) {
        for (k = 0; k < x3; k++) {
          if (k < x2) {
            printf("B");
          } else {
            printf("A");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (q == x3 && x2 == x3 - y3 && x1 == x3 - y3) {
      printf("%d\n", x3);
      for (j = 0; j < y3; j++) {
        for (k = 0; k < x3; k++) {
          printf("C");
        }
        printf("\n");
      }
      for (j = 0; j < x3 - y3; j++) {
        for (k = 0; k < x3; k++) {
          if (k < y2) {
            printf("B");
          } else {
            printf("A");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (r == x3 && y2 == x3 - y3 && x1 == x3 - y3) {
      printf("%d\n", x3);
      for (j = 0; j < y3; j++) {
        for (k = 0; k < x3; k++) {
          printf("C");
        }
        printf("\n");
      }
      for (j = 0; j < x3 - y3; j++) {
        for (k = 0; k < x3; k++) {
          if (k < x2) {
            printf("B");
          } else {
            printf("A");
          }
        }
        printf("\n");
      }
      return 0;
    } else if (s == x3 && x2 == x3 - y3 && y1 == x3 - y3) {
      printf("%d\n", x3);
      for (j = 0; j < y3; j++) {
        for (k = 0; k < x3; k++) {
          printf("C");
        }
        printf("\n");
      }
      for (j = 0; j < x3 - y3; j++) {
        for (k = 0; k < x3; k++) {
          if (k < y2) {
            printf("B");
          } else {
            printf("A");
          }
        }
        printf("\n");
      }
      return 0;
    } else {
      printf("-1");
      return 0;
    }
  }
  return 0;
}
