I used to implement permutation with repetition by using `std::next_permutation`.

But I found that it(`std::next_permutation`) changes location of item which is repeated.

```
e.g.
[0] 0 1 2 2'
[1] 2' 0 1 2
[2] 2' 1 0 2
[3] 2' 1 2 0 
...

```

How can I implement permutation with repetition not changing the order of repetition items with/without using `std::next_permutation`?

```
e.g.
[0] 0 1 2 2'
[1] 1 0 2 2'
[2] 1 2 0 2'
[3] 1 2 2' 0
...

```