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 (Python):
T = [t for t in input()]
n = len(T)

dp = [[0]*2 for _ in range(n+1)]
ans = ''
for i in reversed(range(n)):
    if i == n-1:
        if T[i] == 'D':
            dp[i]=[1,1]
            ans = T[i] + ans
        elif T[i] == '?':
            dp[i][0] = 1
            ans='D'+ans
        else:
            ans = 'P'+ans
    else:
        if T[i] == '?':
            dp[i][0] = max(dp[i+1])+1
            dp[i][1] = dp[i+1][0]+1
            if dp[i][0] < dp[i][1]:
                ans = 'P'+ans
            else:
                ans='D'+ans
        elif T[i] == 'D':
            dp[i] = [dp[i+1][0]+1,dp[i+1][1]+1]
            ans = T[i] + ans
        else:
            if T[i+1] == 'D':
                dp[i] = [dp[i+1][0]+1,dp[i+1][1]+1]
            ans = T[i] + ans

print(ans)

Solution (Python):
T = input()
T = T.replace("?", "D")
print(T)

Solution (Python):
def main():
    T = input()
    print(T.replace('?','D'))



if __name__ == "__main__":
    main()

Solution (Python):
T = input()
print(T.replace("?","D"))

Solution (Python):
T = input()
t = list(T)
n = t.count("?")
l = int(len(t))
for i in range(l) :
    if t[i] == "?" :
        t[i] = "D"

s1 = ''.join(t)

print(s1)

Solution (Python):
t = list(input())

for i in range(len(t)):
    if t[i]=='?':
        t[i]= 'D'
print("".join(t))

Solution (Python):
t = list(input())
for i in range(len(t)):
    if t[i]=="?":
        if i==0 and len(t)!=1:
            if t[i+1]=="D" or t[i+1]=="?":
                t[i] = "P"
                t[i+1] = "D"
            else:
                t[i] = "D"
        elif i!=len(t)-1:
            if t[i-1]=="P":
                t[i] = "D"
            elif t[i+1]=="D" or t[i+1]=="?":
                t[i] = "P"
                t[i+1] = "D"
            else:
                t[i] = "D"
        else:
            t[i] = "D"
print(*t,sep="")

Solution (Python):
t=list(input())
pre_p=False
for i,tt in enumerate(t):
  if tt == 'P':
    pre_p=True
  elif tt == 'D':
    pre_p=False
  elif pre_p:
    t[i] = 'D'
  elif i < len(t)-1:
    if t[i+1] == 'D':
      t[i] = 'P'
    else:
      t[i] = 'D'
  else:
    t[i] = 'D'
    
print(''.join(t))

Solution (Python):
s = input()
print(s.replace('?', 'D'))

Solution (Python):
t = list(input())
for i in range(len(t)):
  if t[i]=='?':
    if i==0:
      t[i]='?'
    if t[i-1]=='P':
      t[i]='D'
    else:
      t[i]='D'
      

print(''.join(t))

Solution (Python):
T = input()
T = list(T)
To = ""
for t in T:
  if t == "?":
    t = "D"
  To = To + t
print(To)

Solution (Python):
t = [i for i in input()]
t.reverse


if t[0] == '?':
    t[0] = 'D'

for i in range(1, len(t)):
    if t[i] == '?':
        t[i] = 'D'
        
        
        
        

t.reverse
o = ''.join(t)

print(o)

Solution (Python):
t = input()
print(t.replace("?", "D"))

Solution (Python):
t=input().split("?")
mae=t[0]
ans=t[0]
for i in t[1:]:
    ans=ans+"D"+i

print(ans)

Solution (Python):
t = str(input())
print(t.replace('?', 'D'))

Solution (Python):
l = input()
l_replace = [s.replace('?', 'D') for s in l]
text = ''.join(l_replace)
print(text)

Solution (Python):
T=str(input())
result=T.replace('?','D')
print(result)

Solution (Python):
s = input()
print(s.replace('?', 'D'))

Solution (Python):
t = input()

print(t.replace('?', 'D'))

Solution (Python):
t = input()
most = 0
count = 0
before = 0
t  =t.replace("?","D")
print(t)

Solution (Python):
t = input()

ans = t.replace("?", "D")
print(ans)

Solution (Python):
t=input()
print(t.replace('?','D'))

Solution (Python):
t = input()


ans = ""
for ti in t:

    if ti == "?":
        ti = "D"
    ans = ans + ti

print( ans )

Solution (Python):
T = input()
print(T.replace('?', 'D'))

Solution (Python):
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    T = list(input().strip())
    p = 'P'
    for i, t in enumerate(T):
        if t == '?':
            T[i] = 'D'
    print(''.join(T))

if __name__ == '__main__':
    main()

Solution (Python):
T = input()
l = len(T)


print(T.replace('?','D'))

Solution (Python):
t = input()

print(t.replace("?", "D"))

Solution (Python):
T = list(input())

for i in range(len(T)):
	if T[i] == '?':
		T[i] = 'D'

print(''.join(T))

Solution (Python):
T = input()

print(T.replace('?', 'D'))

Solution (Python):
t = input()

t = t.replace('?','D')
        
print(t)

Solution (Python):


t = list(str(input()))

t_new = []
for i in t:
    if i == "?":
        t_new.append("D")
    else:
        t_new.append(i)

for i in t_new:
    print(i, end="")

Solution (Python):
T=input()
u=T.translate(str.maketrans({'?': 'D'}))
print(u)

Solution (Python):
print(input().replace('?', 'D'))

Solution (Python):
t = input()      

print(t.replace('?','D'))

Solution (Python):
def cal(T):
    T = list(T)
    for i in range(len(T)-1):
        if T[i] == "P" and T[i+1] == "?":
            T[i+1] = "D"
        if T[i] == "?" and T[i+1] == "D":
            T[i] = "P"
    for i in range(len(T)-1):
        if T[i] == "?" and T[i+1] == "?":
            T[i],T[i+1] = "P","D"
    for i in range(len(T)):
        if T[i] == "?":
            T[i] = "D"
    T = "".join(T)
    return T

def main():
    T = input()

    print(cal(T))

if __name__ == "__main__":
    main()

Solution (Python):
t = input()

l = ["" for i in range(len(t))]
for i in range(0, len(t)):
    if t[i] =="?":
        l[i] = "D"
    
    else:
        l[i] = t[i]

print("".join(l))

Solution (Python):
docs = [str(i) for i in input()]
res = [sub.replace('?', 'D') for sub in docs]
print(''.join(res))

Solution (Python):
if __name__ == "__main__":
    T = input().replace("?","D")
    print(T)

Solution (Python):
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

s = ns().replace('?', 'D')
ans = s.count('D')
for i in range(len(s)-1):
    if s[i:i+2] == 'PD':
        ans += 1
print(s)

Solution (Python):
T =  list(input())

for i in range(len(T)) :
    if (i == 0 or i == len(T) - 1) and T[i] == '?' :
        T[i] = 'D'
    
    if T[i] == '?' :
        if T[i - 1] == 'P' :
            T[i] = 'D'
        elif T[i + 1] == 'D' or T[i + 1] == '?' :
            T[i] = 'P'
        else :
            T[i] = 'D'
            
    print(T[i], end = '')

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    T = input()

    T = T.replace('?', 'D')
    print(T)


main()

Solution (Python):
T = input()
ans = str()

for i in range(len(T)):
    if T[i]  == '?':
        ans += 'D'
    else:
        ans += T[i]        

print(ans)

Solution (Python):
T = list(input())

if T[0] == '?':
    T[0] = 'D'

for i in range(1, len(T)):
    if T[i] == '?':
        T[i] = 'D'

print("".join(T))

Solution (Python):
t = input()

from collections import deque

d = deque(list(t))
l = []
k_0 = "X"

for i in range(len(t)):
    k = d.popleft()
    if k != "?":
        l.append(k)
        k_0 = k
    else:
        l.append("D")
        k_0 = "D"

print("".join(l))

Solution (Python):
t = input()

s = t.replace("?", "D")

print(s, end="")

Solution (Python):
if __name__ == "__main__":
    T = input()
    print(T.replace('?','D'))

Solution (Python):
t = input()
print(t.replace('?','D'))

Solution (Python):
t=list(str(input()))

for i in range(len(t)):
    if t[i]=="?":
        
        t[i]="D"
    print(t[i],end="")

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
import numpy as np
from heapq import heapify, heappop, heappush
import copy
from math import gcd, ceil
from collections import deque

from bisect import bisect_left, bisect_right









def main():
    S = input()
    if len(S) == 1 and S == '?':
        print('D')
        sys.exit()
    i = 0
    S = list(S)
    while i < len(S):
        if S[i] == '?':
            if i == 0:
                if S[1] == '?':
                    S[0] = 'P'
                    S[1] = 'D'
                    i = 2
                    continue
                elif S[1] == 'D':
                    S[0] = 'P'
                    i = 2
                    continue
                else:
                    S[0] = 'D'
                    i = 2
                    continue
            else:
                if i + 1 == len(S):
                    S[i] = 'D'
                    i += 1
                    continue
                elif S[i - 1] == 'P':
                    S[i] = 'D'
                    i += 1
                    continue
                elif S[i + 1] == '?':
                    S[i] = 'P'
                    S[i + 1] = 'D'
                    i = i + 2
                    continue
                elif S[i + 1] == 'D':
                    S[i] = 'P'
                    i += 1
                    continue
                else:
                    S[i] = 'D'
                    i += 1
        else:
            i += 1
    print(''.join(S))
            

if __name__ == '__main__':
    main()

Solution (Python):
n = input()
ans = ""
for i in range(len(n)):
  if n[i] == "P":
    A = "P"
  else:
    A = "D"
  ans = ans + A
print(ans)

Solution (Python):
t=input()

t=t.replace("?","D")
print(t)

Solution (Python):
T=input()

res = ""
for i in range(len(T)) :
    if (T[i] != "?") :
        res += T[i]
        continue
    res += "D"

    
    
    
    
    

print(res)

Solution (Python):
t = input()

print(t.replace("?", "D"))

Solution (Python):
T = input()
A = ''
for i in T:
    if i == '?':
        A += 'D'
    else:
        A += i
print(A)

Solution (Python):
T = list(input())
TD = [x if x == 'P' or x == 'D' else 'D' for x in T]

print(''.join(TD))

Solution (Python):
def resolve():
    import sys
    input = sys.stdin.readline
    
    n = input()
    
    
    
    
    
    
    
    

    
    
    
    
    
    

    N = list(n)
    for i in range(len(N)):
        if N[i] == "?":
            N[i] = "D"

    print("".join(N))

resolve()

Solution (Python):
S = list(input())
ans = [0]*len(S)
for i in range(len(S)):
    if S[i] == "?":
        ans[i] = "D"
    else:
        ans[i] = S[i]
S1 = "".join(ans)
print(S1)

Solution (Python):
A = input()
print(A.replace('?','D'))

Solution (Python):
t = input()
print(t.replace("?", "D"))

Solution (Python):
def main():
    t = input()
    n = len(t)
    ans = ""
    for i in range(n):
        if t[i] == "?":
            ans += "D"
        else:
            ans += t[i]
    print(ans)


main()

Solution (Python):
t = input()

tmp = t.replace('?', 'D')
print(tmp)

Solution (Python):
T = input()
ans = T.replace("?", "D")

print(ans)

Solution (Python):
S = str(input())
v_list = list()



SS = S.replace("?", "D")
print(SS)

Solution (Python):
t = input()
ans = ""

for i in range(len(t)):
    if t[i:i+1] == "?":
        ans += "D"
    else:
        ans += t[i:i+1]

print(ans)

Solution (Python):
a=str(input())
a=a.replace('?', 'D')
print(a)

Solution (Python):
def solve():
  string = list(input())
  for i, ch in enumerate(string):
    if ch == "?":
      string[i] = "D"

  return ''.join(string)

print(solve())

Solution (Python):
T = input()

t = ""
for i in range(len(T)):
    if (T[i] == "?"):
        t += "D"
    else:
        t += T[i]
    

print(t)

Solution (Python):
S=input()
ans=[]
ini_p=True
for x in S:
  _return=x
  if x=='?':
    _return='D'
  ans.append(_return)
  
strs=''.join(ans)
print(strs)

Solution (Python):
T = input()
s = T.replace("?","D")
print(s)

Solution (Python):
T = input()

T =T.replace('?', 'D')
print(T)

Solution (Python):
t = list(input())

for i in range(len(t)):
  if t[i] == "?":
    t[i] = "D"

print("".join(t))

Solution (Python):
pd = input()
new = ""

for s in pd:
  if s == "?":
    new += "D"
  else:
    new += s
      
print(new)

Solution (Python):
t = list(input())
for i in range(len(t)):
    if t[i] == "?":
        t[i] = "D"
print("".join(t))

Solution (Python):
def read_str():
    return input()

def main():
    print(read_str().replace('?', 'D'))

if __name__ == '__main__':
    main()

Solution (Python):
T = str(input())

print(T.replace("?","D"))

Solution (Python):
T = list(input())
for i in range(len(T)):
    if T[i] == "?":
        T[i] = "D"
    else:
        pass


print("".join(T))

Solution (Python):
t=input()
qn=t.count("?")
print(t.replace("?", "D"))

Solution (Python):
t = input()
ans = ''

for i in range(len(t)):
    if t[i] == '?':
        ans += 'D'
    else:
        ans += t[i]

print(ans)

Solution (Python):
T = input()
ans = []
for i in range(len(T)):
    if T[i] == "?":
        ans.append("D")
    else:
        ans.append(T[i])
print(*ans,sep="")

Solution (Python):
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
import itertools
import math



input = sys.stdin.readline

T = input()

print(T.replace("?", "D"))

Solution (Python):
T = input()
ans =""
for i in range(len(T)):
  if T[i:i+1]=='?':
    ans = ans + 'D'
  else:
    ans = ans + T[i:i+1]

print(ans)

Solution (Python):
line=input()
b=[]
for a in line:
  if a=="?":
    b.append("D")
  else:
    b.append(a)
for i in range(len(b)):
  print(b[i],end="")

Solution (Python):
T = input()

print(T.replace("?", "D"))

Solution (Python):
t = list(input())
for i in range(len(t)):
    if t[i] == "?":
        t[i] = "D"

print("".join(t))

Solution (Python):
T = list(input())
if len(T) == 1:
  if T[0] == "?":
    print("D")
  else:
    print("".join(T))
else:
  for i in range(len(T)):
    if i > 0 and T[i] == "?" and T[i-1] == "P":
      T[i] = "D"
    elif i < len(T) -1 and T[i] == "?" and (T[i+1] == "D" or T[i+1] == "?"):
      T[i] = "P"
    elif T[i] == "?":
      T[i] = "D"
  print("".join(T))

Solution (Python):
T = input()
print(T.replace('?', 'D'))

Solution (Python):
t = input()
ts = t.replace('?', 'D')
print(ts)

Solution (Python):
T = input()
ans = []
for i in range(len(T)):
    if T[i] == "?":
        ans.append("D")
    else:
        ans.append(T[i])
print(*ans,sep="")

Solution (Python):
s=input()
print(s.replace("?","D"))

Solution (Python):
T = list(input())
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
print(''.join(T))

Solution (Python):
T=input()

print(T.replace('?', 'D'))

Solution (Python):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

T = rs()

A = list(T)
l = len(A)

for i, c in enumerate(A):
	if c == '?':
		A[i] = 'D'
print(''.join(A))

Solution (Python):
T = list(str(input()))
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
print(''.join(T))

Solution (Python):
T=input()
res=''
for i in T:
  if i=='?':
    res=res+'D'
  else:
    res=res+i
print(res)

Solution (Python):
t = input()
print(t.replace("?", "D"))

Solution (Python):
print(input().replace("?","D"))

Solution (Python):
t=list(input())
for i in range(len(t)):
  if t[i]=='?':
    t[i]='D'
   
print(''.join(t))

Solution (Python):
s=input()
s=s.replace('?','D')
print(s)

Solution (Python):
t = input()

t = t.replace("?", "D")

print(t)

Solution (Python):



def main():
    T = list(input())
    N = len(T)
    i = 0
    while i < N:
        if T[i] == '?':
            if i == 0 or i == N-1:
                T[i] = 'D'
                i += 1
            elif T[i-1] == 'D':
                if T[i+1] == '?':
                    T[i] = 'P'
                    T[i+1] = 'D'
                    i += 2
                elif T[i+1] == 'D':
                    T[i] = 'P'
                    i += 1
                else:
                    T[i] = 'D'
                    i += 1
            else:
                T[i] = 'D'
                i += 1
        else:
            i += 1
    U = ''.join(T)
    print(U)

if __name__ == "__main__":
    main()

Solution (Python):
s = list(input())

A = []

for i in s:
    if i == '?':
        A.append('D')
    else:
        A.append(i)
print("".join(A))

Solution (Python):
t=input()
print(t.replace("?","D"))

Solution (Python):
print(input().replace("?","D"))

Solution (Python):
t = list(input())
if t[0] == "?":
    t[0] = "D"
for i in range(1, len(t)):
    if t[i] == "?":
        t[i] = "D"
t2 = "".join(t)
print(t2)

Solution (Python):
T = input()
S = ""
for c in T:
    if c == '?':
        S += 'D'
    else:
        S += c

print(S)

Solution (Python):
s = list(input())

A = []

for i in s:
    if i == '?':
        A.append('D')
    else:
        A.append(i)
print("".join(A))

Solution (Python):

T = list(input())

for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
        
t = ''
for i in range(len(T)):
    t += T[i]
    
print(t)

Solution (Python):
t = input()
print(t.replace("?", "D"))

Solution (Python):
T = str(input())
ans = ""
for i in range(len(T)):
  if T[i] == "?":
    ans = ans + "D"
  else:
    ans = ans + T[i]
print(ans)

Solution (Python):
def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    T = list(input())
    
    for i in range(len(T)):
        if T[i] == '?':
            T[i] = 'D'


    print(''.join(T)) 


    
main()

Solution (Python):
T = input()

s = list(T)
for i, x in enumerate(T):
  if x == "?":
    s[i] = "D"


count = 0
flag = False
for x in s:
  if x == "P":
    flag = True
  
  if x == "D":
    count += 1
    if flag:
      count += 1
      flag = False

print("".join(s))

Solution (Python):
t = input()
a = []
for i in range(len(t)):
    if t[i] == '?':
        a.append('D')
    else:
        a.append(t[i])
print(''.join(a))

Solution (Python):
t = str(input())
res = ""
a = ""

for i in range(len(t)):
    if t[i] == "?":
        a = "D"
    else:
        a = t[i]
    res = res + a

print(res)

Solution (Python):
T=input()
cnt=[]
for i in range(len(T)):
    if T[i]!='?':
        cnt.append(T[i])
    else:
        cnt.append('D')
cnt=''.join(cnt)
print(cnt)

Solution (Python):
T = input()
print(T.replace('?','D'))

Solution (Python):



x=input()
l=list(x)
c=0
for i in range(len(l)):
	if l[i]=='?':
		if i-1<0:
			if i+1<len(l):
				if l[i+1]=='D':
					l[i]='P'
				elif l[i+1]=='?':
					l[i]='P'
				else:
					l[i]='D'
			else:
				l[i]='D'
		elif l[i-1]=='P':
			l[i]='D'
		elif i+1<len(l):
			if l[i+1]=='D':
				l[i]='P'
			elif l[i+1]=='?':
				l[i]='P'
			else:
				l[i]='D'
		else:
			l[i]='D'
print(''.join(l))

Solution (Python):
import numpy as np

o = input()
l=[]
for i in range(len(o)):
    l.append(o[i])

for i in range(len(l)):
    if l[i]=="?":
        l[i]="D"
for i in range(len(l)):
    if i==len(l)-1:
        print(l[i])
        exit()
    else:
        print(l[i],end="")

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    t=list(input())
    n=len(t)
    for i in range(n):
        if t[i]=='?':
            t[i]='D'
    print(''.join(t))

resolve()

Solution (Python):
s=input()
ll=list(s.split("?"))
l=[]
cnt=0
for i in range(len(s)):
  if s[i]=="?":
    c=""
    if i+1<len(s):
      if s[i+1]=="D":
        c="P"
    if i>0:
      if s[i-1]=="P":
        c="D"
    if c=="":
      c="D"
    l.append(ll[cnt])
    l.append(c)
    cnt+=1
l.append(ll[-1])
print("".join(l))

Solution (Python):
line=input()
print(line.replace('?', 'D'))

Solution (Python):
t=input()

t=t.replace('?', 'D')

print(t)

Solution (Python):
S = input().replace("?","D")
print(S)

Solution (Python):
T = input()
print(T.replace('?', 'D'))

Solution (Python):
t = list(input())
n= len(t)
for i in range(n):
    if t[i] == "?":
      t[i] = "D"
print(''.join(t))

Solution (Python):
s=list(input())
for i in range(len(s)):
    if s[i] == "?":
        s[i] = "D"

l = ""
for i in s:
    l += i
t = l.count('D')
t += l.count('PD')

print(l)

Solution (Python):
T = input()
print(T.replace('?','D'))

Solution (Python):
def main():
    s = list(input())
    now = 0
    for i in range(len(s)):
        if s[i] == '?':
            if i == 0 or s[i-1] == 'P' or s[i-1] == '?':
                s[i] = 'D'
                continue
            if i+1 < len(s)  and( s[i+1] == 'D' or s[i+1] == '?'):
                s[i] ='P'
                continue
            s[i] = 'D'
    print(''.join(s))

if __name__=='__main__':
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

T = input()

c = Counter(T)
h = c["?"]
d = c["D"] + h
B = ""
for t in T:
    if t == "?":
        B += "D"
    else:
        B += t
print(B)

Solution (Python):
t = input()

prev = ""
res = []
for i, x in enumerate(t):
    if x == "?":
        if prev == "" and len(t) == 1:
            res.append("D")
        elif prev == "" and (i < len(t) - 1 and t[i+1] == "P"):
            res.append("D")
        elif prev == "" or prev == "D" and (i < len(t) - 1 and t[i+1] != "P"):
            res.append("P")
        else:
            res.append("D")
    else:
        res.append(x)
    prev = res[-1]
print("".join(res))

Solution (Python):
T = input()


print(T.replace("?", "D"))

Solution (Python):
s=str(input())
print(s.replace('?', 'D'))

Solution (Python):
t = input()
t = t.replace('?','D')
print(t)

Solution (Python):






t=list(input())
n=len(t)
m=""
for i in range(n):
    if t[i]=="?":
        m+="D"
    else:
        m+=t[i]
print(m)

Solution (Python):
t= list(input())
n=len(t)

words = []












for i in range(n):
    if i==0:
        if t[i]=='?':
            words.append('D')
        else:
            words.append(t[i])
    else:
        if t[i]=='?':
            if t[i-1]=='D':
                words.append('D')
            elif t[i-1]=='P':
                words.append('D')
            elif t[i-1]=='?':
                words.append('D')
        else:
            words.append(t[i])


ans = ''.join(t)  
ans1 = ''.join(words)


print(ans1)

Solution (Python):








S= str(input())
S=list(S)
if S[-1]=='?':
    S[-1]='D'

for i in reversed(range(len(S)-1)):
    if S[i]=='?':
        S[i]='D'
print(''.join(S))

Solution (Python):
H = input()
print(H.replace('?', 'D'))

Solution (Python):
t = list(input())

for i in range(len(t)):
    if t[i] == '?':
        t[i] = 'D'
print(''.join(t))

Solution (Python):
N = list(input())
for i,a in enumerate(N):
    if a == "?":
        N[i] = "D"
print(''.join(N[0:len(N)]))

Solution (Python):
s = input()

n = len(s)
ans = []
for i in range(n):
    if s[i] != '?':
        ans.append(s[i])
    else:
        ans.append('D')
            
print(*ans,sep = '')

Solution (Python):
t=input()
ans=str()
for c in t:
    if c=="?":
        ans+="D"
    else:
        ans+=c
print(ans)

Solution (Python):
def main():
    T = input()
    ans = T.replace('?', 'D')
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
chars = list(input())
for i in range(len(chars)):
  if  chars[i] == "?":
    chars[i] = "D"
print("".join(chars))

Solution (Python):
T = input()

s = list(T)
for i, x in enumerate(T):
  if x == "?":
    s[i] = "D"


count = 0
flag = False
for x in s:
  if x == "P":
    flag = True
  
  if x == "D":
    count += 1
    if flag:
      count += 1
      flag = False

print("".join(s))

Solution (Python):
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

T = input()

n = len(T)

ans = []
for i in range(n):
    if T[i] == "?":
        ans.append("D")
    else:
        ans.append(T[i])

print("".join(ans))

Solution (Python):
print(input().replace("?","D"))

Solution (Python):
T=str(input())
ans=""
pre=False
for i in range(len(T)):
    if T[i]=="D":
        ans+=T[i]
        pre=False
    elif T[i]=="P":
        ans+=T[i]
        pre=True
    else:
        if pre==True:
            ans+="D"
            pre=False
        else:
            ans+="D"
print(ans)

Solution (Python):
S = input()
print(S.replace("?","D"))

Solution (Python):

T = input().strip()
print(T.replace("?", "D"))

Solution (Python):
T = input()
print(T.replace('?','D'))

Solution (Python):
T=input()
S=T.replace("?","D")
print(S)

Solution (Python):
T = input()

print(T.replace('?', 'D'))

Solution (Python):
T = input()
rep = str(T).replace("?","D")
print(rep)

Solution (Python):
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


T = input()

ans = list()
for i, c in enumerate(T):
    if c == '?':
        if len(ans) > 0 and ans[-1] == 'D' and i < len(T) - 1 and T[i + 1] in '?D':
            ans.append('P')
        else:
            ans.append('D')
    else:
        ans.append(c)
print(''.join(ans))

Solution (Python):
T = list(input())
ans = []
for i in range(len(T)):
    if(T[i]=='?'):
        print('D',end="")
    else:
        print(T[i],end="")
print()

Solution (Python):
T = input()

sample = ''
for t in T:
    if t == '?':
        sample += 'D'
    else:
        sample += t

print(sample)

Solution (Python):
T = list(input())
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
T = ''.join(T)
print(T)

Solution (Python):
print(input().replace("?","D"))

Solution (Python):
import math
import sys
input = sys.stdin.readline

s = input().strip()
ans = []
for i in s:
	if i == '?':
		ans.append('D')
	else:
		ans.append(i)
print(''.join(ans))

Solution (Python):
a = str(input())
ans = ""
for i in a :
  if i == "?" :
    ans = ans + "D"
  else :
    ans = ans + i
    
print(ans)

Solution (Python):
s = input()
s = s.replace("?","D")
print(s)

Solution (Python):
T = input()

ans = T.replace('?', 'D')

print(ans)

Solution (Python):
s = input()

for i in range(len(s)):
    if s[i] == "?":
        print("D",end="")
    else:
        print(s[i],end="")

Solution (Python):
T = input()


T1 =T.replace('?', 'D')
print(T1)

Solution (Python):
t=list(input())
ans=0
for i in range(len(t)):
    if t[i]=="?":
        t[i]="D"
print(*t,sep="")

Solution (Python):
print(input().replace('?','D'))

Solution (Python):
t=input()
s=t.replace('?','D')
print(s)

Solution (Python):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy




def main():
    T = input()
    result = []
    bef = ""
    for i in range(len(T)-1):
        if T[i] == "?":
            if bef == "P":
                result.append("D")
            elif T[i+1] == "?" or T[i+1] == "D":
                result.append("P")
            else:
                result.append("D")
        else:
            result.append(T[i])
        bef = result[-1]
    if T[-1] == "?":
        result.append("D")
    else:
        result.append(T[-1])
    print("".join(result))

if __name__ == '__main__':
    main()

Solution (Python):
T = list(input())

ans = 0
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
print(''.join(T))

Solution (Python):
a=list(input())
ans=0
for i in range(len(a)):
  if a[i]=='?':
    a[i]='D'
for i in range(len(a)):
    print(a[i],end='')

Solution (Python):
T=list(input())
N=len(T)
for i in range(N):
  if T[i]=="?":
    T[i]="D"
ans="".join(T)    
print(ans)

Solution (Python):
t = input()
n = len(t)
ans = []
for i in range(n):
    if t[i] != "?":
        ans.append(t[i])
    else:
        ans.append("D")
print("".join(ans))

Solution (Python):
T = input()
print(T.replace('?', 'D'))

Solution (Python):
s=input()
l=[]
for i in s:
  if i=='?':
    l.append('D')
  else:
    l.append(i)
print(''.join(l))

Solution (Python):
t = list(input())

for i in range(len(t)):
    if t[i]=="?":
        t[i]="D"
count = 0
for i in range(len(t)-1):
    if t[i]=="P" and t[i+1]=="D":
        count +=1
    elif t[i]=="D":
        count +=1
print("".join(t))

Solution (Python):
T=input()
T=list(T)
for i in range(len(T)):
    if T[i]=="?":
        T[i]="D"
print("".join(T))

Solution (Python):
T = input()
print(T.replace('?', 'D'))

Solution (Python):
T = [*input()]
t = []
for i in T:
    if i == "?":
        t.append("D")
    else:
        t.append(i)
print("".join(t))

Solution (Python):
T = input()
print(T.replace("?","D"))

Solution (Python):
t = input()

n = len(t)

ans = ''

for i in range(n):
    if t[i] == '?':
        ans += 'D'
    else:
        ans += t[i]


print(ans)

Solution (Python):
S = list(input())
for i in range(len(S)):
    if S[i] =='?':
        S[i] = 'D'
print(''.join(S))

Solution (Python):
T = input()
print(T.replace('?','D'))

Solution (Python):
s = list(input())
for i, si in enumerate(s):
    if si == "?":
        s[i] = "D"
print("".join(s))

Solution (Python):
if __name__ == "__main__":
    s = input()

    print(s.replace('?', 'D'))

Solution (Python):
char = input()
print(char.replace("?", "D"))

Solution (Python):
print(input().replace('?','D'))

Solution (Python):
T = input()
print(T.translate(str.maketrans({'?': 'D'})))

Solution (Python):
t = input()

print(t.replace("?", "D"))

Solution (Python):
T = input()

print(T.replace('?','D'))

Solution (Python):
t=input()
print(t.replace("?","D"))

Solution (Python):
T = input()
T = list(T)

for i in range(len(T)):
    if T[i] == "?":
        T[i] = "D"

print(*T, sep="")