write a program to print patterns