Buggy python submission (verdict: Runtime Error):
#BBBBBBBBBBB
 
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))

Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import itertools,copy,sys
    input = sys.stdin.readline
    T = list(input())
    N = [i for i, x in enumerate(T) if x == '?']
    B = list(itertools.product(['P','D'], repeat=len(N)))
    max = 0
    maxstr = ''
    for b in B:
        TC = copy.deepcopy(T)
        for j,n in enumerate(N):
            TC[n] = b[j]
        TC = ''.join(TC)
        sum = TC.count('PD') + TC.count('D')
        if max < sum:
            max = sum
            maxstr = TC
    print(maxstr)
main()
exit(0)

if __name__ == '__main__':
    main()

Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import itertools,copy,sys
    input = sys.stdin.readline
    T = list(input())
    N = [i for i, x in enumerate(T) if x == '?']
    B = list(itertools.product(['P','D'], repeat=len(N)))
    max = 0
    maxstr = ''
    for b in B:
        TC = copy.deepcopy(T)
        for n,j in zip(N,range(len(N))):
            TC[n] = b[j]
        TC = ''.join(TC)
        sum = TC.count('PD') + TC.count('D')
        if max < sum:
            max = sum
            maxstr = TC
    print(maxstr)
main()

if __name__ == '__main__':
    main()

Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import itertools,copy,sys
    input = sys.stdin.readline
    T = list(input())
    TC = T
    N = [i for i, x in enumerate(T) if x == '?']
    B = list(itertools.product(['P','D'], repeat=len(N)))
    point = [0]*len(B)
    strs = ['']*len(B)
    for b,i in zip(B,range(len(B))):
        TC = copy.deepcopy(T)
        TC_count = TC.count
        for n,j in zip(N,range(len(N))):
            TC[n] = b[j]
        TC = ''.join(TC)
        strs[i] = TC
        point[i] = TC_count('PD') + TC_count('D')
    maxin = max(point)

    print(strs[point.index(maxin)])
main()

if __name__ == '__main__':
    main()

Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import itertools,copy,sys
    input = sys.stdin.readline
    T = list(input())
    N = [i for i, x in enumerate(T) if x == '?']
    B = list(itertools.product(['P','D'], repeat=len(N)))
    point = [0]*len(B)
    strs = ['']*len(B)
    for b,i in zip(B,range(len(B))):
        TC = copy.deepcopy(T)
        for n,j in zip(N,range(len(N))):
            TC[n] = b[j]
        TC = ''.join(TC)
        strs[i] = TC
        point[i] = TC.count('PD') + TC.count('D')
    maxin = max(point)

    print(strs[point.index(maxin)])
main()

if __name__ == '__main__':
    main()

Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy
T = list(input())
N = [i for i, x in enumerate(T) if x == '?']
B = list(itertools.product(['P','D'], repeat=len(N)))
point = [0]*len(B)
strs = ['']*len(B)
for b,i in zip(B,range(len(B))):
    TC = copy.deepcopy(T)
    for n,j in zip(N,range(len(N))):
        TC[n] = b[j]
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
T = input()
TC = list(T)
N = [i for i, x in enumerate(TC) if x == '?']
B = list(itertools.product(['P','D'], repeat=len(N)))
point = [0]*len(B)
strs = ['']*len(B)
for b,i in zip(B,range(len(B))):
    TC = list(T)
    for n,j in zip(N,range(len(N))):
        TC[n] = b[j]
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy
T = input()
TC = list(T)
N = [i for i, x in enumerate(TC) if x == '?']
B = list(itertools.product(['P','D'], repeat=len(N)))
point = [0]*len(B)
strs = ['']*len(B)
for b,i in zip(B,range(len(B))):
    TC = list(T)
    for n,j in zip(N,range(len(N))):
        TC[n] = b[j]
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])

Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy

from typing import re
T = input()
TC = list(T)
N = [i for i, x in enumerate(TC) if x == '?']
B = list(itertools.product(['P','D'], repeat=len(N)))
point = [0]*len(B)
strs = [0]*len(B)
for b,i in zip(B,range(len(B))):
    TC = list(T)
    for n,j in zip(N,range(len(N))):
        TC[n] = b[j]
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy
T = input()
TC = list(T)
N = T.count('?')
B = list(itertools.product(['P','D'], repeat=N))
point = [0]*len(B)
strs = [0]*len(B)
for b,i in zip(B,range(len(B))):
    count = 0
    TC = list(T)
    for j in range(len(T)):
        if TC[j] == '?':
            TC[j] = b[count]
            count += 1
    strs[i] = ''.join(TC)
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy
T = input()
TC = list(T)
N = T.count('?')
B = list(itertools.product(['P','D'], repeat=N))
point = [0]*len(B)
strs = [0]*len(B)
for b,i in zip(B,range(len(B))):
    count = 0
    TC = list(T)
    for j in range(len(T)):
        if TC[j] == '?':
            TC[j] = b[count]
            count += 1
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy
T = input()
TC = list(copy.deepcopy(T))
N = T.count('?')
B = list(itertools.product(['P','D'], repeat=N))
point = [0]*len(B)
strs = [0]*len(B)
for b,i in zip(B,range(len(B))):
    count = 0
    TC = list(T)
    for j in range(len(T)):
        if TC[j] == '?':
            TC[j] = b[count]
            count += 1
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools,copy
T = input()
TC = list(copy.deepcopy(T))
N = T.count('?')
B = list(itertools.product(['P','D'], repeat=N))
point = []
strs = []
for b in B:
    count = 0
    TC = list(T)
    for j in range(len(T)):
        if TC[j] == '?':
            TC[j] = b[count]
            count += 1
    TC = ''.join(TC)
    strs.append(TC)
    point.append(TC.count('PD') + TC.count('D'))
maxin = max(point)

print(strs[point.index(maxin)])


Fixed submission:
#BBBBBBBBBBB

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))