184. Magic pattern construction