set i [set n [gets stdin s]] while {~[incr i -1]} {set j $i while {$j<$n} {puts [string ra $s $i $j] incr j}}