qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
tmp = n
ans = n
y = tmp **0.5
o = int(y // 1)
for i in range(o+1):
    a=i+1
    print("a:"+str(a))
    b=n/(i+1)
    print("b:"+str(b))
    #print("a*b:"+str(a*b))
    if (b.is_integer()==True ):
        kari = max(len(str(a)),len(str(int(b))))
        print("kari:"+str(kari))
        ans = min(ans,kari)
print(ans)

Fixed code:
n = int(input())
tmp = n
ans = n
y = tmp **0.5
o = int(y // 1)
for i in range(o+1):
    a=i+1
    #print("a:"+str(a))
    b=n/(i+1)
    #print("b:"+str(b))
    #print("a*b:"+str(a*b))
    if (b.is_integer()==True ):
        kari = max(len(str(a)),len(str(int(b))))
        #print("kari:"+str(kari))
        ans = min(ans,kari)
print(ans)
Buggy code:
# -*- coding: utf-8 -*-
import math

n = int(input())
counter = 0

for i in range(int(math.sqrt(n)), 0, -1):
  if n % (i + 1) == 0:
    j = int(n / (i + 1))
    _keta = max(len(str(i + 1)), len(str(j)))
    print(_keta)
    break


Fixed code:
# -*- coding: utf-8 -*-
import math

n = int(input())
counter = 0

for i in range(int(math.sqrt(n)), 0, -1):
  if n % i == 0:
    j = int(n / i)
    _keta = max(len(str(i)), len(str(j)))
    print(_keta)
    break
Buggy code:
import sys
N=int(input())
ans=[]
if N==1:
    print(1)
    sys.exit()

for i in range(int(N**0.5),1,-1):
    if N%i==0:
        a=str(N//i)
        print(len(a))
        sys.exit()


Fixed code:
import sys
N=int(input())
ans=[]
if N==1:
    print(1)
    sys.exit()

for i in range(int(N**0.5),0,-1):
    if N%i==0:
        a=str(N//i)
        print(len(a))
        sys.exit()
Buggy code:
import math
n=int(input())
x=int(math.sqrt(n))

ans=0

for i in range(1,x+1):
    if n%i==0:
        ans=i
print(len(str(ans)))



Fixed code:
import math
n=int(input())
x=int(math.sqrt(n))

ans=0

for i in range(1,x+1):
    if n%i==0:
        ans=max(i,n//i)

print(len(str(ans)))
Buggy code:
N = int(input())
ans = 100000
for i in range(1,  10 ** 10):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


Fixed code:
N = int(input())
ans = 100000
for i in range(1, 13 * 10 ** 6):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)
Buggy code:
N = int(input())
ans = 100000
for i in range(1, 10 ** 8):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


Fixed code:
N = int(input())
ans = 100000
for i in range(1, 10 ** 5):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)
Buggy code:
# from pprint import pprint
import math

# import collections

n = int(input())


# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))


def f(a, b):
    return max(math.ceil(math.log10(a)), math.ceil(math.log10(b)))


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0:
        b = n // a
        if n % a == 0 and f(a, b) <= ans:
            ans = f(a, b)
    a += 1

print(ans)


Fixed code:
# from pprint import pprint
import math

# import collections

n = int(input())


# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))


def f(a, b):
    return max(math.floor(math.log10(a)) + 1, math.floor(math.log10(b)) + 1)


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0 and f(a, n // a) <= ans:
        # print('test', a, n // a, f(a, n // a))
        ans = f(a, n // a)
    a += 1

print(ans)
Buggy code:
from sys import stdin
N = int(stdin.readline().rstrip())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        print(i)
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

fact = make_divisors(N)

ans = 10000
for a in fact:
    b = N // a
    ans = min(ans,max(len(str(a)),len(str(b))))
print(ans)

Fixed code:
from sys import stdin
N = int(stdin.readline().rstrip())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        #print(i)
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

fact = make_divisors(N)

ans = 10000
for a in fact:
    b = N // a
    ans = min(ans,max(len(str(a)),len(str(b))))
print(ans)
Buggy code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

ans = sys.maxsize
for i in range(1, math.sqrt(n)+1, 1):
    if n % i == 0:
        b = n//i
        tmp_ans = max(len(str(i)), len(str(b)))
        ans = min(ans, tmp_ans)

print(ans)



Fixed code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

ans = sys.maxsize
for i in range(1, int(math.sqrt(n))+1, 1):
    if n % i == 0:
        b = n//i
        tmp_ans = max(len(str(i)), len(str(b)))
        ans = min(ans, tmp_ans)

print(ans)
Buggy code:
def f(a,b):
  digit_a = digit_b=0
  
  while a:
    digit_a+=1
    a//=10
    
  while b:
    digit_b+=1
    b//=10
    
  return max(digit_a, digit_b)

n = int(input())

ans = n
for i in range(1, int((n+1)**0.5)):
  for n%i==0:
    n = min(n, f(i, n//i))
    
print(ans)
    

Fixed code:
def f(a, b):
    digit_a = digit_b = 0

    while a:
        digit_a += 1
        a //= 10

    while b:
        digit_b += 1
        b //= 10

    return max(digit_a, digit_b)


n = int(input())

ans = n

for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        ans = min(ans, f(i, n // i))

print(ans)
Buggy code:
n = int(input())
ans = 10**10+1
for i in range(1, int(n**0.5)+1):
    if n%i != 0:
        continue
    n /= i
    if n <= ans:
        ans = n
ans = len(str(int(ans)))
print(ans)

Fixed code:
n = int(input())
ans = 10**10+1
for i in range(1, int(n**0.5)+1):
    if n%i != 0:
        continue
    tmp = n
    tmp /= i
    if tmp <= ans:
        ans = tmp
ans = len(str(int(tmp)))
print(ans)
Buggy code:
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

if N == 1:
    print(1)
else:
    C = res(0, [], [])
    min(C)

Fixed code:
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

if N == 1:
    print(1)
else:
    C = res(0, [], [])
    print(min(C))
Buggy code:
n=int(input())
f=[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        f.append(i)
        f.append(int(n/i))
print(f)
if n==1:
    print('1')
else:
    print(len(str(f[-1])))


Fixed code:
n=int(input())
f=[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        f.append(i)
        f.append(int(n/i))
if n==1:
    print('1')
else:
    print(len(str(f[-1])))
Buggy code:
from itertools import combinations
from functools import reduce
from operator import mul
def prime_dec(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(n)
  return table

n = int(input())
ps = prime_dec(n)
ps_com = []
for i in range(len(ps)):    
    ps_com += set(combinations(ps, i))
divs = [reduce(mul, k) for k in ps_com if not len(k) == 0]
divs_twin = [(k, int(n/k)) for k in divs]
divs_twin = set(divs_twin)
divs_twin_len = [max(len(str(k[0])) ,len(str(k[1])))  for k in divs_twin]

print(min(divs_twin_len))



Fixed code:
from itertools import combinations
from functools import reduce
from operator import mul
def prime_dec(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(n)
  return table

n = int(input())
ps = prime_dec(n)
ps = [1] if len(ps) == 0 else ps
ps_com = []
for i in range(len(ps)):    
    ps_com += set(combinations(ps, i+1))
divs = [reduce(mul, k) for k in ps_com if not len(k) == 0]
divs_twin = [(k, int(n/k)) for k in divs]
divs_twin = set(divs_twin)
divs_twin_len = [max(len(str(k[0])) ,len(str(k[1])))  for k in divs_twin]

print(min(divs_twin_len))
Buggy code:
import math

def alldiv(x):
    div = [[1,x]]
    for i in range(2,math.floor(math.sqrt(x))+1):
        if x % i == 0:
            div.append([i, x//i])
    return div


def digit(N):
    d = 0
    while(N > 0):
        N //= 10
        d += 1
    return d


N = int(input())
div = alldiv(N)
print(div)
F = [max(digit(i[0]),digit(i[1])) for i in div]
print(min(F))



Fixed code:
import math

def alldiv(x):
    div = [[1,x]]
    for i in range(2,math.floor(math.sqrt(x))+1):
        if x % i == 0:
            div.append([i, x//i])
    return div


def digit(N):
    d = 0
    while(N > 0):
        N //= 10
        d += 1
    return d


N = int(input())
div = alldiv(N)
#print(div)
F = [max(digit(i[0]),digit(i[1])) for i in div]
print(min(F))
Buggy code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=input().split("")

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

Fixed code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=input().split()

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

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

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

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

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


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

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

Fixed code:
a,b = input().split()
if (a == b):
  print('H')
else:
  print('D')
Buggy code:
a,b = [int(i) for i in input().split()]
if a=='H':
  if b=='H':
    print('H')
  else:
    print('D')
else:
  if b=='H':
    print('D')
  else:
    print('H')

Fixed code:
a,b = [i for i in input().strip().split()]
if a=='H':
  if b=='H':
    print('H')
  else:
    print('D')
else:
  if b=='H':
    print('D')
  else:
    print('H')
Buggy code:
a, b = map(str, input().split())
if a == 'D':
  print(b)
else:
  if b == 'H':
    print('D')
  else:
    print('H')

Fixed 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")
Buggy code:
H,D = input().split()
if H == D:
    print(H)
else:
    print(D)

Fixed code:
H,D = input().split()
if H == D:
    print("H")
else:
    print("D")
Buggy code:
l_vec = input().split()
def classifier1(l) :
    if ((l[0] == 'H') and (l[1] == 'H')) or ((l[0] == 'D') and (l[1] == 'D')) :
        return 'H'
    else :
        return 'D'
classifier1(l_vec)

Fixed code:
l_vec = input().split()
def classifier1(l) :
    if ((l[0] == 'H') and (l[1] == 'H')) or ((l[0] == 'D') and (l[1] == 'D')) :
        return 'H'
    else :
        return 'D'
print(classifier1(l_vec))
Buggy code:
s=input().split()

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

Fixed code:
s=input().split()

if s[0]==s[1]:
  print('H')
else:
  print('D')
Buggy code:
A, B = map(str,input().split())
if A == "H":
  if B == "H":
    print("H")
  else:
    print("D")
else:
  if B == "D":
    print("D")
  else:
    print("H")

Fixed 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")
Buggy code:
a, b = input().split()
a = 1 if a == 'H' else -1
b = 1 if a == 'H' else -1
if a * b == 1:
    print('H')
else:
    print('D')


Fixed code:
a, b = input().split()
a = 1 if a == 'H' else -1
b = 1 if b == 'H' else -1
if a * b == 1:
    print('H')
else:
    print('D')
Buggy code:
a, b = list(map(int, input().split()))
if (a == 'H' and b == 'H') or (a == 'D' and b == 'D'):
    print('H')
else:
    print('D')

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

Fixed code:
a,b = input().split()
if a==b:
    print("H")
else:print("D")
Buggy 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")

Fixed code:
a, b = list(input().split())
if a == b:
    print('H')
else:
    print('D')
Buggy code:
a, b = map(int, input().split())
if a == "H" and b == "H":
    print("H")
elif a == "D" and b == "D":
    print("H")
else:
    print("D")

Fixed 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")
Buggy code:
a,b=input().split()
if a="H":
  print(b)
else:
  if b="H":
    print("D")
  else:
    print("H")


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

Fixed 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')
Buggy code:
a,b = input().split()
if a == H:
  if b == H:
    print("H")
  else:
    print("D")
else if a == D:
  if b == H:
    print("D")
  else:
    print("H")

Fixed 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")
Buggy code:
a,b = map(str,input().split())
if a == H:
  if b == H:
    print("H")
  else:
    print("D")
else if a == D:
  if b == H:
    print("D")
  else:
    print("H")

Fixed code:
a,b=map(str, input().split())
if a==b:
  print("H")
else:
  print("D")
Buggy 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=="D":
    print("H")
else:
    print("D")

Fixed 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 == "D":
    print("H")
else:
    print("D")
Buggy code:
a,b = input().split()
if a=='H' xor b=='H':
  print("D")
else:
  print("H")

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

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

Fixed code:
a,b = input().split()
if (a == 'H') ^ (b == 'H'):
  print('D')
else:
  print('H')
Buggy code:
a,b=map(input().split())
if a==b:
  print("H")
else:
  print("D")

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


Fixed code:
a,b = map(str , input().split())
if a == "H":
    if b == "H":
        print("H")
    else:
        print("D")
elif b == "H":
        print("D")
else:
        print("H")
Buggy code:
s = input()

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

Fixed code:
s = input()

if s == "D D" or s == "H H":
  print("H")
else:
  print("D")
Buggy code:
a,b = list(map(int,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")

Fixed 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")
Buggy code:
a, b = map(str, input().split())

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

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

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

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

Fixed code:
a,b=input().split()
if a=='H' and b=='H':print('H')
elif a=='D' and b=='D':print('H')
else:print('D')
Buggy code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


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

Fixed code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


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

Fixed code:
a,b=input().split()
print('D' if (a=='H')^(b=='H') else 'H')
Buggy code:
a,b=input().split()
if a!="D":
	print("H")

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

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

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

Fixed code:


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

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


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

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

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

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

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

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


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

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

Fixed 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")
Buggy code:
a,b =map(str ,input().split()))
if b=="H:
  print(a):
else b=="D":
  if a=="H":
    print("D"):
  if a=="D":
    print("H")
  

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

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

if a == b:
    print('H')
else:
    print('D')
Buggy code:
a,b = [x for x in input().split()]
if(a=='H' and b=='H'):
  print('YES')
elif(a=='D' and b=='D'):
  print('YES')
else:
  print('NO')

Fixed code:
a,b = [x for x in input().split()]
if(a=='H' and b=='H'):
  print('H')
elif(a=='D' and b=='D'):
  print('H')
else:
  print('D')
Buggy code:
a=input()
if a[0] !=a[2]:
    print("H")
else:
    print("D")

Fixed code:
a=input()
if a[0] !=a[2]:
    print("D")
else:
    print("H")
Buggy code:
a,b = list(map(int, input().split()))
if a == "H" and b == "H":
    print("H")
elif a == "D" and b == "D":
    print("H")
else:
    print("D")

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

print(a)

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