def solve(line) length = line.length harurun = line[0] (1...length).each do |i| next if line[i - 1] == line[i] harurun += line[i] end return harurun end line = gets.chomp puts solve(line)