#include <bits/stdc++.h>   int main(void) {     int size = 0;     scanf( %ld , &size);     char fmt[size + 1];     fmt[size] =   0 ;     scanf( %s , fmt);     int width = 0;     int maxHeight = 1;     int ithX[size];     int depth[size];     int currentDepth = 0;     char ch =   0 ;     for (size_t ith = 0; ith < size; ith += 1) {       char thisCh = fmt[ith];       width += 1;       if (thisCh ==  [ ) {         currentDepth += 1;         depth[ith] = currentDepth;       } else {         depth[ith] = currentDepth;         currentDepth -= 1;         if (ch ==  [ ) width += 3;       }       ithX[ith] = width;       size_t thisHeight = (currentDepth << 1) + 1;       if (maxHeight < thisHeight) maxHeight = thisHeight;       ch = thisCh;     }     size_t outLen = width * maxHeight;     char buffer[outLen + 1];     buffer[outLen] =   0 ;     memset(buffer,    , outLen);     for (size_t ith = 0; ith < size; ith += 1) {       size_t x = ithX[ith] - 1;       size_t d = depth[ith];       int lineEnd = maxHeight - d;       int lineStart = maxHeight - (lineEnd + 1);       int indexStart = x + lineStart * width;       int indexEnd = x + lineEnd * width;       if (fmt[ith] ==  [ )         buffer[indexStart + 1] = buffer[indexEnd + 1] =  - ;       else         buffer[indexEnd - 1] = buffer[indexStart - 1] =  - ;       buffer[indexStart] = buffer[indexEnd] =  + ;       for (size_t y = lineStart + 1; y < lineEnd; y += 1)         buffer[x + y * width] =  | ;     }     for (size_t line = 0; line < maxHeight; line += 1) {       fwrite(buffer + line * width, sizeof(char), width, stdout);       puts(  );     }   }   