tried to run the pattern 1, but memory exhausted