REM >deptnums max_dept_num% = 7 dept_sum% = 12 PRINT "police sanitation fire" FOR police% = 2 TO max_dept_num% STEP 2 FOR sanitation% = 1 TO max_dept_num% IF sanitation% <> police% THEN fire% = (dept_sum% - police%) - sanitation% IF fire% > 0 AND fire% <= max_dept_num% AND fire% <> sanitation% AND fire% <> police% THEN PRINT " "; police%; " "; sanitation%; " "; fire% ENDIF NEXT NEXT END