Magic square algorithm python. . ...