program prob18
    implicit none
    character :: a,b
    logical :: c,d
    read(*,*) a,b
    if(a == 'H') then
        c = .true.
    else
        c = .false.
    end if

    if(b == 'H') then
        d = .true.
    else
        d = .false.
    end if

    if(xor(c,d)) then
        write(*,'(a)') 'D'
    else
        write(*,'(a)') 'H'
    end if

    stop
contains
end program prob18