s = input()
for i in range(len(s)):
seen = set()
for c in s[i:]:
if c in seen: break
seen.add(c)
print(c, end="")
print()
This is pretty much the code i wrote that day, might not be exactly what i wrote that day but yeah i used sets and this loop logic