#anu
from itertools  import permutations

s=input()
n=len(s)
p=list(permutations(s))
rl=[]
r=""
for i in p:
    r=""
    for j in range(n):
        r+=i[j]
    if r not in rl:
        rl.append(r)
for i in rl:
    print(i)

1f1982149b1c838c253f92aa76a5c2b65cef487b
<mask token>

<mask token>
for i in p:
    r = ''
    for j in range(n):
        r += i[j]
    if r not in rl:
        rl.append(r)
for i in rl:
    print(i)

<mask token>
s = input()
n = len(s)
p = list(permutations(s))
rl = []
r = ''
for i in p:
    r = ''
    for j in range(n):
        r += i[j]
    if r not in rl:
        rl.append(r)
for i in rl:
    print(i)

from itertools import permutations
s = input()
n = len(s)
p = list(permutations(s))
rl = []
r = ''
for i in p:
    r = ''
    for j in range(n):
        r += i[j]
    if r not in rl:
        rl.append(r)
for i in rl:
    print(i)

#anu
from itertools  import permutations

s=input()
n=len(s)
p=list(permutations(s))
rl=[]
r=""
for i in p:
    r=""
    for j in range(n):
        r+=i[j]
    if r not in rl:
        rl.append(r)
for i in rl:
    print(i)
