#C13750. Remove Duplicate Characters

    ID: 43323 Type: Default 1000ms 256MiB

Remove Duplicate Characters

Remove Duplicate Characters

You are given a string S. Your task is to remove all duplicate characters from the string while maintaining the original order of their first occurrence. In other words, generate a new string in which each character appears only once, and the order of characters is the same as the order in which they appear in S.

For example, given the string "aabbcc", the correct output would be "abc" because the first occurrences of 'a', 'b', and 'c' are preserved.

Note: The input string may include spaces, numbers, or special characters. Your solution should process all characters accordingly.

The solution can also be described using the following concept: if you define the set of characters as \[ \{ c \mid c \text{ appears in } S \text{ in order of its first occurrence} \}, \] then the desired output string is the concatenation of all elements of this set in order.

inputFormat

The input consists of a single line containing a string S. The string may contain spaces and special characters.

Input Format:

S

outputFormat

Output a single line containing the string after removing the duplicate characters, preserving the order of their first appearance.

Output Format:

result
## sample
abcdef
abcdef