# Arup Guha
# 6/26/2018
# Solution to Python SI@UCF Python Test #2 Q4

def main():

    # Get input.
    n = int(input("How many stars on the first row?\n"))
    numrows = int(input("How many rows of stars?\n"))

    # Outer loop is for rows.
    for i in range(numrows):

        # Calculate # of stars to print for this row.
        toprint = n

        # If odd, one less star, but we print a space first.
        if i%2 == 1:
            toprint = n-1
            print(" ", end="")

        # Print them.
        for j in range(toprint):
            print("*", end=" ")

        # Go to next row.
        print()

main()
