a, b = map(str, input().split())

if (a == 'H' and b == 'H') or (a == 'D' and b == 'D'):
    print('H')
else:
    print("D")

a, b = map(str, input().split())

if (a == 'H' and b == 'H') or (a == 'D' and b == 'D'):
    print('H')
else:
    print("D")
