s = gets.to_s.chars ans = [] of Char s.each do |c| if ans.empty? || ans[-1] != c ans << c end end puts ans.join