procedure main() every 1 to 4 do every write(permute("rogram")) end procedure permute(s) local i, x, t if s == "" then return "" every i := 1 to *s do { x := s[i] t := s t[i] := "" suspend x || permute(t) } end