/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author LH
 */
public class SquareStar
{
    public static void main(String[] args) throws Exception
    {
        int m = InteractiveIO.promptForInt("Zahl bitte");
        int n = InteractiveIO.promptForInt("Zahl bitte");
        
        
        int bsize = m/2-n;
        InteractiveIO.write(""+bsize);
        String fullstarline = "";
        String holeLine = "";
        for (int i = 0; i < m; i++)
        {
            fullstarline+="*";
            if(i>=bsize&&(i<m-bsize))
            {
                holeLine+=" ";
            }
            else
            {
                holeLine+="*";
            }
        }
        for (int i = 0; i < m; i++)
        {
            if(i>=bsize&&(i<m-bsize))
            {
                InteractiveIO.write(holeLine);
            }
            else
            {
                InteractiveIO.write(fullstarline);
            }
        }
    }
}
