669. Remove Duplicate letters

0

Medium

You hate duplicate characters in a string . You are given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the **smallest in lexicographical order** among all possible results.

Input Format

Single line consisting of a string s.

Output Format

Print the resultant string.

Example

Input

cbacdcbc

Output

acdb

Constraints

1 <= s.length <= 105
s consists of lowercase English letters.
Loading...

View Submissions

Console