#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define ARRAY_ELEMENT(ARRAY, Y, X, STRIDE) ARRAY[(Y) * STRIDE + (X)]

int main(void)
{
    unsigned int base;
    unsigned int y, x, offsetX, offsetY;

    int *arr = NULL;
    unsigned int arrSize = 0;
    unsigned int arrStride = 0;

    scanf("%u", &base);

    // Allocate memory for an array.
    arrSize = base * base * base * base * sizeof(int);
    arrStride = base * base;
    arr = (int *)malloc(arrSize);

    // Initialize array.
    memset(arr, 0, arrSize);

    // Fill value
    for(y = 0; y < base; ++y)
    {
        for(x = 0; x < base; ++x)
        {
            offsetY = y * base;
            offsetX = x * base;
            ARRAY_ELEMENT(arr, offsetY + y, offsetX + x, arrStride) = 1;
        }
    }

    // Print out.
    for(y = 0; y < base * base; ++y)
    {
        for(x = 0; x < base * base; ++x)
        {
            printf("%d", ARRAY_ELEMENT(arr, y, x, arrStride));
            if((x + 1) % base == 0 && ((x + 1) / base) < base)
                printf("|");
        }
        if((y + 1) % base == 0 && ((y + 1) / base) < base)
        {
            printf("\n");
            for(x = 0; x < base * base; ++x)
            {
                printf("-");
                if((x + 1) % base == 0 && ((x + 1) / base) < base)
                    printf("+");
            }
        }
        printf("\n");
    }

    // Free up.
    free(arr);
    return 0;
}