a, b = input().split()

if a == "H":

    print(b)

else:

    if b == "H":

        print("D")

    else:

        print("H")

a, b = input().split()

hd = "HD"

if a == "H":

    print(b)

else:

    print((hd[hd.index(b) - 1]))

a, b = input().split()
if a == "H":
    print(b)
else:
    if b == "H":
        print("D")
    else:
        print("H")

a, b = input().split()
hd = "HD"
if a == "H":
    print(b)
else:
    print((hd[hd.index(b) - 1]))

+hd = "HD" -    if b == "H": -        print("D") -    else: -        print("H") +    print((hd[hd.index(b) - 1]))