/*D letter pattern
******
*     *
*     *
*     *
*     *
*     *
*     *
****** */
#include <stdio.h>
int main(){
    int n;
    printf("Enter the limit (prefer odd number):"); 
    scanf("%d", &n);
    for(int i=1; i<=n; i++){
        for(int j=1; j<=n; j++){
            if((j==1)||(i==1&&j<n)||(i==n&&j<n)||(j==n&&i>1&&i<n)){
                printf("*");
            } else{
                printf(" ");
            }
        }
        printf("\n");
    }
}