function Main(input){   
    let answer = '';
    input.split('').map(
        cur =>{
            if(cur==='?'){
                if(answer.match(/.*?D$/)){
                    return answer += 'P';
                }
                return answer += 'D';
            }
            return answer += cur;
        }
    )
    console.log(answer);
}