Determine the list of all possible triads 
loop: |s| <= M 
 loop: |u| <= M 
 loop: |v| <= M 
 if (s = u + v) then 
 Set max to the maximum value of s, u, and v. 
 Add s, u, and v to list of triads for Mmax
 end 
 end 
 end 
end 
######################################################################### 