Magic square generator