// Arup Guha
// 7/30/2026
// Solution to 1989 UCF HS Programming Contest Problem: All the Marbles

import java.util.*;

public class marbles {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		while (stdin.hasNext()) {
			
			// Get marbles.
			String list = stdin.next();
			
			// false is left, true is right.
			boolean[] switches = new boolean[3];
			
			// Store result here.
			char[] res = new char[list.length()];
			
			// Go through the marbles.
			for (int i=0; i<list.length(); i++) {
			
				// I default to C.
				boolean location = false;
				
				// Left side.
				if (list.charAt(i) == 'A') {
				
					// Goes right to middle switch.
					if (switches[0]) {
						location = switches[2];
						switches[2] = !switches[2];
					}
					
					// Safe to do this here.
					switches[0] = !switches[0];
				}
				else {
				
					// Default result for this side.
					location = true;
					
					// Goes to middle.
					if (!switches[1]) {
						location = switches[2];
						switches[2] = !switches[2];
					}
					
					// Safe to do this here.
					switches[1] = !switches[1];
				}
				
				// How we assign the letter.
				res[i] = location ? 'D' : 'C';
			
			} // end for.
			
			// Output the result.
			System.out.println(new String(res));
		}
	}
}