PROGRAMS BY magic contraction