$l=<>;for$i(0..($l-1)){@p=();unshift(@p,$_)for 2 ..($i+1);print(join($",@p,1..($l-$i)).$/)}