Problem:


Score : 100 points

Problem Statement

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 1

H H

Sample Output 1

H

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

Sample Input 2

D H

Sample Output 2

D

In this input, AtCoDeer is dishonest. Hence, contrary to what he says, TopCoDeer is dishonest.

Sample Input 3

D D

Sample Output 3

H



Sample input:
H H


Sample output:
H

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    a, b = map(str, sys.stdin.readline().split())

    print("DH"[a == b])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    a, b = map(str, sys.stdin.readline().split())

    if a == "H" and b == "H":
        ret = "H"
    elif a == "H" and b == "D":
        ret = "D"
    elif a == "D" and b == "H":
        ret = "D"
    elif a == "D" and b == "D":
        ret = "H"

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A
a, b = map(str, 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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(str, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#056_A
a,b=input().split()
print('H' if a==b else 'D')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = input().split()

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

    else:
        print("D")

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

    else:
        print("H")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=input().split()
if a=='H':
  print(b)
else:
  print('HD'[b=='H'])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a,b = readline().rstrip().decode('utf-8').split()

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#----------
a,b = input().rstrip().split()
#----------

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

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

Submission status: Accepted

Solution code:
a, b = map(str, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
a,b = input().split()

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

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
h, d = map(str, input().split())

if h == d:
  print('H')
else:
  print('D')

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
a,b = input().split()

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

Submission status: Accepted

Solution code:
v=list(input().split(' '))
if v[0]==v[1]:
    print('H')
else:
    print('D')

Submission status: Accepted

Solution code:
#ABC056 A

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")
elif a == "D" and b == "D":
  print("H")

Submission status: Accepted

Solution code:
A,B=map(str,input().split())
if A=="H":
	print(B)
else:
	if B=="H":
		print("D")
	else:
		print("H")

Submission status: Accepted

Solution code:
a = input()
print(["D","H"][a[0]==a[2]])

Submission status: Accepted

Solution code:
a,b = input().split()
print('HD'[a!=b])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(str,input().split())


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,t = map(str, input().split())

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

Submission status: Accepted

Solution code:
a,b = input().split()
print('DH'[a==b])

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 056
# A - HonestOrDishonest
a, b = map(str, input().split())
if a == 'H':
    print(b)
else:
    if b == 'H':
        print('D')
    else:
        print('H')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = input().split()
t = {'HH': 'H', 'HD': 'D', 'DH': 'D', 'DD':'H'}
print(t[a+b])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = list(map(str, input().split()))
p = a + b
p1 = list(set(p))
if len(p1) == 1:
    print("H")
else:
    print("D")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[a,b]=list(input().split())
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    ans="H"
else:
    ans="D"
print(ans)

Submission status: Accepted

Solution code:
# 入力　文字列2つ
a, b = input().split()

# TopCoDeerくんが正直者かどうか判定してください。
# H H - H, H D - D, D D - H, D H - D

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')
elif a == 'D' and b == 'D':
  print('H')

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = input().split()

lis = ["_", "H", "D"]

if a == "H":
	print(b)
else:
	print(lis[lis.index(b)*-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def hd(a,b):
    ans = ""
    if a == "H":
        ans = "H" if b == "H" else "D"
    else:
        ans = "D" if b == "H" else "H"

    return ans

def main():
    a , b = map(str, input().split())
    print(hd(a , b))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    A, B = input().split()
    print('H'if A == B else 'D')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b=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")

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
h,d=map(str,input().split())
if h=='H' and d=='H':
    print('H')
elif h=='H' and d=='D':
    print('D')
elif h=='D' and d=='H':
    print('D')
else:
    print('H')

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

a, b = read().decode('utf8').split()

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

Submission status: Accepted

Solution code:
a, b = tuple(input().split())


def judge():
    def sub_judge1():
        if a == 'H':
            return True
        else:
            return False
    def sub_judge2():
        if b == 'H':
            return True
        else:
            return False

    if sub_judge2():
        return sub_judge1()
    else:
        return not sub_judge1()


if judge():
    print('H')
else:
    print('D')

Submission status: Accepted

Solution code:
A,B=input().split()
if A==B:
  print('H')
else:
  print('D')

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    a, b = input().split()

    # print(a, b)

    c = b == "H"
    return c if a == "H" else not c


if __name__ == '__main__':
    res = solve()
    print("H") if res else print("D")

Submission status: Accepted

Solution code:
a, b = 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")

Submission status: Accepted

Solution code:
s=input()
print("H" if s=="H H" or s=="D D" else "D")

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
a,b = input().split()

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

Submission status: Accepted

Solution code:
A, B= map(str,input().split())

if A == B:
    print("H")
else:
    print("D")

Submission status: Accepted

Solution code:
a, b = input().split() #D D
print("DH"[a==b])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
arr = input().split()
arr = list(map(str,arr))
a = arr[0]
b = arr[1]
if a == 'H' and b == 'H':
    print('H')
elif a == 'D' and b == 'H':
    print('D')
elif a == 'D' and b == 'D':
    print('H')
elif a == 'H' and b == 'D':
    print('D')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(str, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = input().split()

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = 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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(lambda a: 1 if a == 'H' else -1, input().split())
print('H' if a * b == 1 else 'D')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a,b=input().split()
if a=="H":
    print(b)
else:
    if b=="H":
        print("D")
    else:
        print("H")

Submission status: Accepted

Solution code:
a,b = input().split()

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

Submission status: Accepted

Solution code:
a, b = input().split(" ")

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

Submission status: Accepted

Solution code:
a,b=input().split()

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

Submission status: Accepted

Solution code:
a, b = map(str, input().split())

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

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

Submission status: Accepted

Solution code:
a, b = map(str, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


import numpy as np
import math


s=input()
c=s.count("H")
if(c%2==0):
    print("H")
else:
    print("D")

Submission status: Accepted

Solution code:
lst = input().split()

if(lst[0] == 'H'):
    print(lst[1])
else:
    if(lst[1] == 'H'):
        print('D')
    else:
        print('H')

Submission status: Accepted

Solution code:
a, b = map(str, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")
elif a=="D" and b=="D":
    print("H")

Submission status: Accepted

Solution code:
a,b= list(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')

Submission status: Accepted

Solution code:
a,b = input().split()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (i for i in input().split())

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

Submission status: Accepted

Solution code:
A, B = [s == "H" for s in input().split()]

print(["H", "D"][A ^ B])

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a, b = input().split()
if a == "H":
    print(b)
else:
    if b == "H":
        print("D")
    else:
        print("H")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=input().split()
if l[0]=='H':
    print(l[1])
else:
    if l[1]=='H':
        print('D')
    else:
        print('H')

Submission status: Accepted

Solution code:
[a,b] = input().split()
print("H" if (a == "H") ^ (b == "D") else "D")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    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')
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
a,_,b=input()
print('DH'[a==b])

Submission status: Accepted

Solution code:
a, b = input().split()

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

Submission status: Accepted

Solution code:
A,B = map(str,input().split())
print('H' if A==B else 'D')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(str,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,  b = map(str, input().split())

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

Submission status: Accepted

Solution code:
a,b = map(str,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(input().split())
if a.count("D")==1:
  print("D")
else:
  print("H")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-S
a,b = 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")
elif a == "D" and b == "D":
    print("H")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
a,b = map(str, input().split())

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

a,b= map(str, sys.stdin.readline().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
import sys

a, b = sys.stdin.readline().split()
a = 1 if a == 'H' else 0
b = 1 if b == 'H' else 0

def main():
    return 'D' if a ^ b else 'H'

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
s = input()
if s == "H H" or s == "D D" : 
   print( "H" ) 
else : 
   print( "D" )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d,_,h=input()
print("H" if d==h else "D")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ab = input()

if ab[0] == ab[2]:
    print('H')
else:
    print('D')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
coder_type, anser = input().split()
if coder_type == "D":
  if anser == "H":
    anser = "D"
  else:
    anser = "H"

print(anser)

Submission status: Accepted

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

Submission status: Accepted

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