Buggy python submission (verdict: Runtime Error):
suits = [('S', 0), ('H', 1), ('C', 2), ('D', 3)]

def tonum(suit):
    for i in range(4):
        if suit == suits[i][0]: return suits[i][1]

def tosuit(num):
    return suits[num][0]

def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum[a[0]] * 13 + int(a[1]))
    cards.reverse()
    for i in cards:
        print(tosuit(i // 13) + " " + (i % 13))
    
        
        







if __name__ == "__main__":
    main()


Fixed submission:
def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3
    
def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]
    
def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum(a[0]) * 13 + int(a[1]) - 1)
    cards.sort()
    for i in cards:
        print(tosuit(i // 13) + " " + str(i % 13 + 1))
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3

def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]

def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum[a[0]] * 13 + int(a[1]))
    cards.reverse()
    for i in cards:
        print(tosuit(i // 13) + " " + (i % 13))

if __name__ == "__main__":
    main()


Fixed submission:
def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3
    
def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]
    
def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum(a[0]) * 13 + int(a[1]) - 1)
    cards.sort()
    for i in cards:
        print(tosuit(i // 13) + " " + str(i % 13 + 1))
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3
 
def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]
 
def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum(a[0]) * 13 + int(a[1]))
    cards.reverse()
    for i in cards:
        print(tosuit(i // 13) + " " + (i % 13))
 
if __name__ == "__main__":
    main()


Fixed submission:
def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3
    
def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]
    
def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum(a[0]) * 13 + int(a[1]) - 1)
    cards.sort()
    for i in cards:
        print(tosuit(i // 13) + " " + str(i % 13 + 1))
    
if __name__ == "__main__":
    main()