sub P{ my$i=my$n=pop; push@_,grep{!grep{$_>$i}@$_}map{[$i,@$_]}P($n-$i)while$i-->1; [$n],@_ }