qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
card = {
    'S':[False for _ in range(13)],
    'H':[False for _ in range(13)],
    'C':[False for _ in range(13)],
    'D':[False for _ in range(13)]
}
for _ in range(n):
    mark, num = map(int, input().split())
    card[mark][num-1] = True

for mark in "SHCD":
    for num in range(13):
        if card[mark][num] is False:
            print(mark, num+1)



Fixed code:
n = int(input())
card = {
    'S':[False for _ in range(13)],
    'H':[False for _ in range(13)],
    'C':[False for _ in range(13)],
    'D':[False for _ in range(13)]
}
for _ in range(n):
    mark, num = input().split()
    num = int(num)
    card[mark][num-1] = True

for mark in "SHCD":
    for num in range(13):
        if card[mark][num] is False:
            print(mark, num+1)
Buggy code:
h = [i for i in range(1,14)]
c = [i for i in range(1,14)]
d = [i for i in range(1,14)]
s = [i for i in range(1,14)]

x = int(input())

for i in range(x):
    ss, nn = map(str, input().split())

    try:
        if ss == "H":
            h.remove(int(nn))
        elif ss == "C":
            c.remove(int(nn))
        elif ss == "D":
            h.remove(int(nn))
        elif ss == "S":
            h.remove(int(nn))
    except ValueError:
        break

for i in range(len(s)):
    print ("S "+ str(s[i]))
    
for i in range(len(h)):
    print ("H "+ str(h[i]))

for i in range(len(c)):
    print ("C "+ str(c[i]))

for i in range(len(d)):
    print ("D "+ str(d[i]))


Fixed code:
h = [i for i in range(1,14)]
c = [i for i in range(1,14)]
d = [i for i in range(1,14)]
s = [i for i in range(1,14)]

x = int(input())

for i in range(x):
    ss, nn = map(str, input().split())

    try:
        if ss == "H":
            h.remove(int(nn))
        elif ss == "C":
            c.remove(int(nn))
        elif ss == "D":
            d.remove(int(nn))
        elif ss == "S":
            s.remove(int(nn))
    except ValueError:
        break

for i in range(len(s)):
    print ("S "+ str(s[i]))
    
for i in range(len(h)):
    print ("H "+ str(h[i]))

for i in range(len(c)):
    print ("C "+ str(c[i]))

for i in range(len(d)):
    print ("D "+ str(d[i]))
Buggy code:
n = int(input())

S = [1]*13
H = [1]*13
C = [1]*13
D = [1]*13

mark = [""]*n
num = [""]*n

for i in range(n):
    mark[i], num[i] = map(str, input().split())

for i in range(n):
    if mark[i] == "S":
        S[int(num[i])-1] = 0
    if mark[i] == "H":
        H[int(num[i])-1] = 0
    if mark[i] == "C":
        C[int(num[i])-1] = 0
    if mark[i] == "D":
        H[int(num[i])-1] = 0

for i in range(13):
    if S[i]:
        print("S " + str(i+1))
for i in range(13):
    if H[i]:
        print("H " + str(i+1))
for i in range(13):
    if C[i]:
        print("C " + str(i+1))
for i in range(13):
    if D[i]:
        print("D " + str(i+1))

Fixed code:
n = int(input())

S = [1]*13
H = [1]*13
C = [1]*13
D = [1]*13

mark = [""]*n
num = [""]*n

for i in range(n):
    mark[i], num[i] = input().split()

for i in range(n):
    if mark[i] == "S":
        S[int(num[i])-1] = 0
    if mark[i] == "H":
        H[int(num[i])-1] = 0
    if mark[i] == "C":
        C[int(num[i])-1] = 0
    if mark[i] == "D":
        D[int(num[i])-1] = 0

for i in range(13):
    if S[i]:
        print("S " + str(i+1))
for i in range(13):
    if H[i]:
        print("H " + str(i+1))
for i in range(13):
    if C[i]:
        print("C " + str(i+1))
for i in range(13):
    if D[i]:
        print("D " + str(i+1))
Buggy code:
n = int(input())
cards = {}
for i in range(n):
    card = input()
    cards[card] = 1
         
for c in ['S', 'H', 'C', 'D']:
    for n in range(1,14):
        key = c + ''+ str(n)
        if not key in cards:
            print(key)


Fixed code:
n = int(input())
cards = {}
for i in range(n):
         card = input()
         cards[card] = 1
         
for c in ['S', 'H', 'C', 'D']:
    for n in range(1,14):
        key = c + ' ' + str(n)
        if not key in cards:
            print(key)
Buggy code:
NumberOfSheet = int(input())
OwnedCards = [[str(i) for i in input().split()] for loop in range(NumberOfSheet)]
S = [int(0) for i in range(13)]
H = [int(0) for i in range(13)]
C = [int(0) for i in range(13)]
D = [int(0) for i in range(13)]
for i in OwnedCards:
  if i[0] == 'S' or i[0] == 'H' or i[0] == 'C' or i[0] == 'D':
    if i[0] == 'S': S[int(i[1]) - 1] = 1
    if i[0] == 'H': H[int(i[1]) - 1] = 1
    if i[0] == 'C': C[int(i[1]) - 1] = 1
    if i[0] == 'D': D[int(i[1]) - 1] = 1

for i in range(13): if S[i] == 0: print('S',i + 1)
for i in range(13): if H[i] == 0: print('H',i + 1)
for i in range(13): if C[i] == 0: print('C',i + 1)
for i in range(13): if D[i] == 0: print('D',i + 1)

Fixed code:
NumberOfSheet = int(input())
OwnedCards = [[str(i) for i in input().split()] for loop in range(NumberOfSheet)]
S = [int(0) for i in range(13)]
H = [int(0) for i in range(13)]
C = [int(0) for i in range(13)]
D = [int(0) for i in range(13)]
for i in OwnedCards:
  if i[0] == 'S' or i[0] == 'H' or i[0] == 'C' or i[0] == 'D':
    if i[0] == 'S': S[int(i[1]) - 1] = 1
    if i[0] == 'H': H[int(i[1]) - 1] = 1
    if i[0] == 'C': C[int(i[1]) - 1] = 1
    if i[0] == 'D': D[int(i[1]) - 1] = 1

for i in range(13):
  if S[i] == 0: print('S',i + 1)
for i in range(13):
  if H[i] == 0: print('H',i + 1)
for i in range(13):
  if C[i] == 0: print('C',i + 1)
for i in range(13):
  if D[i] == 0: print('D',i + 1)
Buggy code:
cards = int(input())
i = 0
cardlist = []
while(i < cards):
    cardlist.append(list(map(str,input().split())))
    i += 1
SP = [False] * 13
HR = [False] * 13
CL = [False] * 13
DY = [False] * 13

for i in cardlist:
    num = int(i[1])-1
    if  (i[0] == "S"):
        SP[num] = True
    elif(i[0] == "H"):
        HR[num] = True
    elif(i[0] == "C"):
        CL[num] = True
    elif(i[0] == "D"):
        DY[num] = True

c = 0
for i in SP:
    c += 1
    if i == False:
        print("S %d" %c)
c = 0
for i in HR:
    c += 1
    if i == False:
        print("H %d" %c)
c = 0
for i in CL:
    if i == False:
        print("C %d" %c)
c = 0
for i in DY:
    if i == False:
        print("D %d" %c)
print()


Fixed code:
cards = int(input())
i = 0
cardlist = []
while(i < cards):
    cardlist.append(list(map(str,input().split())))
    i += 1
SP = [False] * 13
HR = [False] * 13
CL = [False] * 13
DY = [False] * 13

for i in cardlist:
    num = int(i[1])-1
    if  (i[0] == "S"):
        SP[num] = True
    elif(i[0] == "H"):
        HR[num] = True
    elif(i[0] == "C"):
        CL[num] = True
    elif(i[0] == "D"):
        DY[num] = True

c = 0
for i in SP:
    c += 1
    if i == False:
        print("S %d" %c)
c = 0
for i in HR:
    c += 1
    if i == False:
        print("H %d" %c)
c = 0
for i in CL:
    c += 1
    if i == False:
        print("C %d" %c)
c = 0
for i in DY:
    c += 1
    if i == False:
        print("D %d" %c)
Buggy code:
c={
    'S':[1]*13,
    'H':[1]*13,
    'C':[1]*13,
    'D':[1]*13
}
n=int(input())
for i in range(n):
    a,b=input().split
    c[a][int(b)-1]=0
for i in ['S','H','C','D']:
    for j in range(13):
        if c[i][j]==1:
            print(i,j+1)




Fixed code:
c={
    'S':[1]*13,
    'H':[1]*13,
    'C':[1]*13,
    'D':[1]*13
}
n=int(input())
for i in range(n):
    a,b=input().split()
    c[a][int(b)-1]=0
for i in ['S','H','C','D']:
    for j in range(13):
        if c[i][j]==1:
            print(i,j+1)
Buggy code:
data = [
    "{0} {1}".format(s, r)
    for s in ('S', 'H', 'C', 'D')]
    for r in range(1, 13 + 1)
    ]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)

for c in data:
    print(c)

Fixed code:
data = [
     "{0} {1}".format(s, r) 
      for s in ('S', 'H', 'C', 'D')
      for r in range(1, 13 +1)
        ]
count = int(input())
for c in range(count):
      card = input()
      data.remove(card)
 
for c in data:
   print(c)
Buggy code:
N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(i.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
    card_list.append(["H",str(i)])
    card_list.append(["C",str(i)])
    card_list.append(["D",str(i)])
for i in card_list:
    if i not in taro_card:
        lost_list.append(i)
for i in lost_list:
    print(i[0]+" "+i[1])


Fixed code:
N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(i.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
for i in range(1,14):
    card_list.append(["H",str(i)])
for i in range(1,14):    
    card_list.append(["C",str(i)])
for i in range(1,14):    
    card_list.append(["D",str(i)])
for i in card_list:
    if i not in taro_card:
        lost_list.append(i)
for i in lost_list:
    print(i[0]+" "+i[1])
Buggy code:
count = int(input())
cards = []
for i in range(count):
    cards.append(input())
capitals = "SHCD"
for j in capitals:
    for k in range(1,14):
        if (j + " " + str(k)) in cards == False:
            print(j + " " + str(k))


Fixed code:
count = int(input())
cards = []
for i in range(count):
    cards.append(input())
capitals = "SHCD"
for j in capitals:
    for k in range(1,14):
        if ((j + " " + str(k)) in cards) == False:
            print(j + " " + str(k))
Buggy code:
cards = {
'S':[0 for i in range(13)],
'H':[0 for i in range(13)],
'C':[0 for i in range(13)],
'D':[0 for i in range(13)]
}
n = int(input())
for i in range(n):
    c, s = input().split()
    cards[c][int(s)-1] = int(s)
for i in ('S','H','C','D'):
    for j in range(0,13):
        if cards[i][j] == 0:
            print('{} {}'.format(i,j))

Fixed code:
cards = {
'S':[0 for i in range(13)],
'H':[0 for i in range(13)],
'C':[0 for i in range(13)],
'D':[0 for i in range(13)]
}
n = int(input())
for i in range(n):
    c, s = input().split()
    cards[c][int(s)-1] = int(s)
for i in ('S','H','C','D'):
    for j in range(13):
        if cards[i][j] == 0:
            print('{} {}'.format(i,j+1))
Buggy code:
s = range(1,14)
h = range(1,14)
c = range(1,14)
d = range(1,14)

n = int(input())
while n > 0:
    x = input().split(' ')
    if x[0] == 'S':
        s[x[1]-1] = 0
    elif x[0] == 'H':
        h[x[1]-1] = 0
    elif x[0] == 'C':
        c[x[1]-1] = 0
    elif x[0] == 'D':
        d[x[1]-1] = 0
    n -= 1

for t in s:
    if t != 0: print("S %d" % t)
for t in h:
    if t != 0: print("H %d" % t)
for t in c:
    if t != 0: print("C %d" % t)
for t in d:
    if t != 0: print("D %d" % t)

Fixed code:
s = list(range(1,14))
h = list(range(1,14))
c = list(range(1,14))
d = list(range(1,14))

n = int(input())
while n > 0:
    x = input().split(' ')
    x[1] = int(x[1])
    if x[0] == 'S':
        s[x[1]-1] = 0
    elif x[0] == 'H':
        h[x[1]-1] = 0
    elif x[0] == 'C':
        c[x[1]-1] = 0
    elif x[0] == 'D':
        d[x[1]-1] = 0
    n -= 1

for t in s:
    if t != 0: print("S %d" % t)
for t in h:
    if t != 0: print("H %d" % t)
for t in c:
    if t != 0: print("C %d" % t)
for t in d:
    if t != 0: print("D %d" % t)
Buggy code:
card = []
suit = ["S","H","C","D"]
for s in suit:
    for i in range(1,14):
        card.append(s + " " + str(i))

n = int(input())
for i in range(n)
    card.remove(input())

for c in card:
	print(c)

Fixed code:
card = []
suit = ["S","H","C","D"]
for s in suit:
    for i in range(1,14):
        card.append(s + " " + str(i))

n = int(input())
for i in range(n):
    card.remove(input())

for c in card:
	print(c)
Buggy code:
data = [
    "{0} {1}".format(s,r)
        for s in ('S','H','C','D')
        for r in range(1, 13+1)
]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)

    print("\n".join(data))

Fixed code:
data = [
    "{0} {1}".format(s,r)
        for s in ('S','H','C','D')
        for r in range(1, 13+1)
]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)
for c in data:
    print(c)
Buggy code:
card ={'S': [0]*13,
       'H': [0]*13,
       'C': [0]*13,
       'D': [0]*13
}

n = int(input())

for i in range(1,n+1):
    m,num = input().split()
    num = int(num)
    card[m][num-1] =1

for c in ["S","H","C","D"]:
    for j in range(1,14):
        if (card[c][i]==0):
            print(m,str(j))


Fixed code:
card ={'S': [0]*13,
       'H': [0]*13,
       'C': [0]*13,
       'D': [0]*13
}

n = int(input())

for i in range(1,n+1):
    m,num = input().split()
    num = int(num)
    card[m][num-1] =1

for c in ["S","H","C","D"]:
    for j in range(1,14):
        if (card[c][j-1]==0):
            print(c,str(j))
Buggy code:
cards = [[False] * 14 for i in range(4)]
n = int(input())
for i in range(n):
    suit, rank = input().split()
    r = int(rank)
    if suit == "S":
        s = 0
    elif suit == "H":
        s = 1
    elif suit == "C":
        s = 2
    else:
        s = 3
    cards[s][r] = True

name = ["S", "H", "C", "D"]
for s in range(4):
    for r in range(1, 14):
        if cards[s][r]:
            print(name[s], r)

Fixed code:
cards = [[False] * 14 for i in range(4)]
n = int(input())
for i in range(n):
    suit, rank = input().split()
    r = int(rank)
    if suit == "S":
        s = 0
    elif suit == "H":
        s = 1
    elif suit == "C":
        s = 2
    else:
        s = 3
    cards[s][r] = True

name = ["S", "H", "C", "D"]
for s in range(4):
    for r in range(1, 14):
        if not cards[s][r]:
            print(name[s], r)
Buggy code:
Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = int(input())
for i in range(n):
    Taro.append(input())
for j in range(52):
    card = Suits[j//13] + ' ' + str(j % 13 + 1)
    if card not in Taro:
        Missing.append(card)
if Missing == []:
    print('\n'.join(Missing))

Fixed code:
Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = int(input())
for i in range(n):
    Taro.append(input())
for j in range(52):
    card = Suits[j//13] + ' ' + str(j % 13 + 1)
    if card not in Taro:
        Missing.append(card)
if Missing != []:
    print('\n'.join(Missing))
Buggy code:
from collections import OrderedDict

cards = OrderedDict()
cards['S'] = set()
cards['H'] = set()
cards['D'] = set()
cards['C'] = set()

n = int(input())
for _ in range(n):
    suit, num = input().split()
    num = int(num)
    cards[suit].add(num)

for suit, nums in cards.items():
    for num in range(1,14):
        if num not in nums:
            print(suit, num)

Fixed code:
from collections import OrderedDict

cards = OrderedDict()
cards['S'] = set()
cards['H'] = set()
cards['C'] = set()
cards['D'] = set()

n = int(input())
for _ in range(n):
    suit, num = input().split()
    num = int(num)
    cards[suit].add(num)

for suit, nums in cards.items():
    for num in range(1,14):
        if num not in nums:
            print(suit, num)
Buggy code:
Suit = ["S","H","C","D"]
deck = []


for i in range(4):
    for n in range(1,14):
        tmp = (Suit[i]+" "+str(n))
        deck.append(tmp)

print (deck)

u = int(input())

for _ in range(u):
    s = str(input())
    if s in deck:
        deck.remove(s)

for y in range(len(deck)):
    print('{} {}'.format(deck[y][0],deck[y][2]))




Fixed code:
Suit = ["S","H","C","D"]
deck = []


for i in range(4):
    for n in range(1,14):
        tmp = (Suit[i]+" "+str(n))
        deck.append(tmp)

#print (deck)

u = int(input())

for _ in range(u):
    s = str(input())
    if s in deck:
        deck.remove(s)

for y in range(len(deck)):
    print('{}'.format(deck[y]))
Buggy code:
all_set = ['S ' + str(i) for i in range(1, 14)]　+ ['H ' + str(i) for i in range(1, 14)] + ['C ' + str(i) for i in range(1, 14)] + ['D ' + str(i) for i in range(1, 14)]
r = int(input())

for _ in range(r):
    x = input()
    if x in all_set:
        del all_set[all_set.index(x)]
        
for i in all_set:
    print(i)


Fixed code:
all_set = ['S ' + str(i) for i in range(1, 14)] + ['H ' + str(i) for i in range(1, 14)] + ['C ' + str(i) for i in range(1, 14)] + ['D ' + str(i) for i in range(1, 14)]
r = int(input())

for _ in range(r):
    x = input()
    if x in all_set:
        del all_set[all_set.index(x)]
        
for i in all_set:
    print(i)
Buggy code:
cards = {
	"S":[0]*13,
	"H":[0]*13,
	"C":[0]*13,
	"D":[0]*13
}

n = int(input())

for i in range(n):
	s, num = input().split()
	c[s][int(num)-1] = 1
	
for i in ["S", "H", "C", "D"]:
	for j in range(13):
		if[i][j] == 0:
			print(i,j+)

Fixed code:
cards = {
	"S":[0]*13,
	"H":[0]*13,
	"C":[0]*13,
	"D":[0]*13
}

n = int(input())

for i in range(n):
	s, num = input().split()
	cards[s][int(num)-1] = 1
	
for i in ["S", "H", "C", "D"]:
	for j in range(13):
		if cards[i][j] == 0:
			print(i,j+1)
Buggy code:
def main():
    
    deck = set()
    for item in range(1,14):
        deck = deck | {('H ' + str(item))}
        deck = deck | {('D ' + str(item))}
        deck = deck | {('C ' + str(item))}
        deck = deck | {('S ' + str(item))}
    suits_order = ['S', 'H', 'C', 'D']
    
    n = int(input())
    cards = [input() for i in range(n)]
    remains = sorted(sorted(list(deck - set(cards)), key = lambda x: suits_order.index(x[:1])), key = lambda x: int(x[2:]))
    for item in remains:
        print(item)


main()

Fixed code:
def main():
    
    deck = set()
    for item in range(1,14):
        deck = deck | {('H ' + str(item))}
        deck = deck | {('D ' + str(item))}
        deck = deck | {('C ' + str(item))}
        deck = deck | {('S ' + str(item))}
    suits_order = ['S', 'H', 'C', 'D']
    
    n = int(input())
    cards = [input() for i in range(n)]
    remains = sorted(sorted(list(deck - set(cards)), key = lambda x: int(x[2:])), key = lambda x: suits_order.index(x[:1]))
    for item in remains:
        print(item)


main()
Buggy code:
Cards = [
    "S 1", "S 2", "S 3", "S 4", "S 5", "S 6", "S 7", "S 8", "S 9", "S 10", "S 11", "S 12", "S 13"
    "H 1", "H 2", "H 3", "H 4", "H 5", "H 6", "H 7", "H 8", "H 9", "H 10", "H 11", "H 12", "H 13"
    "C 1", "C 2", "C 3", "C 4", "C 5", "C 6", "C 7", "C 8", "C 9", "C 10", "C 11", "C 12", "C 13"
    "D 1", "D 2", "D 3", "D 4", "D 5", "D 6", "D 7", "D 8", "D 9", "D 10", "D 11", "D 12", "D 13"
]

n = input()

for i in range(int(n)):
    rm = input()
    Cards.remove(rm)

for i in range(52 - int(n)):
    print(Cards.pop(0))


Fixed code:
Cards = [
    "S 1", "S 2", "S 3", "S 4", "S 5", "S 6", "S 7", "S 8", "S 9", "S 10", "S 11", "S 12", "S 13",
    "H 1", "H 2", "H 3", "H 4", "H 5", "H 6", "H 7", "H 8", "H 9", "H 10", "H 11", "H 12", "H 13",
    "C 1", "C 2", "C 3", "C 4", "C 5", "C 6", "C 7", "C 8", "C 9", "C 10", "C 11", "C 12", "C 13",
    "D 1", "D 2", "D 3", "D 4", "D 5", "D 6", "D 7", "D 8", "D 9", "D 10", "D 11", "D 12", "D 13",
]

n = input()

for i in range(int(n)):
    rm = input()
    Cards.remove(rm)

for i in range(52 - int(n)):
    print(Cards.pop(0))
Buggy code:
number = int(input())
dict = {}
for x in ["S","H","C","D"]:
        dict[x] = [i for i in range(1,14)]
for i in range(number):
    x,y = map(str,input().split())
    dict[x].remove(int(y))
print(dict)

Fixed code:
number = int(input())
dict = {}
for x in ["S","H","C","D"]:
        dict[x] = [i for i in range(1,14)]
for i in range(number):
    x,y = map(str,input().split())
    dict[x].remove(int(y))
for x in ["S","H","C","D"]:
    for i in dict[x]:
        print(x,i)
Buggy code:
cards = []
for i in set({'S','H','C','D'}):
    for j in range(1, 14):
        cards.append(i + " " + str(j))
N = int(input())
for i in range(N):
    cards.remove(input())

for i in range(len(cards)):
    print (cards[i])



Fixed code:
cards = []
for i in ['S','H','C','D']:
    for j in range(1, 14):
        cards.append(i + " " + str(j))
N = int(input())
for i in range(N):
    cards.remove(input())

for i in range(len(cards)):
    print (cards[i])
Buggy code:
# coding: utf-8
suits = ['S', 'H', 'C', 'D']
cards = [(suit + str(i)) for i in range(1, 14) for suit in suits]

for _ in range(int(input())):
    cards.remove(''.join(input().split()))

for trump in cards:
    print(trump[0], trump[1:])



Fixed code:
# coding: utf-8
suits = ['S', 'H', 'C', 'D']
cards = [(suit + str(i)) for suit in suits for i in range(1, 14)]

for _ in range(int(input())):
    cards.remove(''.join(input().split()))

for trump in cards:
    print(trump[0], trump[1:])
Buggy code:
cards = {
        'S': [r for r in range(1,13+1)],
        'H': [r for r in range(1,13+1)],
        'C': [r for r in range(1,13+1)],
        'D': [r for r in range(1,13+1)],
        }
n = int(input())
for nc in range(n):
    (s, r) = input().split()
    index = cards[s].index(int(r))
    del cards[s][index]

    for s in ['S', 'H', 'C', 'D']:
        for r in cards[s]:
            print(s, r)

Fixed code:
cards = {
        'S': [r for r in range(1,13+1)],
        'H': [r for r in range(1,13+1)],
        'C': [r for r in range(1,13+1)],
        'D': [r for r in range(1,13+1)],
        }
n = int(input())
for nc in range(n):
    (s, r) = input().split()
    index = cards[s].index(int(r))
    del cards[s][index]

for s in ['S', 'H', 'C', 'D']:
    for r in cards[s]:
        print(s, r)
Buggy code:
n = int(input())
spade = hart = club = diamond = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    elif suit == 'D':
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)

Fixed code:
n = int(input())
spade = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
hart = set(spade)
club = set(spade)
diamond = set(spade)
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    else:
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)
Buggy code:
n=int(input())
cards={}
for i in range(n):
    card =input()
    cards[card]=1
    
#print(cards)

for c in ['S','H','C','D']:
    for n in range (1,13):
        key=c+''+str(n)
        if not key in cards:
            print(key)


Fixed code:
n=int(input())
cards={}
for i in range(n):
    card =input()
    cards[card]=1
    
#print(cards)

for c in ['S','H','C','D']:
    for n in range (1,14):
        key=c+' '+str(n)
        if not key in cards:
            print(key)
Buggy code:
cards = {
        'S': [0 for - in range(13)],
        'H': [0 for - in range(13)],
        'C': [0 for - in range(13)],
        'D': [0 for - in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1

for s in ('S' 'H' 'C' 'D'):
    (s, r) = input().split()
    cards[s][int(r) + 1] = -1

Fixed code:
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
   
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)
Buggy code:
import itertools

n = int(input())
a = [input() for _ in range(n)]

suits = ['S', 'H', 'C', 'D']
cards = ["%s %d" % (s, r) for s, r in suits, range(1, 14)]
answers = [c for c in cards if c not in a]
for card in answers:
    print(card)



Fixed code:
import itertools

n = int(input())
a = [input() for _ in range(n)]

suits = ['S', 'H', 'C', 'D']
cards = ["%s %d" % (s, r) for s, r in itertools.product(suits, range(1, 14))]
answers = [c for c in cards if c not in a]
for card in answers:
    print(card)