#include <stdio.h>

int main(void){
    char input[256];
    char output[256];
    int i, flg;
    flg = 0;
    scanf("%s",&input);

    for (i = 0; input[i] != '\0'; i++){
        if (input[i] == 'P'){
            output[i] = 'P';
            flg = 1;
        }
        else if (input[i] =='D'){
            output[i] = 'D';
            flg = 0;
        }
        else{
            if (flg){
                output[i] = 'D';
                flg = 0;
            }
            else{
                output[i] = 'P';
                flg = 1;
            }

        }


    }

    output[i] = '\0';
    printf("%s",output);
}