peterverebics/CodeNet_Python_118 huggingface dataset:
t = list(input())
n = len(t)

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

print(*t, sep='')
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

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

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

print(''.join(s))
S = list(input())

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

print("".join(S))
data = input()
data_rep = data.replace("?","D")
print(data_rep)
t = input()
l = len(t)
a = []
b = ""
for i in range(l):
    a.append(t[i])
if a[-1] == "?":
    a[-1] = "D"
for i in range(1, l):
    if a[-i-1] == "?":
        a[-i-1] = "D"
for i in range(l):
    b += a[i]
print(b)
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))
T = input()
N = len(T)
S = [""] * N

for i in range(N - 1, -1, -1):
    if T[i] == "?":
        S[i] = "D"
    else:
        S[i] = T[i]
print("".join(S))
t = input()
for i in range(len(t)):
    print(("D" if t[i] == "?" else t[i]), end = "")
print()
t = input()
for c in t:
    if c == '?':
        print('D', end='')
    else:
        print(c, end='')
print()
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    t = str(stdin.readline().rstrip())
    print(t.replace("?","D"))

main()
def resolve():
    t=list(input())
    for i in range(len(t)):
        if t[i]=="?":
            t[i]="D"
    a="".join(t)
    print(a)
resolve()
import re
t = input()
#DかPD
ans = [0] * len(t)

#print(len(t))
for i in range(len(t)-1,-1,-1):
   # print(i)
    if t[i] != "?":
        ans[i] = t[i]
    else:
        if i == int(len(t)-1): #末尾
            ans[i] = "D" 
        elif ans[i+1] == "D" and t[i-1] != "P":
            ans[i] = "P"
        else:
            ans[i] = "D"

print(''.join(map(str, ans)))
t = input()
ans = ""
for i in range (len(t)):
    if t[i] == "?":
        ans += "D"
    else:
        ans += t[i]
print(ans)
T=input()
for i in range(len(T)):
  if T[i] == "?":
    print("D", end="")
  else:
    print(T[i], end="")
print()
T=input()
list=[]
for j in range(len(T)):
    if T[j]=="?":
        list.append(j)
tt=[]
for TT in range(len(T)):
    tt.append(T[TT])
for i in list:
    tt[i]="D"
answer=""
for p in range(len(T)):
    answer+=tt[p]
print(answer)
lists = list(input())
leng = len(lists)
count = 0
flag = 0
for i in lists:
	if lists[count] == "?":
		if count + 1  < leng:
			if flag == 0:
				if (lists[count+1] == "D" or lists[count+1] == "?"):
					lists[count] = "P"
					flag = 1
				else:
					lists[count] = "D"
					flag = 0
			else:
				lists[count] = "D"
				flag = 0
		else:
			lists[count] = "D"
	else:
		flag = 1
	count = count + 1
print("".join(lists))
s = input()
ans = ""
for i in range(len(s)-1):
    if s[i] == "?":
        if i != 0 and ans[i-1] == "P":
            ans += "D"
        elif s[i+1] == "D":
            ans += "P"
        elif s[i+1] == "P":
            ans += "D"
        else:
            ans += "P"
    else:
        ans += s[i]

if s[-1] == "?":
    ans += "D"
else:
    ans += s[-1]

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

if __name__ == '__main__':
    main()
t = input()
#t = 'PD?D??P'

max = 0
tmp = 0

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

# how many D
tmp = t.count('D')

# how many PD
tmp += t.count('PD')

max = tmp

print(t)
t = input()
t = list(t)

for i in range(len(t)):
    if t[i] == "?":
        t[i] = 'D'
ans = "".join(t)
print(ans)
def main():
    t = input()
    print(t.replace("?","D"))
main()
t=list(input())
t = ''.join(t)
t=t.replace("?", "D")
print(t)
T = input()
T = ['D' if c == '?' else c for c in T]
print(*T, sep='')
t = input()
n = len(t)
ans = ''
for i in range(n):
    if t[i] == '?':
        ans += 'D'
    else:
        ans += t[i]
print(ans)
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62



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



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

if __name__ == '__main__':
    main()
s = str(input())

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

print(nw1)
# -*- coding: utf-8 -*-

T = input()
a = 'a'

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

print("{}".format(a[1:]))
s = input()
ans = ''
for i in s:
    if i == 'P':
        ans += 'P'
    else:
        ans += 'D'
print(ans)
T=input()
T=[str(t) for t in T]
for a in range(len(T)):
    if T[a]=='?':
        if a-1>=0 and T[a-1]=='P':
            T[a]='D'
        elif a+1>len(T)-1:
            T[a]='D'
        else:
            T[a]='D'
print(''.join(T))
T = input()
length = len(T)
ans = ""
for i in range(length):
    if T[i] == "?":
        ans += "D"
    else:
        ans += T[i]
print(ans)
t = list(input())
n = len(t)
for i in range(n):
  if t[i] == '?':
    t[i] = 'D'
print(''.join(t))
def main():
    T = input()
    T = T.replace('?', 'D')
    print(T)


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok
# https://atcoder.jp/contests/nomura2020/tasks/nomura2020_b

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

for i in range(len(t)):
  if t[i] == "?":
    t[i] = "D"  
print(''.join(t))
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
t = input()
len = len(t)

for i in range(len):
    if t[i] == "?":
        print("D", end = "")
    else:
        print(t[i], end = "")
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()
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))
def func2(l, value):
    i = -1
    c = len(l)
    result = []
    while i < c:
        try:
            i = l.index(value, i + 1)
            result.append(i)
        except:
            return result
    return result

T=list(input())
que_list=(func2(T,"?"))
for i in que_list:
    T[i]='D'
print(''.join(T))
s = input()
ans = []
for i in s:
    if i == '?':
        ans.append('D')
    else:
        ans.append(i)
print(''.join(ans))
from collections import deque

T = input()
for s in T:
    if s == "?":
        print("D", end = "")
    else:
        print(s, end = "")
print()
import numpy as np
#np_ary=np.array([1,2,3,4,5])
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="")
t = str(input())
ans = ""
for i in range(len(t)):
  if t[i] == "?":
    ans += "D"
  elif t[i] == "D":
    ans += "D"
  else:
    ans += "P"
print(ans)
t=list(input())
for i in range(len(t)):
    if t[i] == '?':
        t[i] = 'D'
print(''.join(t))
def main():
    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))


if __name__ == '__main__':
    main()
T=input()
T=T.replace("?", "D")
print(T)
T = input()
l = [t for t in T]

s = len(T)
for i in range(s):
  if l[i] == '?':
    if i == s-1:
      l[i] = 'D'
    elif i == 0 and l[i+1]!='P':
      l[i] = 'P'
    elif i == 0:
      l[i] = 'D'
    elif l[i-1]=='D' and ((l[i+1]=='D')or(l[i+1]=='?')):
      l[i] = 'P'
    else:
      l[i] = 'D'
      
str_changed = "".join(l)
print(str_changed)
T = list(input())
TD = [x if x == 'P' or x == 'D' else 'D' for x in T]

print(''.join(TD))
T = list(input())
for i in range(len(T)):
    if T[i] == "?":
        T[i] = "D"
    else:
        pass


print("".join(T))
t = input()
ans = []
for i in range(len(t)):
    tt = t[i]
    if tt == '?':
        ans.append('D')
    else:
        ans.append(t[i])
    # if tt == 'D':
    #     ans += 1
    #     if i - 1 >= 0 and t[i - 1] == 'P':
    #         ans += 1
    # if tt == '?':
    #     ans += 1
    #     if i - 1 >= 0 and t[i - 1] == 'P':
    #         ans += 1
print("".join(ans))
T = input()
X = len(T)
A = T.replace('?','D')
print(A)
t = list(input())

ans = 0
pre = ''

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

print(''.join(t))
T = input()

[print(i if i != '?' else 'D', end='') for i in T] 
print()
T = str(input())

text1=[]
def search2(text):
    for i in text:
        if i=="?":
            i="D"
        text1.append(i)
    print("".join(text1))

search2(T)
def main():
    t = input()

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


if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-
S = str(input());l = len(S);Str = ""
for num in range(l):
    if S[num] != "?":
        Str += S[num]
    else:
        Str += "D"
print(Str)
s=list(input())
for i in range(len(s)):
    if s[i]=='?':
        s[i]='D'
print(*s,sep='')
def main():
    t = list(input())
    for i in range(len(t)):
        if t[i] == "?":
            t[i] = "D"
    print("".join(t))


if __name__ == '__main__':
    main()
t = str(input())

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

print(rt)
S=list(input())
for n in range(len(S)):
    if S[n]=='?':
        S[n]='D'
print(''.join(S))
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)
S = input()

lis = []

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

print("".join(str(x) for x in lis))
s = input()

ans = ''
for i in s:
    if i == 'P':
        ans += i
    else:
        ans += 'D'

print(ans)
T=str(input())
result=T.replace('?','D')
print(result)
def resolve():
    t = input()
    ans = []
    is_pre_p = False
    for c in t:
        if c == '?':
            ans.append('D')
        else:
            ans.append(c)

    print("".join(ans))

resolve()
t = input()
for i in t:
    if i=='?':
        print('D', end='')
    else:
        print(i, end='')
print()
T = input()
ans = str()

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

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

print("".join(T))
t = input()
ans = ''
for i in range(len(t)):
    if t[i] == '?':
        ans += 'D'
    else:
        ans += t[i]
print(ans)
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()
def main():
    text = input()
    for c in text:
        if c == '?':
            print('D', end='')
        else:
            print(c, end='')


if __name__ == '__main__':
    main()
t = list(input())

for i in range(len(t)):
    if t[i] == '?':
        t[i] = 'D'
ans = 0
if t[0] == 'D':
    ans += 1
for i in range(1, len(t)):
    if t[i] == 'D' and t[i-1] == 'P':
        ans += 2
    elif t[i] == 'D':
        ans += 1
print("".join(t))
import sys

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

S = read().rstrip().decode()

print(S.replace('?', 'D'))
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

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

T = input()

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

print(ans)
l = input()
l_replace = [s.replace('?', 'D') for s in l]
text = ''.join(l_replace)
print(text)
t = input()
t = list(t)
for i in range(len(t)):
  if t[i] == "?":
    t[i] = "D"
    
print("".join(t))
import collections
from functools import lru_cache

def solve(s):
    s = [ch for ch in s]
    n = len(s)

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

    return "".join(s)


s = input().strip()
print(solve(s))
s=input()
l=[]
for i in range(len(s)):
    if s[i]=='?':
        l.append('D')
    else:
        l.append(s[i])
print(''.join(l))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

t = readline().rstrip().decode()
t = t.replace('?', 'D')
print(t)
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))
T = list(input())
for i in range(len(T)):
	if T[i] == "?":
		T[i] = "D"
print("".join(T))
T=input()
L=len(T)
if L==1:
  if T=='?': print('D')
  else: print(T)
else:
  X=list(T)
  for i in range(L-1):
    if X[i]!='?': continue
    if i==0:
      if X[1]=='P': X[0]='D'
      else:X[0]='P'
    else:
      if X[i-1]=='P' or X[i+1]=='P':X[i]='D'
      else:X[i]='P'
  if X[-1]=='?':X[-1]='D'
  print("".join(X))
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"))
T = bytearray(input().encode())

if T[0] == b'?'[0]:
  T[0] = b'P'[0] if len(T) > 1 and T[1] != b'P'[0] else b'D'[0]

for i, (old, c, new) in enumerate(zip(T, T[1:], T[2:]), start=1):
  if c == b'?'[0]:
    T[i] = b'D'[0] if new == b'P'[0] or old == b'P'[0] else b'P'[0]

if T[-1] == b'?'[0]:
  T[-1] = b'D'[0]
  
print(T.decode())
T = list(input())
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'

print(''.join(T))
t = list(input())

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

tmp = T.replace('P?','PD')
tmp1 = tmp.replace('?D','PD')
tmp2 = tmp1.replace('??','PD')
tmp3 = tmp2.replace('?','D')

print(tmp3)
s=input()
for i in s:
    if i=='?': print('D',end='')
    else: print(i,end='')
t=list(input())
n=len(t)
for i in range(n):
  if t[i]=='?':
    t[i]='D'
print(''.join(t))
t = input()

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

li = []
for i, c in enumerate(s):
    if c == '?':
        if i == len(s) - 1:
            c = 'D'
        else:
            if s[i + 1] == 'D' or s[i + 1] == '?':
                c = 'P'
            else:
                c = 'D'
    li.append(c)

print(''.join(li))
S = input()

ns = ""
for i in S:
    if i == '?':
        ns += 'D'
    else:
        ns += 'P'

print(ns)
t=list(input())
if t[-1]=='?':
    t[-1]='D'
for i in range(len(t)-1,0,-1):
    if t[i]=='?':
        if t[i-1]=='D':
            t[i]='P'
        else:
            t[i]='D'
print(''.join(t))
a = input()
t =list(a)
if t[len(t)-1] == "?":
    t[len(t)-1] = "D"
for i in reversed(range(1,len(t)-1)):
    if t[i] == "?" and t[i+1] == "D":
        t[i] = "P"
    elif t[i] == "?":
        t[i] = "D"
if t[0] == "?":
    if t[1] == "D":
        t[0] = "P"
    else:
        t[0] = "D"
answer = "".join(t)
print(answer)
import numpy as np

a = input()
s = list(a)

index = []
index.append(a.find('?')+1)

i = 0
while a.find('?',index[i]) != -1:
  tmp = a.find('?',index[i])
  index.append(tmp + 1)
  i = i + 1

score = a.count('D') + a.count('PD')

for i in range(len(index)):
  s[index[i]-1] = 'D'
  score = score + 1
  
s = "".join(s)
print(s)
s = input()
s = s[::-1]
s = list(str(s))

for i in range(len(s)):
    if s[i] == '?':
        if s[i-1] == 'P':
            s[i] = 'D'
        elif s[i-1] == 'D':
            s[i] = 'P'
s = s[::-1]

print(''.join(s))
def main():
    T = input()
    # ?D -> PD
    # ?P -> DP
    # ?? -> PD 
    # ??? -> PDD

    T = T.replace("??", "DD")
    T = T.replace("?D", "PD")
    T = T.replace("?P", "DP")
    T = T.replace("?", "D")
    print(T)

if __name__=="__main__":
    main()
T = input()
length = len(T) - 1
for i in range(length):
    if T[i] == "?":
        T = T[:i] + "D" + T[i + 1:]
print(T)
s=input()
s=s.split()
for i in range(len(s)):
    if(s[i]=='?'):
        s[i]='D'
#PD?D??P
for i in range(len(s)):
    print(s[i])
string = input()
string=list(string)

count = len(string)
summary = 0

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

for i in range(count):
    if string[i]== "D" and string[i-1]=="P":
        summary +=1
    if string[i] == "D":
        summary +=1
print(summary)
T = input()
l = [t for t in T]

s = len(T)
for i in range(s):
  if l[i] == '?':
    if i == s-1:
      l[i] = 'D'
    elif (i==0) or ((l[i-1]=='D') and (l[i+1]=='D')):
      l[i] = 'P'
    else:
      l[i] = 'D'
      
str_changed = "".join(l)
print(str_changed)
t = list(input())
temp = ''

for i, s in enumerate(reversed(t)):
    if s == '?' and temp == 'D':
        t[len(t)-i-1] = 'P'
    elif s == '?' and temp == 'P':
        t[len(t)-i-1] = 'D'
    elif s == '?' and len(t) == len(t)-i:
        t[len(t)-i-1] = 'D'
    temp = s

print(*t, sep='')
t = list(input())
n = len(t)

for i in range(n):
    if(t[i] == "?" ):
        if(t[i-1] == "P"):
            t[i] = "D"
        elif(t[i-1] == "D"):
            t[i] = "D"
t1 = "".join(t)
print(t1)
T = input()
T = T.replace("?","D")
print(T.count("PD") + T.count("D"))
def main():
    T = input()
    # ?D -> PD
    # ?P -> DP
    # ?? -> PD 
    # ??? -> PDD

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

                    
    print(T)

if __name__=="__main__":
    main()
T=str(input())
cnt=0
count=len(T)
for i in T:
    if i=='P':
        cnt=1
        print('P',end='')

    elif i=='D':
        cnt=0
        print('D', end='')
    else:
        if count == i:
            print('D')

        elif cnt==1:
            cnt=0
            print('D', end='')
        else:
            cnt=1
            print('P', end='')
a=list(input())
ans=0
for i in range(len(a)):
  if a[i]=='?':
    if a[i-1]=='P':
      a[i]='D'
    else:
      a[i]='P'
for i in range(len(a)):
    print(a[i],end='')
t = list(input())
t.reverse()

tmptmp = "P"
for i in range(len(t)):
    if i == 0:
        tmp = t[i]
        continue
    if tmp == "?" and tmptmp == "P":
        t[i-1] = "D"
    elif tmp == "?" and tmptmp == "D" and t[i] == "P":
        t[i-1] = "D"
    elif tmp == "?" and tmptmp == "D" and t[i] == "D":
        t[i-1] = "P"
    tmptmp = t[i-1]
    tmp = t[i]

t.reverse()
t = "".join(t)
print(t)
T = list(str(input()))
X = ''
for i in range(len(T)):
    if T[i] == 'P' :
        X += 'P'
    elif T[i] == 'D' :
        X += 'D'
    elif T[i] == '?' :
        if T[i-1] == 'D' :
            X += 'P'
        elif T[i-1] == 'P' :
            X += 'D'
        elif T[i-1] == '?':
            X += 'D'
            
print(X)
T = input()

T = T.replace("??", "PD");

T = list(T)
for i in range(len(T)):
    if T[i] == "?":
        T[i] = 'D'
        if i+1 < len(T):
            if T[i+1] == 'D':
                T[i] = 'P'


for i in T:
    print(i, end=""),
print()
T=list(map(str,input()))
for i in range(len(T)):
  if T[i]=='?' and i!=0:
    if T[i-1]=='P':
      T[i]='D'
    elif T[i-1]=='D':
      T[i]='P'
  elif i+1<len(T):
    if T[i+1]=='D':
      T[i]='P'
    else:
      T[i]='D'
      
print("".join(T))
T = input()
ans =  ""
for i in range(len(T)):
    if T[i] == "P":
        ans += "P"
    elif T[i] == "D":
        ans += "D"
    elif T[i] == "?":
        if i == 0:
            ans += "D"
        else:
            if ans[i-1]== "P":
                ans += "D"
            else:
                ans += "P"
print(ans)
#!/usr/bin/env python
"""AtCoder nomura 2020: B - Postdocs - 
https://atcoder.jp/contests/nomura2020/tasks/nomura2020_b
"""

__author__ = 'bugttle <bugttle@gmail.com>'

def calc(t):
    return t.count('D') + t.count('PD')

def main():
    T = input()

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


if __name__ == '__main__':
    main()
paramT = input()
paramReplaced = list(paramT.replace('?', 'D'))
point = 0
for i in range(len(paramReplaced)):
    if paramReplaced[i] == 'D':
        point += 1
    if i != 0 and paramReplaced[i - 1] == 'P' and paramReplaced[i - 1] == 'D':
        point += 1

print(point)
s = input()

dp = [[-1000]*2 for _ in range(len(s)+1)]
dp[0][0] = 0 #D
dp[0][1] = 0 #P

for i in range(len(s)):
  if s[i] == "D":
    dp[i+1][0] = max(dp[i][0]+1,dp[i][1]+2)
  if s[i] == "P":
    dp[i+1][1] = max(dp[i][0],dp[i][1])
  if s[i] == "?":
    dp[i+1][0] = max(dp[i][0]+1,dp[i][1]+2) #Dの時
    dp[i+1][1] = max(dp[i][0],dp[i][1]) #Pの時
    
print(max(dp[len(s)][0],dp[len(s)][1]))
t = input()
print(t[0],end="")
for i in range(1,len(t)):
    if t[i] == "?":
        if t[i-1] == "D":
            print("P",end="")
        else:
            print("D",end="")
    else:
        print(t[i],end="")
T=list(input())
l=len(T)
S=[]
for i in range(l-1):
  if T[i]=="P" or T[i]=="D":
    S.append(T[i])
  if T[i]=="?":
    if T[i+1]=="?" or T[i+1]=="D":
      S.append("P")
    if T[i+1]=="P":
      S.append("D")
      
if T[l-1]=="P" or T[l-1]=="D":
  S.append(T[l-1])
if T[l-1]=="?":
  S.append("D")

P=''.join(S)
print(P)
s = input()
ans = ''
for i in range(len(s)):
  s_i = s[i]
  if s_i == '?':
    if i < len(s) - 1:
      if (s[i + 1] == 'D') | (s[i + 1] == '?'):
        ans += 'P'
        continue
      else:
        ans += 'D'
        continue
    else:
      ans += 'D'
      continue
  ans += s_i
print(ans)
T =  list(input())

for i in range(len(T)) :
    if (i == 0 or i == len(T) - 1) and T[0] == '?' :
        T[0] = 'D'
    
    if T[i] == '?' :
        if T[i - 1] == 'P' :
            T[i] = 'D'
        else :
            T[i] = 'P'
            
    print(T[i], end = '')
T=input()
lis=[T[i] for i in range(len(T))]
for i in range(len(T)):
	if lis[i]=="?":
		if lis[min(i+1,len(T)-1)]!="P":
			lis[i]="P"
		else:
			lis[i]="D"
k="".join(lis)
print(k)