Problem:

Finding Missing Cards

  Taro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers).

The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.

Input

  In the first line, the number of cards n (n ≤ 52) is given.

  In the following n lines, data of the n cards are given. Each card is given by a pair of a character and an integer which represent its suit and rank respectively. A suit is represented by 'S', 'H', 'C' and 'D' for spades, hearts, clubs and diamonds respectively. A rank is represented by an integer from 1 to 13.

Output

  Print the missing cards. The same as the input format, each card should be printed with a character and an integer separated by a space character in a line.
 Arrange the missing cards in the following priorities:

Print cards of spades, hearts, clubs and diamonds in this order.

If the suits are equal, print cards with lower ranks first.

Sample Input

47
S 10
S 11
S 12
S 13
H 1
H 2
S 6
S 7
S 8
S 9
H 6
H 8
H 9
H 10
H 11
H 4
H 5
S 2
S 3
S 4
S 5
H 12
H 13
C 1
C 2
D 1
D 2
D 3
D 4
D 5
D 6
D 7
C 3
C 4
C 5
C 6
C 7
C 8
C 9
C 10
C 11
C 13
D 9
D 10
D 11
D 12
D 13

Sample Output

S 1
H 3
H 7
C 12
D 8

Note

      解説      

	



Sample input:
47
S 10
S 11
S 12
S 13
H 1
H 2
S 6
S 7
S 8
S 9
H 6
H 8
H 9
H 10
H 11
H 4
H 5
S 2
S 3
S 4
S 5
H 12
H 13
C 1
C 2
D 1
D 2
D 3
D 4
D 5
D 6
D 7
C 3
C 4
C 5
C 6
C 7
C 8
C 9
C 10
C 11
C 13
D 9
D 10
D 11
D 12
D 13


Sample output:
S 1
H 3
H 7
C 12
D 8

Submission status: Runtime Error

Solution code:
n = int(input())
S = ['S']
H = ['H']
C = ['C']
D = ['D']
for i in range(0, n):
 x = list(input().split())
 if x[0] == 'S':
  S.append(int(x[1])
 elif x[0] == 'H':
  H.append(int(x[1])
 elif x[0] == 'C':
  C.append(int(x[1])
 else:
  D.append(int(x[1])
def print(list):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(list[0], i, end = "\n")
print(S)
print(H)
print(C)
print(D)

Submission status: Runtime Error

Solution code:
n = int(input())
S = ['S']
H = ['H']
C = ['C']
D = ['D']
for i in range(0, n):
 x = list(input().split())
 if x[0] == 'S':
  S.append(int(x[1]))
 elif x[0] == 'H':
  H.append(int(x[1]))
 elif x[0] == 'C':
  C.append(int(x[1]))
 else:
  D.append(int(x[1]))
def print(list):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(list[0], i, end = "\n")
print(S)
print(H)
print(C)
print(D)

Submission status: Runtime Error

Solution code:
n = int(input())
S = ['S']
H = ['H']
C = ['C']
D = ['D']
for i in range(0, n):
 x = list(input().split())
 if x[0] == 'S':
  S.append(int(x[1]))
 elif x[0] == 'H':
  H.append(int(x[1]))
 elif x[0] == 'C':
  C.append(int(x[1]))
 else:
  D.append(int(x[1]))
def print(list):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(list[0], i), end = "\n")
print(S)
print(H)
print(C)
print(D)

Submission status: Runtime Error

Solution code:
n = int(input())
S = ['S']
H = ['H']
C = ['C']
D = ['D']
for i in range(0, n):
 x = list(input().split())
 if x[0] == 'S':
  S.append(int(x[1]))
 elif x[0] == 'H':
  H.append(int(x[1]))
 elif x[0] == 'C':
  C.append(int(x[1]))
 else:
  D.append(int(x[1]))
def print(list):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(list[0], i))
   print()
print(S)
print(H)
print(C)
print(D)

Submission status: Runtime Error

Solution code:
n = int(input())
S = []
H = []
C = []
D = []
for i in range(0, n):
 x = list(input().split())
 if x[0] == 'S':
  S.append(int(x[1]))
 elif x[0] == 'H':
  H.append(int(x[1]))
 elif x[0] == 'C':
  C.append(int(x[1]))
 else:
  D.append(int(x[1]))
def print(list, type):
 list.sort()
 for i in range(1, 14):
  if i not in list:
   print("{0} {1}".format(type, i))
   print()
print(S, 'S')
print(H, 'H')
print(C, 'C')
print(D, 'D')

Submission status: Runtime Error

Solution code:
my_cards = []
for i in range(n):
    my_cards.append(input())

all_cards  =[]
for i in range(13):
    all_cards.append("S "+str(i+1))
for i in range(13):
    all_cards.append("H "+str(i+1))
for i in range(13):
    all_cards.append("C "+str(i+1))
for i in range(13):
    all_cards.append("D "+str(i+1))

print(my_cards)

lost_cards = []
for i in range(52):
    if all_cards[i] not in my_cards:
        lost_cards.append(all_cards[i])

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

Submission status: Runtime Error

Solution code:
my_cards = []
for i in range(n):
    my_cards.append(input())

all_cards  =[]
for i in range(13):
    all_cards.append("S "+str(i+1))
for i in range(13):
    all_cards.append("H "+str(i+1))
for i in range(13):
    all_cards.append("C "+str(i+1))
for i in range(13):
    all_cards.append("D "+str(i+1))

lost_cards = []
for i in range(52):
    if all_cards[i] not in my_cards:
        lost_cards.append(all_cards[i])

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

Submission status: Runtime Error

Solution code:
S = list('0'*13)
H = list('1'*13)
C = list('2'*13)
D = list('3'*13)
card_all = [S,H,C,D]

n = int(input())
for i in range(n):
    card = input().split()
    if card[0] == 'S':
        card_all[0][int(card[1])-1] = int(card[1])
    elif card[0] == 'H':
        card_all[1][int(card[1])-1] = int(card[1])
    elif card[0] == 'C':
        card_all[2][int(card[1])-1] = int(card[1])
    elif card[0] == 'D':
        card_all[3][int(card[1])-1] = int(card[1])
card_a = []
for ??? in card_all:
    s = 0
    for j in ???:
        s+=1
        if j == '0':
            print('S {}'.format(s))
        elif j == '1':
            print('H {}'.format(s))
        elif j == '2':
            print('C {}'.format(s))
        elif j == '3' :
            print('D {}'.format(s))

Submission status: Runtime Error

Solution code:
S = list('0'*13)
H = list('1'*13)
C = list('2'*13)
D = list('3'*13)
card_all = [S,H,C,D]

n = int(input())
for i in range(n):
    card = input().split()
    if card[0] == 'S':
        card_all[0][int(card[1])-1] = int(card[1])
    elif card[0] == 'H':
        card_all[1][int(card[1])-1] = int(card[1])
    elif card[0] == 'C':
        card_all[2][int(card[1])-1] = int(card[1])
    elif card[0] == 'D':
        card_all[3][int(card[1])-1] = int(card[1])
for ??? in card_all:
    s = 0
    for j in ???:
        s+=1
        if j == '0':
            print('S {}'.format(s))
        elif j == '1':
            print('H {}'.format(s))
        elif j == '2':
            print('C {}'.format(s))
        elif j == '3' :
            print('D {}'.format(s))

Submission status: Runtime Error

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

import fileinput

# ['S', 'H', 'C', 'D']
number = range(1, 52)
m_number = range(1, 4)
card = (m_number, number)

if __name__ == '__main__':
    line = fileinput.input()
    count = int(line)

    for i in range(1, count):
        line = fileinput.input()
        tokens = line.strip().split()
        a, b = tokens[0], int(tokens[1])
        print '%S %d' % (a, b)

Submission status: Runtime Error

Solution code:
flag = [False] * 53
n = int(input())
for i in range(n):
    c, n = map(str, input().split())
    n = int(n)
    if(c == "S"):
        flag[n] = True
    elif(c == "H"):
        flag[13 + n] = True
    elif(c == "C"):
        flag[26 + n] = True
    else:
        flag[39 + n] = True
suit = ["S", "H", "C", "D"]
for i in range(1, len(flag)):
    if(flag[i] == False):
        print(suit[i // 13], i % 13)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
	cords = {
			'S': [ i+1 for i in range(13) ],
			'H': [ i+1 for i in range(13) ],
			'C': [ i+1 for i in range(13) ],
			'D': [ i+1 for i in range(13) ]
	}
	num = int(input())
	for i in range(num):
		cha, number = input().split()
		cards[cha][int(number)] = 0
	for i in ('S','H','C','D'):
		for j in range(13):
			if cards[i][j] != 0:
				print("%s %d"%(i,cords[i][j]))

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
	cards = {
			'S': [ i+1 for i in range(13) ],
			'H': [ i+1 for i in range(13) ],
			'C': [ i+1 for i in range(13) ],
			'D': [ i+1 for i in range(13) ]
	}
	num = int(input())
	for i in range(num):
		cha, number = input().split()
		cards[cha][int(number)] = 0
	for i in ('S','H','C','D'):
		for j in range(13):
			if cards[i][j] != 0:
				print("%s %d"%(i,cords[i][j]))

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
	cards = {
			'S': [ i+1 for i in range(13) ],
			'H': [ i+1 for i in range(13) ],
			'C': [ i+1 for i in range(13) ],
			'D': [ i+1 for i in range(13) ]
	}
	num = int(input())
	for i in range(num):
		cha, number = input().split()
		cards[cha][int(number)] = 0
	for i in ('S','H','C','D'):
		for j in range(13):
			if cards[i][j] != 0:
				print("%s %d"%(i,cards[i][j]))

Submission status: Runtime Error

Solution code:
n = int(input())
s_l = h_l = c_l = d_l = [1,2,3,4,5,6,7,8,9,10,11,12,13]

for i in range(0, n):
  mark, num = input().split()
  if mark == "S":
    s_l.remove(int(num))
  if mark == "H":
    h_l.remove(int(num))
  if mark == "C":
    c_l.remove(int(num))
  if mark == "D":
    d_l.remove(int(num))

for s in s_l:
  print("S {}".format(s))
for h in h_l:
  print("H {}".format(h))
for c in c_l:
  print("C {}".format(c))
for d in d_l:
  print("D {}".format(d))

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution code:
l=[]
for mark in ["S","H","C","D"]:
	for i in range(1,14):
		l.append(mark+" "+str(i))
n=input()
for i in range(n):
	l.remove(input())
for i in l:
	print(i)

Submission status: Runtime Error

Solution code:
l=[]
for mark in ["S","H","C","D"]:
	for i in range(1,14):
		l.append(mark+" "+str(i))
n=input()
for i in range(int(n)):
	l.remove(input())
for i in l[:-1]:
	print(i)
print(l[-1])

Submission status: Runtime Error

Solution code:
suits = {"S":0, "H":1, "C":2, "D":3}
cards = [[0 for i2 in range(13)] for i1 in ("S", "H", "C", "D")]
n = int(input())

for i in range(n):
    (suit, rank) = input().split(" ")
    cards[suits[suit]][int(rank)] = 1

for suit in ("S", "H", "C", "D"):
    for number in range(13):
        if cards[suits[suit]][number + 1] != 1:
            print(suit, number + 1)

Submission status: Runtime Error

Solution code:
n=input()
s=c=h=d=range(1,14)
trump={'S':s,'C':c,'H':h,'D':d}
for i in range(n):
    suit,num=raw_input().split()
    num=int(num)
    trump[suit].remove(num)
for suit in ['S','H','C','D']:
    for num in trump[suit]:
        print('%s %d'%(suit,num))

Submission status: Runtime Error

Solution code:
l=[]

for x in ['S','H','C','D']:
    for y in [str(i+1) for i in range(13)]:
        l += [x+' '+y]

for n in range(input()):
  l.remove(input())
for i in l:
  print(i)

Submission status: Runtime Error

Solution code:
l=[]

for x in ['S','H','C','D']:
    for y in [str(i+1) for i in range(13)]:
        l += [x+' '+y]

for n in range(int(input()):
  l.remove(input())
for i in l:
  print(i)

Submission status: Runtime Error

Solution code:
cards = []
mark = ["S","H","C","D"]
for i in (mark):
    for j in range(1,14):
        cards.append( i + " " + str(j) )
print(cards)
n = int(input())
for i in range(n+1):
    a = input()
    cards.remove(a)
print(a)

Submission status: Runtime Error

Solution code:
cards = []
mark = ["S","H","C","D"]
for i in (mark):
    for j in range(1,14):
        cards.append( i + " " + str(j) )
print(cards)
n = int(input())
for i in range(n+1):
    a = input()
    cards.remove(a)
print(cards)

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3

import sys


def main():
    # s: spades
    # h: hearts
    # c: clubs
    # d: diamonds
    card_deck = {'S': [], 'H': [], 'C': [], 'D': []}
    card_symbols = ['S', 'H', 'C', 'D']

    lst = [card for card in sys.stdin.readline().split()]
    card_deck[lst[0]].append(lst[1])

    for key, value in card_deck.items():
        card_deck[key].sort()

    for i in card_symbols:
        for card in range(1, 13):
            if not str(card) in card_deck[i]:
                print(i, card)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3

import sys


def init_card_deck():
    # S: spades
    # H: hearts
    # C: clubs
    # D: diamonds
    card_deck = {'S': [], 'H': [], 'C': [], 'D': []}
    n = int(sys.stdin.readline())

    for i in range(n):
        lst = [card for card in sys.stdin.readline().split()]
        card_deck[lst[0]].append(lst[1])

    return card_deck


def print_missing_cards(card_deck):
    card_symbols = ['S', 'H', 'C', 'D']
    missing_cards = ''

    for i in card_symbols:
        for card in range(1, 14):
            if not str(card) in card_deck[i]:
                print(, card)


def main():
    print(find_missing_cards(init_card_deck()))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3

import sys


def init_card_deck():
    # S: spades
    # H: hearts
    # C: clubs
    # D: diamonds
    card_deck = {'S': [], 'H': [], 'C': [], 'D': []}
    n = int(sys.stdin.readline())

    for i in range(n):
        lst = [card for card in sys.stdin.readline().split()]
        card_deck[lst[0]].append(lst[1])

    return card_deck


def print_missing_cards(card_deck):
    card_symbols = ['S', 'H', 'C', 'D']
    missing_cards = ''

    for i in card_symbols:
        for card in range(1, 14):
            if not str(card) in card_deck[i]:
                print(i, card)


def main():
    print(find_missing_cards(init_card_deck()))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
cards = []
for i in range(n):
    s, a = input().split()
    cards.append((s, a))
l = [(s, a) for s in "SHCD" and  a in range(1,14) and (s,a)not in cards]
for b in l:
    print(s + " " + a)

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution code:
for i in range(52):
    for j in range(1,5):
        for k in range(1,14):
            cardlist[i] = [j, k]
luckcard = []
num = int(input())
for i in range(num):
    card[i] = [int(x) for x in input().split() if x.isdigit()]
    count = 1
    while True:
        if card[i] == cardlist[count]:
            break
        else:
            luckcard.append(card[i])
        count += 1
luckcard.replace("S","0").replace("H","1").replace("C","2").replace("D","3")
luckcard.sort()
for i in range(52-n):
    luckcard[i][0].replace("0","S").replace("1","H").replace("2","C").replace("3","D")
    print("{0} {1}".format(luckcard[0],luckcard[1]))

Submission status: Runtime Error

Solution code:
n=int(input())
card={"S":[0]*13,"H":[0]*13,"C":[0]*13,"D":[0]*13}

for i in range(n):
    mark, number = input().split()
    card[mark][int(number)-1] = 1


for a in ("S","H","C","D"):
    for b in range(13):
        if cards[a][b] == 0:
            print(a,b+1)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = [s + " " + str(i) for i in range(1,14)] for s in ["S","H","C","D"]
for _ in range(n):
    suit, num = input().split(" ")
    if suit == "S":
        cards[0][int(num) - 1] = 0
    elif suit == "H":
        cards[1][int(num) - 1] = 0
    elif suit == "C":
        cards[2][int(num) - 1] = 0
    elif suit == "D":
        cards[3][int(num) - 1] = 0
for s in cards:
    for i in s:
        if i != 0:
            print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = [s + " " + str(i) for i in range(1,14)] for s in ["S","H","C","D"]]
for _ in range(n):
    suit, num = input().split(" ")
    if suit == "S":
        cards[0][int(num) - 1] = 0
    elif suit == "H":
        cards[1][int(num) - 1] = 0
    elif suit == "C":
        cards[2][int(num) - 1] = 0
    elif suit == "D":
        cards[3][int(num) - 1] = 0
for s in cards:
    for i in s:
        if i != 0:
            print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = [[0 for i in range(13)] for j in range(4)]
n = int(input())
for i in range(n):
    card = list(input().split())
    card[1] = int(card[1])
    if card[0] == 'S':
        suit = 0 
    elif card[0] == 'H':
        suit = 1 
    elif card[0] == 'C':
        suit = 2 
    elif card[0] == 'D':
        suit = 3 
    cards[suit][card[1]-1] = 1 
for i in range(4):
    if i == 0:
        suit = 'S' 
    elif i == 1:
        suit = 'H' 
    elif i == 2:
        suit = 'C' 
    elif i == 3:
        suit = 'D' 
    for j in range(13):
        if not(cards[i][j]):
            print(suit, j+1)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = [[0 for i in range(13)] for j in range(4)]
s2n = {'S': 0, 'H': 1, 'C': 2, 'D': 3}
n2s = 'SHCD'
n = int(input())
for i in range(n):
    card = list(input().split())
    card[1] = int(card[1])
    if card[0] == 'S':
        suit = 0 
    elif card[0] == 'H':
        suit = 1 
    elif card[0] == 'C':
        suit = 2 
    elif card[0] == 'D':
        suit = 3 
    cards[suit][card[1]-1] = 1
for i in range(4): 
    for j in range(13):
        if not(cards[i][j]):
            print(n2s[i], j+1)

Submission status: Runtime Error

Solution code:
c = { 
	'S' : [0 for _ in range(13)], ???H??? : [0 for _ in range(13)],
	'C' : [0 for _ in range(13)], ???D??? : [0 for _ in range(13)]
}

x = int(input())
for _ in range(x):
	(a, b) = input().split()
	b = int(b)
	c[a][b - 1] = b

for a in ('S', 'H', 'C', 'D'):
	for b in range(13):
		if c[a][b] == 0:
			print('{0:s} {1:d}'.format(a, b+1))

Submission status: Runtime Error

Solution code:
Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = 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)
print('\n'.join(Missing))

Submission status: Runtime Error

Solution code:
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			print(" ".join(map(str, [p, r])))

Submission status: Runtime Error

Solution code:
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			# print(" ".join(map(str, [p, r])))
			print(p + ' ' + str(r))

Submission status: Runtime Error

Solution code:
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			pass

Submission status: Runtime Error

Solution code:
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range(n):
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			print(p + ' ' + str(r))

Submission status: Runtime Error

Solution code:
count = int(input())
S=H=C=D=S2=H2=C2=D2 =[]
while True:
    if count == 0:
        break
    count -= 1
    x, y = map(str,input().split())
    if x == "S":
        S.append(y)
    elif x == "H":
        H.append(y)
    elif x == "C":
        C.append(y)
    elif x == "D":
        D.append(y)

for i in range(0,13):
    try:
        S.remove(str(i+1))
    except:
        S2.append(str(i+1))

for i in range(0,13):
    try:
        H.remove(str(i+1))
    except:
        H2.append(str(i+1))

for i in range(0,13):
    try:
        C.remove(str(i+1))
    except:
        C2.append(str(i+1))

for i in range(0,13):
    try:
        D.remove(str(i+1))
    except:
        D2.append(str(i+1))

for i in S2:
    print('S '+S2[i])
for i in H2:
    print('H '+H2[i])
for i in C2:
    print('C '+C2[i])
for i in D2:
    print('D '+D2[i])

Submission status: Runtime Error

Solution code:
all=set()
for i in ['S','H','C','D']:
    for j in range(1,14):
        all=all.add('{0} {1}'.format(str(i), str(j)))
n=input() .split()
while True:
    a=input().split()
    t += str(a[0])
    r =+ int(a[1])
all2=set()
for y in t:
    for u in r:
        all2 = all2.add('{0} {1}'.format(str(y),str(u))
print(all-all2)

Submission status: Runtime Error

Solution code:
all=set()
for i in ['S','H','C','D']:
    for j in range(1,14):
        all=all.add('{0} {1}'.format(str(i), str(j)))
n=input() .split()
while o < n:
    a=input().split()
    t += str(a[0])
    r += str(a[1])
    o +=1
all2=set()
for y in t:
    for u in r:
        all2 = all2.add('{0} {1}'.format(str(y),str(u))
print(all-all2)

Submission status: Runtime Error

Solution code:
s= [i+1 for i in range(13)]
h= [i+1 for i in range(13)]
c= [i+1 for i in range(13)]
d= [i+1 for i in range(13)]

n=input()
while True:
    i=input()
    if i == -1: break
    e,n =i.split()
    if e == 'S':s[int(n)-1]=0
    elif e == 'H':h[int(n)-1]=0
    elif e == 'C':c[int(n)-1]=0
    elif e == 'D':d[int(n)-1]=0

for i in s:
    if i != 0: print('S '+repr(i))
for i in h:
    if i != 0: print('H '+repr(i))
for i in c:
    if i != 0: print('C '+repr(i))
for i in d:
    if i != 0: print('D '+repr(i))

Submission status: Runtime Error

Solution code:
s= [i+1 for i in range(13)]
h= [i+1 for i in range(13)]
c= [i+1 for i in range(13)]
d= [i+1 for i in range(13)]

n=int(input())
for cnt in range(n)
    e,n =input().split()
    if e == 'S':s[int(n)-1]=0
    elif e == 'H':h[int(n)-1]=0
    elif e == 'C':c[int(n)-1]=0
    elif e == 'D':d[int(n)-1]=0

for i in s:
    if i != 0: print('S '+repr(i))
for i in h:
    if i != 0: print('H '+repr(i))
for i in c:
    if i != 0: print('C '+repr(i))
for i in d:
    if i != 0: print('D '+repr(i))

Submission status: Runtime Error

Solution code:
cardlist = [[i for i in range(1,13)] for j in range(4)]
n = int(input())
for s in range(0, n):
    x, y = map(str,input().split())
    int(y)
    if x == "S":
        cardlist[0].remove(y)
    elif x == "H":
        cardlist[1].remove(y)
    elif x == "C":
        cardlist[2].remove(y)
    else:
        cardlist[3].remove(y)
for z in cardlist[0]:
    print("S", z)
for z in cardlist[1]:
    print("H", z)
for z in cardlist[2]:
    print("C", z)
for z in cardlist[3]:
    print("D", z)

Submission status: Runtime Error

Solution code:
cardlist = [[i for i in range(1,13)] for j in range(4)]
n = int(input())
for s in range(0, n):
    x,y = map(str,input().split())
    y = int(y)
    if x == "S":
        cardlist[0].remove(y)
    elif x == "H":
        cardlist[1].remove(y)
    elif x == "C":
        cardlist[2].remove(y)
    else:
        cardlist[3].remove(y)
for z in cardlist[0]:
    print("S", z)
for z in cardlist[1]:
    print("H", z)
for z in cardlist[2]:
    print("C", z)
for z in cardlist[3]:
    print("D", z)

Submission status: Runtime Error

Solution code:
cardlist = [[i for i in range(1,14)] for j in range(4)]
n=int(input())
for s in range(0,n):
  x,y=(input().split())
  y=int(y)
  if   x =="S":
    cardlist[0].remove(y)
  elif x =="H":
    cardlist[1].remove(y)
  elif x =="C":
    cardlist[2].remove(y)
  else:
    cardlist[3].remove(y)
for i in cardlist[0]:
  print("S",z)
for i in cardlist[1]:
  print("H",z)
for i in cardlist[2]:
  print("C",z)
for i in cardlist[3]:
  print("D",z)

Submission status: Runtime Error

Solution code:
cards = []
for s in ['S', 'H', 'C', 'D']:
    for n in range(1,14,1):
        cards += ["%s %s" % (s, n)]

input_cards = []
input_cards = raw_input()
while True:
    input_card = raw_input()
    cards.remove(input_card)

    for card in cards:
        print(card)

Submission status: Runtime Error

Solution 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+)

Submission status: Runtime Error

Solution 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+)

Submission status: Runtime Error

Solution code:
n=int(input())
sets=['{0} {1}'.format(m,r) for m in ['S','H','C','D'] for r in range(1,14)]
[sets.remove(input()) for a in range(n)]
print(b) for b in sets

Submission status: Runtime Error

Solution code:
S_cards=[]
H_cards=[]
C_cards=[]
D_cards=[]

for i in range(1,14):
    S_cards.append(str(i))
    H_cards.append(str(i))
    C_cards.append(str(i))
    D_cards.append(str(i))

now_cards=int(input())
for i in range(0,now_cards):
    kind_num=[]
    kind_num=input().split()
    if kind_num[0]=='S':
        S_cards.remove(kind_num[1])
    elif kind_num[0]=='H':
        H_cards.remove(kind_num[1])
    elif kind_num[0]=='C':
        C_cards.remove(kind_num[1])
    elif kind_num[0]=='D':
        D_cards.remove(kind_num[1])
print()
for i in range(0,len(S_cards)):
    print('S',int(S_cards[i]))
for i in range(0,len(H_cards)):
    print('H',int(H_cards[i]))
for i in range(0,len(C_cards)):
    print('C',int(C_cards[i])
for i in range(0,len(D_cards)):
    print('D',int(D_cards[i]))

Submission status: Runtime Error

Solution code:
S_cards=[]
H_cards=[]
C_cards=[]
D_cards=[]

for i in range(1,14):
    S_cards.append(i)
    H_cards.append(i)
    C_cards.append(i)
    D_cards.append(i)

now_cards=int(input())
for i in range(0,now_cards):
    kind_num=[]
    kind_num=input().split()
    if kind_num[0]=='S':
        S_cards.remove(int(kind_num[1])
    elif kind_num[0]=='H':
        H_cards.remove(int(kind_num[1]))
    elif kind_num[0]=='C':
        C_cards.remove(int(kind_num[1])
    elif kind_num[0]=='D':
        D_cards.remove(int(kind_num[1])
for i in range(0,len(S_cards)):
    print('S',S_cards[i])
for i in range(0,len(H_cards)):
    print('H',H_cards[i])
for i in range(0,len(C_cards)):
    print('C',C_cards[i])
for i in range(0,len(D_cards)):
    print('D',D_cards[i])

Submission status: Runtime Error

Solution code:
S_cards=[]
H_cards=[]
C_cards=[]
D_cards=[]

for i in range(1,14):
    S_cards.append(i)
    H_cards.append(i)
    C_cards.append(i)
    D_cards.append(i)

now_cards=int(input())
for i in range(0,now_cards):
    kind_num=[]
    kind_num=input().split()
    if kind_num[0]=='S':
        S_cards.remove(int(kind_num[1])
    elif kind_num[0]=='H':
        H_cards.remove(int(kind_num[1])
    elif kind_num[0]=='C':
        C_cards.remove(int(kind_num[1])
    elif kind_num[0]=='D':
        D_cards.remove(int(kind_num[1])
for i in range(0,len(S_cards)):
    print('S',S_cards[i])
for i in range(0,len(H_cards)):
    print('H',H_cards[i])
for i in range(0,len(C_cards)):
    print('C',C_cards[i])
for i in range(0,len(D_cards)):
    print('D',D_cards[i])

Submission status: Runtime Error

Solution code:
n=int(input())
a=[[]]*4
s,h,c,d=[],[],[],[]
for i in range(n)
    m,r=input().split()
    if m == 'S'
        s.append(int(r))
     elif m == 'H'
        s.append(int(r))
     elif m == 'C'
        s.append(int(r))
     elif m == 'D'
        s.append(int(r))
for i in range(1,14):
    if i not in s:
        print('S', str(i))
for i in range(1,14):
    if i not in h:
        print('H', str(i))
for i in range(1,14):
    if i not in c:
        print('C', str(i))
for i in range(1,14):
    if i not in d:
        print('D', str(i))

Submission status: Runtime Error

Solution code:
N = int(input())
cards = ["{0} {1}".format(type, order) for type in ('S', 'H', 'C', 'D') for order in range(1,14)]
for i in range(N):
    card = input()
    cards.remove(card)
for rest in cards
    print(rest)

Submission status: Runtime Error

Solution code:
all_cards = [[],[],[],[]]
for i in range(4):
	for j in range(13):
		all_cards[i].append(j+1)

n = int(raw_input())
for i in range(n):
	card = raw_input().split()
	if card[0] == "S":
		all_cards[0].remove(card[1])
	elif card[0] == "H":
		all_cards[1].remove(card[1])
	elif card[0] == "C":
		all_cards[2].remove(card[1])
	else:
		all_cards[3].remove(card[1])

for i in range(len(all_cards[0])):
	print("S {:}".format(all_cards[0][i]))
for i in range(len(all_cards[1])):
	print("H {:}".format(all_cards[1][i]))
for i in range(len(all_cards[2])):
	print("C {:}".format(all_cards[2][i]))
for i in range(len(all_cards[3])):
	print("D {:}".format(all_cards[3][i]))

Submission status: Runtime Error

Solution 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)

Submission status: Runtime Error

Solution 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: suit_order.index(x[:1])), 
        key = lambda x: int(x[2:]))
    for item in remains:
        print(item)


main()

Submission status: Runtime Error

Solution 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: suit_order.index(x[:1])), key = lambda x: int(x[2:]))
    for item in remains:
        print(item)


main()

Submission status: Runtime Error

Solution code:
import sys
dict={}
suit=['S','H','C','D']

input()
lines=sys.stdin.readlines()

for l in lines: dict[l]=True

for i in range(4):
    for j in range(1,14):
        s=suit[i]+' '+str(j)
        if not(dict.get(s,false)): print(s)