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=list(input())
N=len(T)
i=0
while i<N-1:
    if i<N-2:
        if T[i]=="D":
            if (T[i+1]=="?")and((T[i+2]=="?")or(T[i+2]=="D")):
                T[i+1]="P"
                T[i+2]="D"
                i=i+2
            elif (T[i+1]=="?"):
                T[i+1]="D"
                i=i+1
            else:
                i=i+1
        elif T[i]=="P":
            if (T[i+1]=="?"):
                T[i+1]="D"
                i=i+1
            else:
                i=i+1
        else:
            if T[i+1]=="P":
                T[i]="D"
                i=i+1
            else:
                T[i]="P"
                T[i+1]="D"
                i=i+1
    if i==N-2:
        if T[i]=="?":
            if (T[i+1]=="D")or(T[i+1]=="?"):
                T[i]="P"
                T[i+1]="D"
                i=i+1
            else:
                T[i]="D"
                i=i+1
        elif T[i+1]=="?":
            T[i+1]="D"
            i=i+1
        else:
            i=i+1
    
    
if (len(T)==1)and(T[0]=="?"):
    T[0]="D"
print("".join(T))

Solution (Python):
a= input()
c=""
for i in range(0, len(a)):
    if a[i]=="?":
        c=c+"D"
    else:
        c=c+a[i]
print(c)

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

Solution (Python):
import sys
from collections import Counter
from collections import deque
import heapq
import math
import fractions
import bisect
import itertools
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))


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

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

Solution (Python):









def solve():
    T = input()
    S = T.replace('?', 'D')

    return S


def main():
    print(solve())


if __name__ == "__main__":
    main()

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

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

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

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

print(ans)

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    s = S()

    return s.replace("?", "D")

print(main())

Solution (Python):
T = input()
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()
t = t.replace("?","D")
print(t)

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


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

print(t)

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

Solution (Python):
s = input()
res = "" 

for i in range(len(s)):
  if s[i]!="?":
    res += s[i]
  else:
    res+="D"
print(res)

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

Solution (Python):
from sys import stdin
def S(): return stdin.readline().rstrip()

t = S()

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

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

ans = []

for i in s:
  if i == '?':
    ans.append('D')
  else:
    ans.append(i)

print(''.join(map(str,ans)))

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

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

Solution (Python):
print((open(0).read().replace('?','D')))

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

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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    t=list(readline().strip())
    for i in range(len(t)):
        if t[i]=="?":
            t[i]="D"
    
    print("".join(t))

if __name__=="__main__":
    main()

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

Solution (Python):
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case 


def solve(t):
    return t.replace("?", "D")


if __name__ == "__main__":
    out(solve(str_in()))

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

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

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

if __name__ == "__main__":
    main()

Solution (Python):
T = input()

l = []
for i in range(len(T)):
    if T[i] == 'P':
        l.append('P')
    else:
        l.append('D')
ans = ''.join(l)
print(ans)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
from math import floor,ceil,sqrt,factorial,log
from heapq import heapify, heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from decimal import Decimal
inf = float('inf')
mod = 1000000007

t = list(input())

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

print(''.join(t))

Solution (Python):

from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    
    check=[False for _ in range(n)]
    check[s]=True
    
    queue=deque([s])
    visited_num=1

    
    
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        
        if len(queue)==0:
            
            
            return color

        now_vertex=queue.popleft()
        
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color




ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))







s=input()
ans=0
s=[i if i!="?" else "D" for i in s]
print("".join(s))

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

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

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

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

Solution (Python):


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

Solution (Python):


T = list(input())

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

print(''.join(T))

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

count = len(string)
summary = 0

for i in range(count):
    if string[i]=="?":
        string[i]="D"


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

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

Solution (Python):
t = input()

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

print(t)

Solution (Python):
T = input()

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

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

Solution (Python):
S = input()

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

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

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

Solution (Python):
def solve():
    T = input()
    ans = ""
    for i in range(len(T)):
        if T[i] == "?":
            ans += "D"
        else:
            ans += T[i]
    
    print(ans)
            
if __name__ == '__main__':
    solve()

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

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

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


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

print(*T, sep="")

Solution (Python):
T = input() + "E"
ans = "S"

for i in range(len(T)-1):
    if T[i] == "?":
        if ans[i] == "P":
            ans += "D"
        else:
            if T[i+1] == "P" or T[i+1] == "E":
                ans += "D"
            else:
                ans += "P"
    else:
        ans += T[i]        
    
print(ans[1:])

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

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

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

Solution (Python):
X = input()
ans = []

for i in range(len(X)):
    if X[i] == '?':
        ans.append('D')
    else:
        ans.append(X[i])

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

Solution (Python):
print(input().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(t[i],end='')

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

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

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

Solution (Python):
p=list(input())
ans=''
for i in p:
    if i=='P':
        ans+='P'
    else:
        ans+='D'
print(ans)

Solution (Python):
def post_pd(t):
    string_list = ''
    for i in t:
        if i == '?':
            string_list = string_list + 'D'
        else:
            string_list = string_list + i
    
    return string_list

if __name__ == '__main__':
    t = input()
    print(post_pd(t))

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

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

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

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

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

T = "".join(S)

print(T)

Solution (Python):
T = input()










ans = []
for t in T:
    if t == '?':
        ans.append('D')
    else:
        ans.append(t)
print(''.join(ans))

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

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

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

Solution (Python):
import re
print(re.sub(r"\?","D",input()))

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    T = list(input().rstrip())
    ans = ["D" if c == "?" else c for c in T]
    print("".join(ans))
if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    S = readline().strip()

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

    print(S)


if __name__ == "__main__":
    main()

Solution (Python):
def solve():
    INF = float('inf')
    P = 0
    D = 1

    Ts = input().rstrip()

    N = len(Ts)

    dp = [[-INF]*(2) for _ in range(N+1)]
    dp[0][D] = 0
    prevss = [[-1]*(2) for _ in range(N+1)]
    for i, T in enumerate(Ts, start=1):
        if T == 'P' or T == '?':
            dpP = dp[i-1][P]
            dpD = dp[i-1][D]
            if dpP >= dpD:
                dp[i][P] = dpP
                prevss[i][P] = P
            else:
                dp[i][P] = dpD
                prevss[i][P] = D
        if T == 'D' or T == '?':
            dpP = dp[i-1][P] + 2
            dpD = dp[i-1][D] + 1
            if dpP >= dpD:
                dp[i][D] = dpP
                prevss[i][D] = P
            else:
                dp[i][D] = dpD
                prevss[i][D] = D

    
    

    if dp[-1][P] >= dp[-1][D]:
        j = P
    else:
        j = D
    anss = [j]
    for i in reversed(range(2, N+1)):
        j = prevss[i][j]
        anss.append(j)
    

    anss = ''.join(['P' if ans == P else 'D' for ans in anss[::-1]])
    print(anss)


solve()

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

Solution (Python):



t = input().rstrip()
list_t = []

for s in t:
    list_t.append(s)

ans_str = ""
for i, s in enumerate(list_t):
    if s == "?":
        list_t[i] = "D"

print("".join(list_t))

Solution (Python):
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29

DIV = (10**9) + 7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


def main():
    
    print(sRaw().replace("?","D"))

main()

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 = list(str(input()))
if len(t) == 1:
    if t[0] == "?":
        print("D")
        exit()
for i in range(1,len(t)):
    if t[i] == "?":
        if t[i-1] == "P":
            t[i] = "D"
        elif t[i-1] == "?":
            t[i-1] = "P"
            t[i] = "D"
for i in range(len(t)-1):
    if t[i] == "?":
        if t[i+1] == "D":
            t[i] = "P"
        elif t[i+1] == "P":
            t[i] = "D"
if t[-1] == "?":
    t[-1] = "D"
ans = "".join(t)
print(ans)

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys


RS = lambda: sys.stdin.readline()[:-1]
RI = lambda x=int: x(RS())
RA = lambda x=int: map(x, RS().split())
RSS = lambda: RS().split()


def solve():
    ans = []
    for i in s:
        if i == "P":
            ans.append("P")
        else:
            ans.append("D")
    print("".join(ans))
    return



s = RS()
solve()

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

Solution (Python):
import sys

def input():
    return sys.stdin.readline()[:-1]
RS = input
RI = lambda x=int: x(RS())
RA = lambda x=int: map(x, RS().split())
RSS = lambda: RS().split()


def solve():
    ans = []
    for i in s:
        if i == "P":
            ans.append("P")
        else:
            ans.append("D")
    print("".join(ans))
    return



s = RS()
solve()

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

Solution (Python):
T = input()

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

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

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

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

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

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

Solution (Python):
s = input()



ans = []
for i in s:
    if i == "P":
        ans.append("P")
    else:
        ans.append("D")
print("".join(ans))

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

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

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

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

print(T)

Solution (Python):
import re 
T=input() 



T=T.replace("???", "DDD")
T=T.replace("??", "DD")

T=T.replace('D?D', 'DPD')
T=T.replace('D?P', 'DDP')
T=T.replace('P?D', 'PDD')
T=T.replace('P?P', 'PDP')

T=T.replace('?P', 'DP')
T=T.replace('?D', 'PD')

T=T.replace('P?', 'PD')
T=T.replace('D?', 'DD')

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




print(T)

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

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

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

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

Solution (Python):
def convert(s): 
  
    
    new = "" 
  
    
    for x in s: 
        new += x  
  
    
    return new 
s=input()
n=len(s)
a=[]
for i in range(n):
  if s[i]=='P':
    a.append('P')
  else:
    a.append('D')
print(convert(a))

Solution (Python):
s= input().strip()

print(s.replace("?","D",len(s)))

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

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

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

Solution (Python):
import sys
import collections

 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

T= read().rstrip().decode()
print(T.replace('?', 'D'))

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

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

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

answer_list=[]
for t in tlist:
  if t=="?":
    answer_list.append("D")
  else:
    answer_list.append(t)
    
print("".join(answer_list))

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

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

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

s = "".join(s)
print(s)

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

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

Solution (Python):
s=input()


sp=s.replace("?","P")
sd=s.replace("?","D")

d= sd.count('D')+sd.count('DP')
p= sp.count('D')+sp.count('DP')
          
                  
if d < p:
                  
    print(sp)
else:
    print(sd)

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

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()
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):
import itertools
import re


t = input()

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

Solution (Python):

import itertools
from collections import defaultdict
import collections
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

t = list(input())

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

Solution (Python):
x = input()
s = ""
if x[0] == "?":
	s = s+ "D"
else:
	s = s + x[0]
for i in range(1,len(x)):
	if x[i] == "?":
		s = s + "D"
		continue
	s = s + x[i]
print(s)

Solution (Python):


import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

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

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
t = input()

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

Solution (Python):
t=input()

tla=list(t)
tlb=list(t)
pd1=0
pd2=0

for i in range(len(tla)):
  if tla[i]=="?":
    if i==0:
      pass
    elif i==len(tla)-1:
      tla[i]="D"
    elif tla[i-1]=="P":
      tla[i]="D"
    elif tla[i+1]=="D":
      tla[i]="P"
    elif tla[i+1]=="?":
      tla[i]="P"
    else:
      tla[i]="D"
  if tla[i]=="D":
    if i==0:
      pass
    elif tla[i-1]=="P":
      pd1+=1
d1=tla.count('D')
s1=d1+pd1

for i in range(len(tlb)):
  if tlb[i]=="?":
    tlb[i]="D"
  if tlb[i]=="D":
    if i==0:
      pass
    elif tlb[i-1]=="P":
      pd2+=1
d2=tlb.count('D')
s2=d2+pd2

if s1>s2:
  print(''.join(tla))
else:
  print(''.join(tlb))

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

print(t)

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

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

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

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

Solution (Python):


import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

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

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

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

if __name__ == "__main__":
    main()

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

Solution (Python):

t = input()
ans = []
for ti in t:
    if ti == "?":
        ans.append("D")
    else:
        ans.append(ti)
print(''.join(ans))

Solution (Python):
T = input()
count = 0

for c in T:
  count += 1
  if c == '?' and T[count-1] == 'D':
    c = 'P'
    print(c, end="")
  elif c == '?':
    c = 'D'
    print(c, end="")
  else:
    print(c, end="")

Solution (Python):

T = str(input())
try:
    for i in range(T.count("?")):
        index = T.index("?")
        if T[index - 1] == "P":
            T = T.replace("?","D",1)
        elif T[index + 1] == "D":
            T = T.replace("?","P",1)
        elif T[index + 1] == "?":
            T = T.replace("?","P",1)
        else:
            T = T.replace("?","D",1)
    print(T)
except:
    print(T.replace("?","D"))

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

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

Solution (Python):
T = input()


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

Solution (Python):
T = input()
def gettotal(s):
    score = 0
    for i in range(len(s)):
        if s[i] == "D":
            score +=1        
        if i < len(s)-1:
            if s[i] + s[i+1] == "PD":
                score +=1
    return score

def pd(T):
    T = T.replace("?","D")
    print(T)
    

pd(T)

Solution (Python):
t = input()
s = [i for i in t]
if s[0] == "?":
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i] == "?":
        if s[i-1] == "D" and s[i+1] == "D":
            s[i] = "P"
        elif s[i-1] == "D" and s[i+1] == "?":
            s[i] = "P"
        else:
            s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))

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

for i in range(0, tlen):
  if T[i] == '?':
    T[i] = 'D'
    
print(*T,sep='')

Solution (Python):
s = input()
p = list(s) 
if p[len(p) - 1] == "?": 
  p[len(p) - 1] = "D"  

for i in range(len(p) - 1):
  if p[i] == "?":         
    if i == 0:            
      if p[i + 1] == "D" or p[i + 1] == "?": 
        p[i] = "P"
      else:                                   
        p[i] = "D"
    else:
      p[i] = "D"          
print("".join(p))

Solution (Python):
t = input()
if(len(t) == 1):
    if (t[0] == '?'): t = "D"
if(t[0] == '?'):
    if  (t[1] == 'D'): t = "".join(['P' , t[1:]])
    elif(t[1] == '?'): t = "".join(['PD', t[2:]])
    else:              t = "".join(['D' , t[1:]])
if(t[-1] == '?'):
    t = "".join([t[:-1], 'D'])
for i in range(len(t)-1):
    if(t[i] == '?'):
        if(t[i-1] == 'P'):    t = "".join([t[:i], 'D' , t[i+1:]])
        elif(t[i+1] == 'D'):  t = "".join([t[:i], 'P' , t[i+1:]])
        elif(t[i+1] == 'P'):  t = "".join([t[:i], 'D' , t[i+1:]])
        elif(t[i+1] == '?'):  t = "".join([t[:i], 'PD', t[i+2:]])
print(t)

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

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

Solution (Python):
t=input()
s=[0]*len(t)

for i in range(len(t)):
  
    if t[i]=='?':
        if i==0:
            if len(t)>=2:
                if t[i+1]=='D':
                    s[i]='P'
                else:
                    s[i]='D'
            else:s[i]='D'
      
      
        elif i==len(t)-1:
            s[i]='D'
        
    
        else:
            if s[i-1]=='P':s[i]='D'
            elif t[i+1]=='P':s[i]='D'
            else:s[i]='P'

    elif t[i]=='D' or t[i]=='P':s[i]=t[i]
    else:continue

print(''.join(s))

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

print("".join(t))

Solution (Python):
T = input()
N = len(T)
hatena = T.count("?")
t = list(T)
for i in range(0,N) :
    if t[i] == "?" :
        t[i] = "D"
        hatena = hatena - 1
        if hatena == 0 :
            break


print(''.join(t))

Solution (Python):
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache

sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


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

Solution (Python):
s = list(input())
pee = ""
for i in range(1,len(s)):
    if s[i-1] == "P" and s[i] == "?":
        s[i] = "D"
    if s[i-1] == "?" and s[i] == "D":
        s[i-1] = "P"
    if s[i-1] == "?" and s[i] == "?":
        s[i-1]="P"
        s[i]="D"
for i in range(len(s)):
    if s[i] == "?":
        s[i] = "D"
for i in s:
    pee+=i
print(pee)

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