import Foundation

func result(_ strings: [String]) -> (String, Int) {
  var point = 0
  var str = strings
for i in 0..<str.count {
  let s = str[i]
  if s == "?" {
	if str[i - 1] == "P" {
      str[i] = "D"
    } else {
      str[i] = "P"
    }
  }
  
  if s == "D" {
    if i == 0 || str[i - 1] != "P" {
      point += 1
    } else {
      point += 2
    }
  }
}
return (str.joined(), point)
}

var str = Array(readLine()!).map { String($0) }
var res: String = ""
if str[0] == "?" {
  var tmp = str
  tmp[0] = "P"
  let res1 = result(tmp)
  tmp[0] = "D"
  let res2 = result(tmp)
  if res1.1 > res2.1 {
    print(res1.0)
  } else {
    print(res2.0)
  }
} else {
  print(result(str).0)
}

