An integer sequence (p1,p2,...,pn) is called P-sequence if:


Input: n ( 0 < n < 10 )


This Java applet generates P-sequences in lexicogrphic order.