size = int(input("Enter a height:")) times = int(input("Enter a width:")) for row in range(size): for col in range(times): if row == 0 or row == size -1 or col == 0 or col == times -1: print("+", end=" ") else: print(" ", end=" ") print()