// Program 6: Remove Consecutive Repeated Characters import java.util.*; class RemoveRuns { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String word = sc.next(); String result = ""; for (int i = 0; i < word.length(); i++) { if (i == 0 || word.charAt(i) != word.charAt(i - 1)) { result += word.charAt(i); } } System.out.println(result); } }