In[2]:= ($RecursionLimit = 2^16;
 n = 54;
 P /: p_P ** P[a___] := p[[{a}]];
 Inv[p_P] := P @@ Ordering[p];
 Feed[P @@ Range[n]] := Null;
 Feed[p_P] := Module[{i, j},
   For[i = 1, p[[i]] == i, ++i];
   j = p[[i]];
   If[Head[s[i, j]] === P,
     Feed[Inv[s[i, j]] ** p],
   (* Else *) s[i, j] = p;
     Do[If[Head[s[k, l]] == P,
       Feed[s[i, j] ** s[k, l]];
       Feed[s[k, l] ** s[i, j]]
     ], {k, n}, {l, n}]
   ]]);
