function Main(str) {
  	str = str.split("");
    let count = 0;

  	str.forEach((s) => {
    	if(s === 'D') {
        	count++;
        }
    });
  	let foundP = false;
  	let foundPD = false;
	for(let i=0;i<str.length;i++) {
      	if(str[i] === 'P') {
        	foundP = true;
        }
      
      	if(str[i] === 'D' & str[i-1] === 'P') {
        	foundPD = true;
          	count++;
        }
      

      	if(str[i] === '?') {
        	if(!foundP) {
            	str[i] = 'P';
      
              	continue;
            }
          	if(count > 0 && count % 3 === 0) {
            	str[i] = 'P';
              	continue;
            }
          	
            str[i] = 'D';
          	count++;
          
          
        }
    	
    }
  	
  	console.log(str.join(""));
  	
}

let input = require('fs').readFileSync('/dev/stdin', 'utf8');
Main(input);
