#include<stdio.h> int main() { int width, height; int i, j; while (~scanf("%d %d", &width, &height)) { if (width != 0 && height != 0) { printf("+"); for (i = 0; i < width; i++) { printf("-"); } printf("+ "); for (j = 0; j < height; j++) { printf("|"); for (i = 0; i < width; i++) { printf(" "); } printf("| "); } printf("+"); for (i = 0; i < width; i++) { printf("-"); } printf("+ "); } printf(" "); } return 0; }