# [Stax](https://github.com/tomtheisen/stax), <s>12</s> <s>14</s> 13 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)

	àJ├∙ε╝F▀ÿi☻Ia

[Run and debug it](https://staxlang.xyz/#p=854ac3f9eebc46df9869024961&i=[[11,+28],+[12,+16],+[4],+[]],+2%0A[[11,+28],+[12,+16],+[4],+[]],+5%0A[[7,+144],+[12],+[4,+8],+[3,+4,+6]],+1%0A[[7,+144],+[12],+[4,+8],+[3,+4,+6]],+10%0A[[30],+[40],+[50,+60],+[70,+80,+90]],+2%0A[[30],+[40],+[50,+60],+[80,+90]],+7%0A[[15],+[30],+[2,+3,+5],+[4,+5,+10]],+3%0A[[15],+[30],+[2,+3,+5],+[4,+5,+10]],+7&m=2)

Explanation:

    vsc{%vfr$r+@]|u Full program, unpacked, implicit input
    vs              Decrement the number and get the list
      c{  f         Copy and filter:
        %v            Length not equal to 1?
           r$r      Reverse, flatten, and reverse again
              +     Concat orig array and and modified array
               @]|u Index, wrap into array, uneval

## Stax, 12 bytes

    Å{b≈\☼╣Δ@░ ‼

Unpacked:

    {vsc{%vfr$r+@}

This is a block, so I can get rid of the `]|u`, but I don't know if this is valid as it's packing a block.