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):
import sys
import math
from collections import deque
import heapq
import itertools
MAX_INT = int(10e25)
MIN_INT = -MAX_INT
mod = 998244353
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
N = len(s)

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

Solution (Python):
T = input()
ans = ''
for i in T:
    if i != '?':
        ans += i
        continue
    ans += 'D'
print(ans)

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

Solution (Python):
T = list(input())
for i in range(len(T)):
    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"
print("".join(s))

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

Solution (Python):
import sys
import 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


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




if __name__ == '__main__':
    main()

Solution (Python):
t = list(input())
ans = 0
if t[0]=="?":
    t[0]="D"
    ans += 1

for i in range(1,len(t)):
    if (t[i]=="P"):
        pass
    elif (t[i]=="D"):
        ans += 1
        if (t[i-1]=="P"):
            ans += 1
    else:
        if (t[i-1]=="P"):
            ans += 2
            t[i]="D"
        else:
            ans+=1
            t[i]="D"
a = ""
for i in t:
    a += i
            
print(a)

Solution (Python):
def main():
    text = input()
    for c in text:
        if c == '?':
            print('D', end='')
        else:
            print(c, end='')


if __name__ == '__main__':
    main()

Solution (Python):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline




T = input()
ans = []
prev = False

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

    if T[i]=='D':
        
        
        
        prev = False
        ans.append('D')

    if T[i]=='P':
        prev = True
        ans.append('P')

print(''.join(ans))

Solution (Python):
import sys
import math
from  collections import defaultdict




def solve(test):
	s = list(input())
	for i in range(len(s)):
		if s[i] == '?':
			s[i] = 'D'

	print(''.join(s))

if __name__ == "__main__":
	test_cases = 1
	for t in range(1, test_cases + 1):
		solve(t)

Solution (Python):
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    T = list(input())

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

    print(''.join(T))


if __name__ == '__main__':
    solve()

Solution (Python):
T = input()

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

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

if __name__ == "__main__":
    solve()

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

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

print(*t, sep="")

Solution (Python):
S=list(input())
for c in S:
    if c!='?':
        print(c, end='')
    else:
        print('D', end='')
print()

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

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

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
T=input()
ans=""
for t in T:
  if t=="P":
    ans+="P"
  else:
    ans+="D"
print(ans)

Solution (Python):

import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys


buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    ans = []
    for i, c in enumerate(S):
        if c == '?':
            ans.append('D')
        else:
            ans.append(c)
    return ''.join(ans)


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()

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

Solution (Python):
t = input()

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

print(t)

Solution (Python):
s = input()

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

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

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

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

Solution (Python):
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

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

print(''.join(ans))

Solution (Python):

t=list(input())
s=""
if t[0]=="?":
  s+="D"
else:
  s+=t[0]
for i in range(1,len(t)):
  if t[i]!="?":
    s+=t[i]
  else:
    s+="D"
print(s)

Solution (Python):
T = input()
prev = ''
ans = []
N = len(T)
for i, x in enumerate(T):
    if x == '?':
        ans.append("D")

    else:
        ans.append(x)
print(''.join(ans))

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

Solution (Python):
t=input()

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

print(ans)

Solution (Python):
t = input()
ans = ""
j = 0
for i in t:
    if i in ["?"]:
        ans += "D"
    else:
        ans += i
print(ans)

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

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

Solution (Python):
s=input().strip()
for i in s:
    if(i=="?"):
        print("D",end="")
    else:
        print(i,end="")
print()

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

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

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

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

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

T = input()

tmp = []

for ch in T:
    if ch == "?":
        tmp.append("D")
    else:
        tmp.append(ch)

tmp = "".join(tmp)
print(tmp)

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] != "?":
        print(t[i],end="")
    else:
        print("D",end="")
print("")

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

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

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

Solution (Python):
def main():
    t = input()

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline


def main():
    S = input()
    S = S.replace('?', 'D')
    print(S)


if __name__ == "__main__":
    main()

Solution (Python):
T=list(input())
a=[]
for i in range(len(T)):
    if T[i]=="P" or T[i]=="D":
        a.append(T[i])
    else:
        a.append("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'
print(*T, sep='')

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

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

print(ans)

Solution (Python):
t = input()

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

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

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

Solution (Python):

import sys


def solve(T: str):
    T = T.replace('?','D')
    print(T)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    T = next(tokens)  
    solve(T)

if __name__ == '__main__':
    main()

Solution (Python):
import re

T = input()
print(re.sub(r'\?', 'D', T))

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("".join(t))

Solution (Python):
s = input()
ans = 0

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

print(p)

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

ans = 0
pre = ''

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

print(''.join(t))

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

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

a = ''
for i in T:
    a += i

print(a)

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

Solution (Python):
def task(t):
    ans = []
    for i in range(0, len(t)):
        if t[i] == "D" or t[i] == "P":
            ans.append(t[i])
        else:
            ans.append("D")

    print("".join(ans))


t = input()
task(t)

Solution (Python):
t = input()

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

print(ans)

Solution (Python):
t = input()
li = list(t)
ans = ''
for l in li:
    if l == '?':
        ans += 'D'
    else:
        ans += l
print(ans)

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

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

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

Solution (Python):
from sys import stdin, stdout
s = stdin.readline()






    




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

Solution (Python):
T = input()

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

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

print(''.join(T))

Solution (Python):

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

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

Solution (Python):
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

s = input()
print(s.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"

for i in range(len(T)):
    print(T[i],end="")

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    T=str(input())
    print(T.replace('?','D'))
    
resolve()

Solution (Python):

import sys


def solve(T: str):
    return T.replace('?', 'D')


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    T = next(tokens)  
    print(solve(T))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
import numpy as np
import math
import collections

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

Solution (Python):
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'

    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in range(base**n):s=[tb//(base**bt)%base for bt in range(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
 
YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase

read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
input=lambda: sys.stdin.readline().rstrip()


show_flg=False
show_flg=True
ans=0



s=input()
n=len(s)
t=[]
for i in range(n):
    c=s[i]
    if c=='?':
        t+=['D']
    else:
        t+=[s[i]]
ans=''.join(t)
print(ans)

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    s = s_input()

    len_s = len(s)

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

    print()
            
if __name__ == '__main__':
    main()

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

Solution (Python):


import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
from queue import PriorityQueue
import itertools
from copy import deepcopy
import random
import time
import os
import sys
import datetime
from functools import lru_cache
from functools import reduce
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
alphabet="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):
    if b:print("yes")
    else:print("no")
def Yn(b):
    if b:print("Yes")
    else:print("No")
def YN(b):
    if b:print("YES")
    else:print("NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(bbool,ret1,ret2):
    if bbool:return ret1
    else:return  ret2
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def pm(x):
    return x//abs(x)
def inputintlist(): 
    return list(map(int,input().split()))
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def ruisekiwa(A):
    ret=[0]*(len(A)+1)
    for a in range(len(A)):
        ret[a+1]=ret[a]+A[a]
    return ret
def getmd(x1,y1,x2,y2):
    return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):
    return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow










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

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

Solution (Python):
s=input()

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

Solution (Python):
t = input()
ans = ''
for s in t:
    tmp = 'D' if s == '?' else s
    ans += tmp
print(ans)

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

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

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

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

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

for s in t:
    if s == "P":
        ans += "P"
    if s == "D" or s == "?":
        ans += "D"
print(ans)

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

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

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

    n = len(t)
    p = 0
    while p < n:
        if p == n-1:
            if t[p] == '?':
                t[p] = 'D'
            p += 1
        else:
            if t[p] == 'P' and t[p+1] == '?':
                t[p+1] = 'D'
                p += 2
            elif t[p] == '?' and t[p+1] == 'D':
                t[p] = 'P'
                p += 2
            elif t[p] == '?' and t[p+1] == '?':
                t[p] = 'P'
                t[p+1] = 'D'
                p += 2
            elif t[p] == '?':
                t[p] = 'D'
                p += 1
            else:
                p += 1

    print(''.join(t))

if __name__ == '__main__':
    main()

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

Solution (Python):
T = input()
ans = ''
for c in T:
    if c=='?':
        c = 'D'
    ans += c
print(ans)

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

Solution (Python):
t_in = input()
t_out = ""
for t in t_in:
    if t == '?':
        t_out += 'D'
    else:
        t_out += t
print(t_out)

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

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

ans = ''
for i in range(len(T)):
    ans += T[i]

print(ans)

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

Solution (Python):
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

def read_int_list():
    return list(map(int,input().split(' ')))

def read_s_list_loop(n):
    return [input() for _ in range(n)]

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

Solution (Python):
T = input()
ans = ''
for i in range(len(T)):
    if T[i] != '?':
        ans += T[i]
        continue
    ans += 'D'
print(ans)

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

Solution (Python):
t = input()

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

print(t)

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

Solution (Python):
t=input()
t=t.replace("?","D")
cd=t.count("D")
cdp=t.count("PD")

print(t)

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

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

t = "".join(t)

print(t)

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

T = input().rstrip()
ans = []

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

print("".join(ans))

Solution (Python):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd

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

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

Solution (Python):
import sys
import 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
import math
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

ans = ''
for s in S:
    if s == '?':
        ans += 'D'
    else:
        ans += s
print(ans)

Solution (Python):
def main():
    t = list(input())
    for i in range(len(t)-1):
        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'

    if t[-1] == '?':
        t[-1] = 'D'
        
    for i in t:
        print(i,end = '')


main()

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

Solution (Python):
def solve(t):
    res_list = []
    for st in t:
        if st == "P":
            res_list.append("P")
        else:
            res_list.append("D")
    return "".join(res_list)


def main():
    t = input()
    res = solve(t)
    print(res)


def test():
    assert solve("PD?D??P") == "PDDDDDP"
    assert solve("P?P?") == "PDPD"


if __name__ == "__main__":
    test()
    main()

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

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

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

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(''.join(['D' if s=='?' else s for s in T]))

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

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

print(ans)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    S = list(input().strip("\n"))
    for i, s in enumerate(S):
        if s == "?":
            if i > 0 and S[i-1] == "P": S[i] = "D"
            else:
                if i < len(S) - 1:
                    if S[i+1] != "P": S[i] = "P"
                    else: S[i] = "D"
                else: S[i] = "D"
    print("".join(S))

    return 0

if __name__ == "__main__":
    solve()

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

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


S=input()





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

Solution (Python):




t = input()
s = list()


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


print(''.join(s))