Problem:
Score : 200 points

Problem Statement

For a string S consisting of the uppercase English letters P and D, let the doctoral and postdoctoral quotient of S be the total number of occurrences of D and PD in S as contiguous substrings. For example, if S = PPDDP, it contains two occurrences of D and one occurrence of PD as contiguous substrings, so the doctoral and postdoctoral quotient of S is 3.

We have a string T consisting of P, D, and ?.

Among the strings that can be obtained by replacing each ? in T with P or D, find one with the maximum possible doctoral and postdoctoral quotient.

Constraints

1 \leq |T| \leq 2 \times 10^5

T consists of P, D, and ?.

Input

Input is given from Standard Input in the following format:

T

Output

Print one string with the maximum possible doctoral and postdoctoral quotient among the strings that can be obtained by replacing each ? in T with P or D.
If there are multiple such strings, you may print any of them.

Sample Input 1

PD?D??P

Sample Output 1

PDPDPDP

This string contains three occurrences of D and three occurrences of PD as contiguous substrings, so its doctoral and postdoctoral quotient is 6, which is the maximum doctoral and postdoctoral quotient of a string obtained by replacing each ? in T with P or D.

Sample Input 2

P?P?

Sample Output 2

PDPD

Solution in C (GCC 9.2.1) (judge verdict: Runtime Error)

#include <assert.h>
#include <stdio.h>
#include <string.h>

/*
    文字列を置換する

    引数
        s: 置換対象の文字列。NULL不可
        before: 置き換える文字列。NULL不可。"" の場合は何もしない
        after: 置き換え後の文字列。NULL不可

    戻り値
        s を返す
*/
char* replace(char* s, const char* before, const char* after)
{
    assert(s != NULL);
    assert(before != NULL);
    assert(after != NULL);

    const size_t before_len = strlen(before);
    if (before_len == 0) {
        return s;
    }

    const size_t after_len = strlen(after);
    char* p = s;

    for (;;) {

        // 置換する文字列を探す
        p = strstr(p, before);
        if (p == NULL) {
            // 見つからなければ、これ以上置換するものはないので終了する
            break;
        }

        // 置換対象にならない位置を計算
        const char* p2 = p + before_len;

        // 置換対象にならない位置(p2) 以降の文字列を、
        // 置換の影響を受けない位置に移動
        memmove(p + after_len, p2, strlen(p2) + 1);

        // 置換する
        memcpy(p, after, after_len);

        // 探索開始位置をずらす
        p += after_len;
    }

    return 0;
}

int main(void) {
    char T[2*10^5];
    int re;
    re=scanf("%s",T);
    replace(T, "?", "D");
    printf("%s\n", T);
    
    return 0;
}