Decode the logic and print the pattern