There are several possible algorithms for checking to see if a list forms a magic square. Though the details might be different, your algorithm probably involved identifying three numbers at a time and adding them. Call these sets of three numbers "triples".
lookup items () from ()
from the Getting Started for this lab might be useful here.