program to print the pattern