Thanos
InterviewTime limit1sMemory limit1024 MB
Given a binary string with even counts of 0s and 1s, keep exactly half of each digit and output the lexicographically smallest subsequence that remains.
Problem
One day, Thanos saw a string made of 0s and 1s. Strangely, the number of 0s in and the number of 1s in are both even.
In a fit of spite, Thanos wants to remove half of the 0s and half of the 1s from to form a new string . Find the lexicographically smallest string that can be.
Input
A single line containing the string .
Output
Print the lexicographically smallest string that can be .
Constraints
has a length of at least and at most .
contains an even number of 0s and an even number of 1s.