#include <bits/stdc++.h>

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

using namespace std;


void autoinput()
{
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
}

#define ll long long
#define scan(x) scanf("%lld ",&x)
#define pb push_back
#define mp make_pair
#define make_edge(xx,yy) v[xx].pb(yy);v[yy].pb(xx)
#define dbg(a) cout << #a << ": " << a << endl
#define debug(a) dbg(a)
#define pp(a,b) push_back(make_pair(a,b))
#define ff first
#define ss second
#define tff get<0>
#define tss get<1>
#define ttt get<2>
#define mt make_tuple
#define eps 0.0000001
#define sz size()
ll MOD = 1000000007;
ll mod = 1000000007;
long double gammay = 0.5772156649015328606065120;

// tff(name) for tuple //


//PBDS
/*
tree<
ll,
null_type,
less<ll>,
rb_tree_tag,
tree_order_statistics_node_update> Data[40];
*/



/*
ordered_set X;
    X.insert(1);
    X.insert(2);
    X.insert(4);
    X.insert(8);
    X.insert(16);

    cout<<*X.find_by_order(1)<<endl; // 2
    cout<<*X.find_by_order(2)<<endl; // 4
    cout<<*X.find_by_order(4)<<endl; // 16
    cout<<(end(X)==X.find_by_order(6))<<endl; // true

    cout<<X.order_of_key(-5)<<endl;  // 0
    cout<<X.order_of_key(1)<<endl;   // 0
    cout<<X.order_of_key(3)<<endl;   // 2
    cout<<X.order_of_key(4)<<endl;   // 2
    cout<<X.order_of_key(400)<<endl; // 5
*/

 //priority_queue<int, vector<int>, std::greater<int> > first;
inline ll add(ll _a, ll _b){
    if(_a < 0){ _a += MOD; }
    if(_b < 0){ _b += MOD; }
    if(_a + _b >= MOD){ return _a + _b - MOD; }
    return _a + _b;
}
inline ll mul(ll _a, ll _b){
    if(_a < 0){ _a += MOD; }
    if(_b < 0){ _b += MOD; }
    return ((ll)((ll)_a * (ll)_b)) % MOD;
}

ll Set(ll N,ll pos){return N=N | (1<<pos);}
ll reset(ll N,ll pos){return N= N & ~(1<<pos);}
bool check(ll N,ll pos){return (bool)(N & (1<<pos));}
ll get_MSB_Pos(ll n){
    for(ll i = 60 ;;i--){
        if(check(n,i))
            return i;
    }
}

ll gcd(ll a, ll b)
{
    if(a<b)
        swap(a,b);
    if(b==0)
        return a;
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){

  return (a*b)/__gcd(a,b);
}

ll bigmod(ll N,ll P)
{
    if(P==0) return 1;
    if(P%2==0)
    {
        ll ret=bigmod(N,P/2);
        return ((ret%mod)*(ret%mod))%mod;
    }
    else return ((N%mod)*(bigmod(N,P-1)%mod))%mod;

}
bool isPrime(ll x)
{
    if(x<=1)
        return 0;
    if(x<=3)
        return 1;
    if(x%2==0)
        return 0;
    for(ll i = 3; i*i<=x;i+=2)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}

ll modInverse(ll a)
{
    return bigmod(a, MOD-2);
}
ll x,y;

ll func(ll n){
    ll a = n/2;
    if(n%2 == 0){
        return min(a*y , n*x);
    }
    return min(a*y+x, n*x);
}

int main()
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    #ifdef LOCAL
        autoinput();
    #endif
    ll i,j,k,l,m,n;
    string s;
    cin >> s;
    for(i=1;i<s.sz;i++){
        if(s[i]=='?' && s[i-1]=='P')
            s[i]='D';
    }

    for(i= s.sz-2; i>=0;i-- ){
        if(s[i]=='?' && s[i+1]=='D')
            s[i]='D';
    }
    for(i=0;i<s.sz;i++){
        if(s[i] == '?')
            s[i]='D';
    }
    cout << s << endl;

}

Measured memory_bytes: 3760