Two deer, AtCoDeer and TopCoDeer, are playing a game called Honest or Dishonest.
In this game, an honest player always tells the truth, and an dishonest player always tell lies.
You are given two characters a and b as the input. Each of them is either H or D, and carries the following information:
If a=H, AtCoDeer is honest; if a=D, AtCoDeer is dishonest.
If b=H, AtCoDeer is saying that TopCoDeer is honest; if b=D, AtCoDeer is saying that TopCoDeer is dishonest.
Given this information, determine whether TopCoDeer is honest.

-----Constraints-----
 - a=H or a=D.
 - b=H or b=D.

-----Input-----
The input is given from Standard Input in the following format:
a b

-----Output-----
If TopCoDeer is honest, print H. If he is dishonest, print D.

-----Sample Input-----
H H

-----Sample Output-----
H

In this input, AtCoDeer is honest. Hence, as he says, TopCoDeer is honest.

Difficulty: introductory

Starter code:

Solutions:
# 入力
a, b = input().split()

# 出力
# a = 'H' のときatくんは正直者
if a == 'H' and b == 'H':
    print('H')
elif a == 'D' and b == 'H':
    print('D')
elif a == 'H' and b =='D':
    print('D')
elif a == 'D' and b == 'D':
    print('H')

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

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

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

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


# A - HonestOrDishonest

# a, bにそれぞれ文字'H','D'が入力されるので、'H'か'D'を判定し出力する


a, b = input().split()

if a == 'H':
    if b == 'H':
        print('H')
    elif b == 'D':
        print('D')
elif a == 'D':
    if b == 'H':
        print('D')
    elif b == 'D':
        print('H')


# シカのAtCoDeerくんとTopCoDeerくんが「正直者か嘘つきか」ゲームをしています。
# このゲームでは、正直者は常にほんとうのことを言い、嘘つきは常に嘘を言います。
# 文字 a と b が入力として与えられます。
# これらはそれぞれ H か D のどちらかです。
# a=H のとき、AtCoDeerくんは正直者です。
# a=D のとき、AtCoDeerくんは嘘つきです。
# b=H のとき、AtCoDeerくんは「TopCoDeerくんは正直者だ」と発言しています。
# b=D のとき、AtCoDeerくんは「TopCoDeerくんは嘘つきだ」と発言しています。
#
# これらから判断して、TopCoDeerくんが正直者かどうか判定してください。

# 制約
# a='H' または 'D'
# b='H' または 'D'


# 標準入力から文字列 a と b を取得する
input_a, input_b = list(map(str,input().split()))

reslut = "ret"

# TopCoDeerくんが正直者かどうか判定し、結果を出力する。
# ※ 正直者=="H"、嘘つき=="D"
if input_a == "H":  # AtCoDeerくんが正直者の場合
    if input_b == "H":
        result = "H"
    elif input_b == "D":
        result = "D"
elif input_a == "D":    # AtCoDeerくんが嘘つき者の場合（条件増えた時ようにelifにした）
    if input_b == "H":
        result = "D"
    elif input_b == "D":
        result = "H"
else:
    reslut = "I don't Know."

print(result)




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

if a == b:
    print("H")
elif a != b:
    print("D")

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

a,b = input().split()

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

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

a,b = input().split()

if a == b:
  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')

a, b = input().split()

if a == 'H':
    print(b)
elif a == 'D':
    print('HD'[int(not 'HD'.index(b))])

'''
abc056 A - Honest Or Dishonest
https://atcoder.jp/contests/abc056/tasks/abc056_a
'''

a, b = input().split()

if a == 'H': #AtCoDeer正直
    if b == 'H': #AtCoDeerくん「TopCoDeerくんは正直」
        TopCoDeer = 'H'
    else:
        TopCoDeer = 'D'
else:
    if b == 'H':
        TopCoDeer = 'D'
    else:
        TopCoDeer = 'H'
print(TopCoDeer)


a, b = input().split()
hd = "HD"
print((hd[(hd.index(a) + hd.index(b)) % 2]))


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

import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10**9)
MOD = 10**9 + 7
#MOD = 998244353


def si(): return input()
def ii(): return int(input())
def fi(): return float(input())
def lstr(): return input().split()
def lint(): return list(map(int, input().split()))
def lint_dec(): return list(map(lambda x:int(x) - 1, input().split()))
def lnstr(n): return [input() for _ in range(n)]
def lnint(n): return [int(input()) for _ in range(n)]
def lint_list(n): return [lint() for _ in range(n)]



############################################################
a, b = lstr()
print('H' if a == b else 'D')

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


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

#   AtCoder abc056 a
#   ストレッチ課題

#   入力
a, b = list(map(str, input().split()))

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


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

A,B = input().split()

print('H') if (A == 'D' and B == 'D') or (A == 'H' and B == 'H') else print('D')

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

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

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

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


# A - HonestOrDishonest
# https://atcoder.jp/contests/abc056/tasks/abc056_a

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

h = 'H'
d = 'D'

result = h

if a == h:
    if b == d:
        result = d
else:
    if b == h:
        result = d
    else:
        result = h

print(result)


print(('HD'[len(set(input()))%2]))



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

#   AtCoder abc056 a
#   ストレッチ課題

#   入力
a, b = list(map(str, input().split()))

#   判定
# if ((a == "H") and (b == "H")) or ((a == "D") and (b == "D")):
#     print("H")
# else:
#     print("D")
if a == b:
    print("H")
else:
    print("D")


# a atcooderkunの真偽  b atcooderkunの言動
# # b=H at「TOP本当」　b=D at「TOP嘘だ！
#    対応関係　〇　×
# 　　　　　　　×　〇

a, b = input().split()

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

# 入力
a,b = map(str, input().split())

# HHとDDはH、それ以外はD
if a == 'H' and b == 'H':
    print('H')
elif a == 'D' and b == 'D':
    print('H')
else:
    print('D')

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

a,b = input().split()

print("H" if a == b else "D")

s = input().split()
if s[0] == s[1]:
  print("H")
else:
  print("D")

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

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


#ABC056A
a,b = input().split()
print("H" if (a=="H" and b=="H") or (a=="D" and b=="D") else "D")

a, b = input().split()

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

a, b = input().split()

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

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

deck = ["H","D"]
a,b = input().split()
if deck.index(a) == 0:
  print(b)
elif deck.index(b) == 0:
  print(deck[1])
else:
  print(deck[0])

a, b = input().split()

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

a,b=map(str,input().split())
if a=='H': print(b)
elif b=='H': print(a)
else:print('H')

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

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

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

elif (a == 'H' and b == 'D') or (a == 'D' and b == 'H'):
    print('D')

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

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


a,_,b = input()
if a=="H"and b=="H":
    print("H")
elif a=="H"and b=="D":
    print("D")
elif a=="D"and b=="H":
    print("D")
else:
    print("H")

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

# a=Hのときb=Hで正直者、a=Dの時b=Dで正直者

a, b = map(str, input().split())
if a == b:
    print('H')
else:
    print('D')

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


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


S =input().replace("H","0")
S = S.replace('D','1')
S_list = list(map(int,S.split()))

if  S_list[0] ^ S_list[1] == 0 :
    result = "H"
else:
    result = "D"
print(result)

# A - HonestOrDishonest
def main():
    a, b = input().split()

    if a == 'H':
        if b == 'H':
            print('H')
        else:
            print('D')
    else:
        if b == 'H':
            print('D')
        else:
            print('H')
  
        
def __starting_point():
    main()
__starting_point()

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

a,b = input().split()

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

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

a,b = input().split()
if a == 'H' and b == 'H':
  print('H')
elif a == 'H' and b == 'D':
  print('D')
elif a == 'D' and b == 'H':
  print('D')
else:
  print('H')

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

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

print('H' if a == b else 'D')

say = ''.join(input().split())
if say=='HH' or say== 'DD':
    print('H')
else:
    print('D')

# 入力
a, b = map(str,input().split())

# 処理
if a == b:
    TopCoDeer = 'H'
else:
    TopCoDeer = 'D'

# 出力
print(TopCoDeer)

a, b = input().split()
print("DH"[a == b])

a,b = list(map(str,input().split()))
if a == 'H' and b== 'H':
    print('H')
elif a == 'H' and b== 'D':
    print('D')
elif a == 'D' and b== 'H':
    print('D')
else:
    print('H')


a, b = input().split()

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


a, b = input().split()

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


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

if a=='H':
    a=1
else:
    a=0
if b=='H':
    b=1
else:
    b=0

if a^b==0:
    print('H')
else :
    print('D')

s={'H':0,'D':1}
t=0
a=input().split()

for i in range(2):
  t+=s[a[i]]
  
if t%2!=0:
  print('D')
  
else:
  print('H')

# 文字列を取得
a,b = map(str,input().split())

# 条件に沿ったメッセージを出力
if a == b:
    print("H")
else:
    print("D")

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


# シカのAtCoDeerくんとTopCoDeerくんが「正直者か嘘つきか」ゲームをしています。
# このゲームでは、正直者は常にほんとうのことを言い、嘘つきは常に嘘を言います。
# 文字 a と b が入力として与えられます。
# これらはそれぞれ H か D のどちらかです。
# a=H のとき、AtCoDeerくんは正直者です。
# a=D のとき、AtCoDeerくんは嘘つきです。
# b=H のとき、AtCoDeerくんは「TopCoDeerくんは正直者だ」と発言しています。
# b=D のとき、AtCoDeerくんは「TopCoDeerくんは嘘つきだ」と発言しています。
#
# これらから判断して、TopCoDeerくんが正直者かどうか判定してください。

# 制約
# a='H' または 'D'
# b='H' または 'D'


# 標準入力から文字列 a と b を取得する
input_a, input_b = list(map(str,input().split()))

reslut = "ret"

# TopCoDeerくんが正直者かどうか判定し、結果を出力する。
# ※ 正直者=="H"、嘘つき=="D"
if input_a == "H":  # AtCoDeerくんが正直者の場合
    if input_b == "H":
        result = "H"
    elif input_b == "D":
        result = "D"
elif input_a == "D":    # AtCoDeerくんが嘘つき者の場合（条件増えた時ようにelifにした）
    if input_b == "H":
        result = "D"
    elif input_b == "D":
        result = "H"
else:
    reslut = "I don't Know."

print(result)




a,b=input().split();print([['H','D'][b=='H'],b][a=='H'])

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

# 056_a
a, b = input().split()
if (a == 'H' or a == 'D') and (b == 'H' or b == 'D'):
    if a == 'H':
        if b=='H':
            print('H')
        else:
            print('D')
    if a == 'D':
        if b=='H':
            print('D')
        else:
            print('H')


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

a = input().split()
if (a[0] == 'H' and a[1] == 'H') or (a[0] == 'D' and a[1] == 'D'):
    print('H')
else:
    print('D')

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

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


#56
a,b=input().split()
if (a=='H' and b=='H'):
    print('H')
elif (a=='H' and b=='D'):
    print('D')
elif (a=='D' and b=='H'):
    print('D')
else:
    print('H')

a,b=input().split();print(['HD'.replace(b,''),b][a=='H'])

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 = input().split()
print('H' if (a == 'H') ^ (b == 'D') else 'D')

# 入力
a,b = map(str, input().split())

if a == 'H' and b == 'H':
    print('H')
elif 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")

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

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

if a == 'H':
    if b == 'H':
        ans = 'H'
    else:
        ans = 'D'
else:
    if b == 'H':
        ans = 'D'
    else:
        ans = 'H'

print(ans)

a, b = input().split()
print("DH"[a==b])

print("HD"[len(set(input().split()))-1])

a, b = input().split()

if a == 'H' and b == 'H':
    result = 'H'
    
if a == 'D' and b == 'H':
    result = 'D'
    
if a == 'D' and b == 'D':
    result = 'H'
    
if a == 'H' and b == 'D':
    result = 'D'
    
print(result)

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

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

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

# 056a

# a=H, b=H TCD君は正直者
# a=H, b=D TCD君は嘘つき
# a=D, b=H TCD君は嘘つき
# a=D, b=D TCD君は正直者

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

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


a, b = input().split()
print(("D", "H")[a == b])

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


#n = int(input())
a, b = list(map(str,input().split()))
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

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


#!/usr/bin/env python3

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


def __starting_point():
    main()

__starting_point()

a, b = list(map(str, input().split()))
if a == b:
    print('H')
else:
    print('D')


a, b = input().split()

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


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

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