1#include<bits/stdc++.h>
2using namespace std;
3int main()
4{
5 int row,col;
6 cin>>row>>col;
7 for(int i=1;i<=row;i++){
8 for(int j=1;j<=col;j++){
9 if(i==1||i==row||j==1||j==col){
10 cout<<"*";
11 }
12 else{
13 cout<<" ";
14 }
15 }
16 cout<<endl;
17 }
18}