package PatternsQuestions;
import java.util.Scanner;
public class ques7part2 {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int nst = 1;
int nsp = 1;
for(int row = 1; row<=n; row++) {
//working
// if conditions for the first and nth row
if(row==1 || row==n) {
for(int count=1; count<=n-1; count++) {
for (int cst=1; cst<=nst; cst++) {
System.out.print("*");
}
for(int csp=1; csp<=nsp; csp++) {
System.out.print(" ");
}
}
} else { // condition for rest of the rows
System.out.print("*");
for(int spc = 1; spc<=2*n-3; spc++) {
System.out.print(" ");
}
}
System.out.print("*");
//preparation
System.out.println();
}
scn.close();
}
}