import java.util.Arrays;

public class Grille 
{
  public static void main(String[] args) 
  {
    int h = Integer.parseInt(args[0]);
    for (int i = 0;i < h; i++ ) 
    {
      System.out.print("+");
      for (int j = 0;j < h; j++ ) 
      {
        System.out.print("-+");
      }
      System.out.println();
      System.out.print("|");
      for (int j = 0;j < h; j++ ) 
      {
        System.out.print(" |");
      }
      System.out.println();
    }
    System.out.print("+");
    for (int j = 0;j < h; j++ ) 
    {
      System.out.print("-+");
    }
  }
}