val w,h=readInt val s="+"+"-"*w+"+\n" print(s+("|"+" "*w+"|\n")*h+s)