title: Print all possible ties in sorting
body: <p>I have a task in which I have a labeled numeric vector, say size 5 and labels a, b, c, d, e, and I need to sort it and then print the labels in (inverse) sorted order. So for example, given this vector v1 in input:</p>
  
  <pre><code>     a   b    c   d     e
  1   -3  -1   10   5   -15
  </code></pre>
  
  <p>the required output would be: cdbae.</p>
  
  <p>Now, the hard part is handling ties. I need to print <strong>all</strong> possible orders in case of a tie. So for example, given this other vector v2 in input:</p>
  
  <pre><code>     a    b    c    d    e
  1   10   29   10   10  -15
  </code></pre>
  
  <p>After sorting we'd have:</p>
  
  <pre><code>     b    a   c    d    e
  1   29   10  10   10  -15
  </code></pre>
  
  <p>But of course we have <code>3! = 6</code> possible permutations. I would like it to print this array:</p>
  
  <pre><code>v &lt;- c("bacde", "badce", "bcade", "bcdae", "bdcae", "bdace").
  </code></pre>
  
  <p>If that helps, the number of labels is never more than 10 so I don't mind performance relative to that, for that matter.</p>