Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-ketma-ket-takrorlar

Remove consecutive duplicates

Easy 1000 ms 64 MB 27%
Share

A string $s$ is given. From every group of identical consecutive letters keep one (for example, aaabccddd becomes abcd). Print the resulting string.

A string: groups of equal letters, one letter left from each group

Input

One line containing the string $s$.

Output

The resulting string.

Note

$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters (a–z) only

Examples

Input #1
aaabccddd
Output #1
abcd
Input #2
abc
Output #2
abc

Sign in to submit a solution

Signing up is free and takes a minute.