#include<stdio.h> int main() { int a,b,i,j; while(scanf("%d %d",&a,&b)!=EOF) { for(i=0;i<b+2;i++) { if(i==0||i==b+1) { printf("+"); for(j=0;j<a;j++) { printf("-"); } printf("+"); printf(" "); } else { printf("|"); for(j=0;j<a;j++) printf(" "); printf("|"); printf(" "); } } printf(" "); } }