program main
      implicit none
      character(200000) :: t
      integer :: i, tlen

      read *, t
      tlen = len_trim(t)

      do i = tlen, 1, -1
        if (t(i:i) == "?") then
          if( i == tlen ) then
            t(i:i) = "D"
          else
            if ( t(i+1:i+1) == "D" ) then
              t(i:i) = "P"
            else if ( t(i+1:i+1) == "P" ) then
              t(i:i) = "D"
            end if
          end if
        end if
      end do

      print *, trim(t)

end program main