import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

import scala.annotation.tailrec
import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val t = in.readLine()

    @tailrec
    def count(t: List[Char], result: ArrayBuffer[Char]): ArrayBuffer[Char] = {
      t match {
        case Nil => result
        case 'P' :: Nil => result.append('P')
        case _ :: Nil => result.append('D')
        case 'P' :: 'P' :: rest => count('P' :: rest, result.append('P'))
        case 'P' :: _ :: rest => count(rest, result.append('P').append('D'))
        case 'D' :: rest => count(rest, result.append('D'))
        case '?' :: 'D' :: rest => count(rest, result.append('P').append('D'))
        case '?' :: '?' :: rest => count(rest, result.append('P').append('D'))
        case '?' :: rest => count(rest, result.append('D'))
      }
    }

    out.println(count(t.toList, ArrayBuffer.empty[Char]).mkString(""))

    out.flush()
  }
}