in reply to Key Word In Context system (golf, anyone)?
perl -lane'for(@F){print"@F";push@F,shift@F}' file |sort [download]
perl -lane'for(@F){push@E,"@F";push@F,shift@F}END{print for sort@E}' f +ile [download]