sub format_number_list {
   my ($m, @list) = @_;

   return join '', ("$m", (map {
         if (($_-abs($m))==1){
                 $m=-$_;'';
         }else{
                 ($m<0)?  "$m, ".($m=$_): ", ".($m=$_);
         }
         } @list),($m<0)?"$m":'');

}

sub expand_number_list {
   return map {(m/(\d+)-(\d+)/)?($1..$2):$_} split /, /, shift;
}
