시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 1024 MB 256 108 99 58.580%

문제

어느 날, 타노스는 0과 1로 이루어진 문자열 $S$를 보았다. 신기하게도, $S$가 포함하는 0의 개수와 $S$가 포함하는 1의 개수는 모두 짝수라고 한다.

갑자기 심술이 난 타노스는 $S$를 구성하는 문자 중 절반의 0과 절반의 1을 제거하여 새로운 문자열 $S'$를 만들고자 한다. $S'$로 가능한 문자열 중 사전순으로 가장 빠른 것을 구하시오.

입력

문자열 $S$가 주어진다.

출력

$S'$로 가능한 문자열 중 사전순으로 가장 빠른 것을 출력한다.

제한

  • $S$의 길이는 $2$ 이상 $500$ 이하이다.
  • $S$는 짝수 개의 0과 짝수 개의 1로 이루어져 있다.

서브태스크 1 (25점)

  • $S$의 길이는 4의 배수이다.
  • $S$의 홀수 번째 문자는 1, 짝수 번째 문자는 0이다.

서브태스크 2 (75점)

추가적인 제약 조건이 없다.

예제 입력 1

1010

예제 출력 1

01

예제 입력 2

000011

예제 출력 2

001

이 예제는 서브태스크 1의 조건을 만족하지 않는다.

W3sicHJvYmxlbV9pZCI6IjIwMzEwIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVkMGMwXHViMTc4XHVjMmE0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1YjRcdWIyOTAgXHViMGEwLCBcdWQwYzBcdWIxNzhcdWMyYTRcdWIyOTQgMFx1YWNmYyAxXHViODVjIFx1Yzc3NFx1YjhlOFx1YzViNFx1YzljNCBcdWJiMzhcdWM3OTBcdWM1ZjQgJFMkXHViOTdjIFx1YmNmNFx1YzU1OFx1YjJlNC4gXHVjMmUwXHVhZTMwXHVkNTU4XHVhYzhjXHViM2M0LCAkUyRcdWFjMDAgXHVkM2VjXHVkNTY4XHVkNTU4XHViMjk0IDBcdWM3NTggXHVhYzFjXHVjMjE4XHVjNjQwICRTJFx1YWMwMCBcdWQzZWNcdWQ1NjhcdWQ1NThcdWIyOTQgMVx1Yzc1OC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