Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    print(len(s)-1)
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (s[i+1] == 'P' or s[i+1] == '?'):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P' :
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (s[i+1] == 'P' or s[i+1] == '?'):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)

 
print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
    
        elif s[i-1] =='P' :
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1 or s[i+1] == 'P'):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)
 
#cnt = s.count('PD')
#cnt += s.count('D')
 
print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
    
        elif s[i-1] =='P' :
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1 or s[i+1] == 'P'):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)
 
#cnt = s.count('PD')
#cnt += s.count('D')
 
print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

Buggy python submission (verdict: Runtime Error):
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
    
        elif s[i-1] =='P' :
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and s[i+1] == 'P':
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)
 
#cnt = s.count('PD')
#cnt += s.count('D')
 
print(s)

Fixed submission:
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)