Imports System
 
Module Program
    Sub Main(args As String())
        Dim T As String = Console.ReadLine()
 
        Dim wk As String = Left(T, 1)
        If wk = "?" Then
            If Len(T) = 1 Then
                Console.WriteLine("D")
                Exit Sub
            End If
 
            If Mid(T, 2, 1) <> "D" Then
                wk = "D"
            Else
                wk = "P"
            End If
        End If
        Dim r As String = wk
        Console.Write(r)
 
        For i = 2 To Len(T)
            wk = Mid(T, i, 1)
            If wk = "?" Then
                If r <> "D" Then
                    wk = "D"
                Else
                    wk = "P"
                End If
            End If
            r = wk
            Console.Write(r)
        Next
 
        Console.WriteLine()
 
    End Sub
End Module