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: Wrong Answer

Solution code:
c=[]
for i in range(13):
    c.insert(i, 'S {0}'.format(i+1))
    c.insert((i+1)*2,'H {0}'.format(i+1))
    c.insert((i+1)*3,'C {0}'.format(i+1))
    c.insert((i+1)*4,'D {0}'.format(i+1))

for i in range(int(input())):
    c.remove(input())

print('\n'.join(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c=[0] * 52
for i in range(13):
    c[i]='S {0}'.format(i+1)
    c[13+i]='H {0}'.format(i+1)
    c[26+i]='C {0}'.format(i+1)
    c[39+i]='D {0}'.format(i+1)

print(c)

for i in range(int(input())):
    c.remove(input())

print('\n'.join(c))

Submission status: Wrong Answer

Solution code:
def az16():
    list = []
    n = input()
    for i in range(0,n):
        list.append(raw_input().split())
    print list
    for mark in ["S","H","C","D"]:
        for i in range(1,14):
            if [mark,repr(i)] not in list:
                print mark,i

az16()

Submission status: Wrong Answer

Solution code:
z = input()
d = {}
c = 0

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [str(j)]


while c < z:
    x = raw_input().split()
    d[x[0]].remove(x[1])
    c += 1


for i in L:
    for j in sorted(d[i]):
        print i + " " + j

Submission status: Wrong Answer

Solution code:
z = 52 - input()
d = {}
c = 0

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [str(j)]


while c < z:
    x = raw_input().split()
    d[x[0]].remove(x[1])
    c += 1


for i in L:
    for j in sorted(d[i]):
        print i + " " + j

Submission status: Wrong Answer

Solution code:
z = 52 - input()
d = {}
c = 0

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [j]


while c < z:
    x = raw_input().split()
    d[x[0]].remove(int(x[1]))
    c += 1


for i in L:
    for j in sorted(d[i]):
        print i + " " + str(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input()
S = H = C = D = [1,2,3,4,5,6,7,8,9,10,11,12,13]
for i in range(x):
	mark, num = map(str, raw_input().split())
	if mark == S:
		S.remove(num)
	elif mark == H:
		H.remove(num)
	elif mark == C:
		C.remove(num)
	elif mark == D:
		D.remove(num)
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])

Submission status: Wrong Answer

Solution code:
a="";b="SHCD"
for i in range(4*13):a+=b[i/13]+" "+str(i%13+1)+"\n"
n=input()
for j in range(n):a.replace(raw_input()+"\n","")
print a,

Submission status: Wrong Answer

Solution code:
a=[];i=52;j=input()
while i:i-=1;a.append("CDHS"[i/13]+" "+str(13-i%13))
while j:j-=1;a.remove(raw_input())
for i in a:print i

Submission status: Wrong Answer

Solution code:
#coding:UTF-8

n = input()
arr = {'S':range(13),'H':range(13),'C':range(13),'D':range(13)}

for i in range(n):
    a,b = raw_input().split()
    b = int(b)
    arr[a][b-1] = 1

for j in ['S','H','C','D']:
    for k in range(13):    
        if arr[j][k] == 1:
            continue
        print j+" "+str(k+1)

Submission status: Wrong Answer

Solution code:
# coding=utf-8

n = int(raw_input())
cards = {'S':[], 'H':[], 'C':[], 'D':[]}
for _ in xrange(n):
    mark, num = raw_input().split()
    cards[mark].append(num)
for mark in cards.keys():
    for i in xrange(1, 14):
        if str(i) not in cards[mark]:
            print mark + ' ' + str(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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 _ in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)

Submission status: Wrong Answer

Solution code:
total_card = []
for flower in 'SHCD':
    for num in range(1, 14):
        total_card.append((flower, num))

current_card = []
k = int(raw_input())
for i in range(k):
    f, v = map(str, raw_input().split())
    t = (f, int(v))
    current_card.append(t)
    print current_card

loss_card = []
for tu in total_card:
    if tu not in current_card:
        loss_card.append(tu)

for tu in loss_card:
    print tu[0] + ' ' + str(tu[1])

Submission status: Wrong Answer

Solution code:
n = input()
a = []
for i in range(n):
    a.append(raw_input())
for j in range(1,14):
    if ['S', str(j)] not in a == True:
        print ' '.join(['S', str(j)])
for j in range(1,14):
    if ['H', str(j)] not in a == True:
        print ' '.join(['H', str(j)])
for j in range(1,14):
    if ['C', str(j)] not in a == True:
        print ' '.join(['C', str(j)])
for j in range(1,14):
    if ['D', str(j)] not in a == True:
        print ' '.join(['D', str(j)])

Submission status: Wrong Answer

Solution code:
n = input()
a = []
for i in range(n):
    a.append(raw_input())
for j in range(1,14):
    if 'S, str(j)' not in a == True:
        print 'S, str(j)'
for j in range(1,14):
    if 'H, str(j)' not in a == True:
        print 'H, str(j)'
for j in range(1,14):
    if 'C, str(j)' not in a == True:
        print 'C, str(j)'
for j in range(1,14):
    if 'D, str(j)' not in a == True:
        print 'D, str(j)'

Submission status: Wrong Answer

Solution code:
n = input()
a = []
for i in range(n):
    a.append(raw_input())
for j in range(1,14):
    if 'S, str(j)' not in a :
        print 'S, str(j)'
for j in range(1,14):
    if 'H, str(j)' not in a :
        print 'H, str(j)'
for j in range(1,14):
    if 'C, str(j)' not in a :
        print 'C, str(j)'
for j in range(1,14):
    if 'D, str(j)' not in a :
        print 'D, str(j)'

Submission status: Wrong Answer

Solution code:
n = input()
S = []
H = []
C = []
D = []
i = 1
while True:
    if i > n:
        break

    card = raw_input().split()
    mark = card[0]
    num = int(card[1])

    if mark == 'S':
        S.append(num)
    elif mark == 'H':
        H.append(num)
    elif mark == 'C':
        C.append(num)
    elif mark == 'D':
        D.append(num)

    i += 1

diff_S = set(range(1, 14)) - set(S)
for s in diff_S:
    print "S %d" % s
diff_H = set(range(1, 14)) - set(H)
for h in diff_H:
    print "H %d" % h
diff_C = set(range(1, 14)) - set(C)
for c in diff_C:
    print "C %d" % c
diff_D = set(range(1, 14)) - set(D)
for d in diff_D:
    print "D %d" % d

Submission status: Wrong Answer

Solution code:
n = input()
S = []
H = []
C = []
D = []
i = 1
while True:
    if i > n:
        break

    card = raw_input().split()
    mark = card[0]
    num = int(card[1])

    if mark == 'S':
        S.append(num)
    elif mark == 'H':
        H.append(num)
    elif mark == 'C':
        C.append(num)
    elif mark == 'D':
        D.append(num)

    i += 1
print ''
diff_S = set(range(1, 14)) - set(S)
for s in diff_S:
    print "S %d" % s
diff_H = set(range(1, 14)) - set(H)
for h in diff_H:
    print "H %d" % h
diff_C = set(range(1, 14)) - set(C)
for c in diff_C:
    print "C %d" % c
diff_D = set(range(1, 14)) - set(D)
for d in diff_D:
    print "D %d" % d

Submission status: Wrong Answer

Solution code:
import sys
n = input()
count = 0
Ss = []
Hs = []
Cs = []
Ds = []
while count<n:
    mark, num = raw_input().split()
    #num = int(num)
    if mark == 'S':
        Ss.append(num)
    elif mark == 'H':
        Hs.append(num)
    elif mark == 'C':
        Cs.append(num)
    elif mark == 'D':
        Ds.append(num)
    else :
        print "error"
        sys.exit()
    count+=1
print Ss
for x in xrange(1,14):
    if str(x) not in Ss:
        print "S "+str(x)
for x in xrange(1,14):
    if str(x) not in Hs:
        print "H "+str(x)
for x in xrange(1,14):
    if str(x) not in Cs:
        print "C "+str(x)
for x in xrange(1,14):
    if str(x) not in Ds:
        print "D "+str(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

trump = {
    'S': set(range(1, 14)),
    'H': set(range(1, 14)),
    'C': set(range(1, 14)),
    'D': set(range(1, 14)),
}
taro_trump = defaultdict(set)

n = int(input())
for i in range(n):
    (mark, num) = tuple(input().split(' '))
    num = int(num)
    taro_trump[mark].add(num)

no_taro_trump = defaultdict(set)
no_taro_trump['S'] = trump['S']
no_taro_trump['H'] = trump['H']
no_taro_trump['C'] = trump['C']
no_taro_trump['D'] = trump['D']

if 'S' in taro_trump:
    no_taro_trump['S'] = trump['S'] - taro_trump['S']
if 'H' in taro_trump:
    no_taro_trump['H'] = trump['H'] - taro_trump['H']
if 'C' in taro_trump:
    no_taro_trump['C'] = trump['C'] - taro_trump['C']
if 'D' in taro_trump:
    no_taro_trump['D'] = trump['D'] - taro_trump['D']

for mark, nums in no_taro_trump.items():
    for num in nums:
        print(mark, num)

Submission status: Wrong Answer

Solution code:
num = int(input())

cards = list()

for i in range(num):
    cards.append(input())

pics = ['H', 'D', 'S', 'C']
nums = [str(i) for i in range(1, 14)]

lacks = list()

for p in pics:
    for n in nums:
        c = p+' '+n
        if not c in cards:
            lacks.append(c)

slack = [a for a in lacks if a[0] == 'S']
hlack = [a for a in lacks if a[0] == 'H']
clack = [a for a in lacks if a[0] == 'C']
dlack = [a for a in lacks if a[0] == 'D']

slack.sort()
hlack.sort()
clack.sort()
dlack.sort()

for a in slack:
    print(a)
for a in hlack:
    print(a)
for a in clack:
    print(a)
for a in dlack:
    print(a)

Submission status: Wrong Answer

Solution code:
def CheckCards(Mark):
    for i in range(1, 13):
        if [Mark, i] not in Cards:
            print(Mark + str(i))

n = int(input())
Cards = []
for i in range(n):
    Cards.append(input().split())
    Cards[i][1] = int(Cards[i][1])

CheckCards("S")
CheckCards("H")
CheckCards("C")
CheckCards("D")

Submission status: Wrong Answer

Solution code:
def CheckCards(Mark):
    for i in range(1, 13):
        if [Mark, i] not in Cards:
            print(Mark + " " + str(i))

n = int(input())
Cards = []
for i in range(n):
    Cards.append(input().split())
    Cards[i][1] = int(Cards[i][1])

CheckCards("S")
CheckCards("H")
CheckCards("C")
CheckCards("D")

Submission status: Wrong Answer

Solution code:
marks='SHCD'
n=input()
card=[raw_input().split() for _ in range(n)]
m={}
for mk,rk in card:
    m.setdefault(mk,[0]*14)
    m[mk][int(rk)]=1
for i in range(len(m)):
    k=marks[i]
    v=m[k]
    for j in range(1,14):
        if not v[j]: print k,

Submission status: Wrong Answer

Solution code:
n=input()
 
s=range(1,14)
h=range(1,14)
c=range(1,14)
d=range(1,14)
  
for i in range(n):
   m, k=raw_input().split()
   if m == 'S':
      s[int(k)-1] = 0
   elif m == 'H':
       h[int(k)-1] = 0
   elif m == 'C':
       c[int(k)-1] = 0
   elif m == 'D':
       d[int(k)-1] = 0
 
for i in range(0, 13):
   if s[i] != 0:
      print 'S '+str(s[i])
 
for i in range(0, 13):
   if h[i] != 0:
      print 'h '+str(h[i])
 
for i in range(0, 13):
   if c[i] != 0:
      print 'c '+str(c[i])
 
for i in range(0, 13):
   if d[i] != 0:
      print 'd '+str(d[i])

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
temp = ''
S = []
D = []
H = []
C = []

for i in range(n):
    temp = str(raw_input())
    if temp[0] == 'S':
        S.append(temp)
    elif temp[0] == 'H':
        H.append(temp)
    elif temp[0] == 'C':
        C.append(temp)
    elif temp[0] == 'D':
        D.append(temp)

def find(X):
    frag = 0
    for i in range(1, 14):
        for j in range(len(X)):
            if str(i) in X[j]:
                frag = 1
                break
        if frag == 0:
            print X[0][0] + ' ' + i
find(S)
find(H)
find(C)
find(D)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !

n = input()

A = []
for i in range(n):
    A.append(raw_input().split())
    
s = []
h = []
c = []
d = []  # mark???????????????
for i in range(n):
    if A[i][0] == 'S' :
        s.append(A[i][1])
    elif A[i][0] == 'H':
        h.append(A[i][1])
    elif A[i][0] == 'C':
        c.append(A[i][1])
    elif A[i][0] == 'D':
        d.append(A[i][1])

snumber = []
hnumber = []
cnumber = []
dnumber = []

for i in range(1,14): #1-13?????§?????????
    z = 0
    for j in range(len(s)): #s[]???????????°??????????????°?????????snumber???????´?
        if s[j] == i :
            z = 1
            break
    if z == 0:    
        snumber.append(i)
        
    z = 0
    for j in range(len(h)):
        if h[j] == i :
            z = 1
            break
    if z == 0:
        hnumber.append(i)
        
    z = 0
    for j in range(len(c)):
        if c[j] == i :
            z = 1
            break
    if z == 0:    
        cnumber.append(i)
        
    z = 0    
    for j in range(len(d)):
        if d[j] == i :
            z = 1
            break
    if z == 0:    
        dnumber.append(i)
        
for i in range(len(snumber)):
    print "S",snumber[i]
for i in range(len(hnumber)):
    print "H",hnumber[i]
for i in range(len(cnumber)):
    print "C",cnumber[i]
for i in range(len(dnumber)):
    print "D",dnumber[i]

Submission status: Wrong Answer

Solution code:
n = input()
a = [raw_input() for i in range(n)]
for i in range(1,n+1):
  if a[i-1] != 'S %s' % i:
    print 'S %s' % i

Submission status: Wrong Answer

Solution code:
n = input()
data = []
for i in ['D ', 'C ', 'H ', 'S ']:
    for j in map( str , xrange(1, 14)):
        data.append(i + j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]

Submission status: Wrong Answer

Solution code:
n = input()
data = []
space = []
for i in ['D ', 'C ', 'H ', 'S ']:
    for j in map( str , xrange(1, 14)):
        data.append(i + j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]

Submission status: Wrong Answer

Solution code:
n = input()
data = []
space = []
for i in ['D ', 'C ', 'H ', 'S ']:
    for j in map( str , xrange(1, 14)):
        data.append(i+j)   
for i in xrange(n):
    data.remove(raw_input())
for i in xrange(len(data)):
    print data[i]

Submission status: Wrong Answer

Solution code:
S =[i+1 for i in xrange(13)]
H =[i+1 for i in xrange(13)]
C =[i+1 for i in xrange(13)]
D =[i+1 for i in xrange(13)]
#[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

n = input()
for i in xrange(n):
    c, a = raw_input().split()
    if c == "S":
        for j in xrange(len(S)-1): 
            if S[j] == int(a):
             del S[j]
    elif c == "H":
        for j in xrange(len(H)-1): 
            if H[j] == int(a):
             del H[j]      
    elif c == "C":
        for j in xrange(len(C)-1): 
            if C[j] == int(a):
             del C[j]      
    elif c == "D":
        for j in xrange(len(D)-1): 
            if D[j] == int(a):
             del D[j]

for i in xrange(len(S)):
    print "S " + str(S[i])
    
for i in xrange(len(H)):
    print "H " + str(H[i])    
    
for i in xrange(len(C)):
    print "C " + str(C[i])    
    
for i in xrange(len(D)):
    print "D " + str(D[i])

Submission status: Wrong Answer

Solution code:
cards = {

"S" : [0 for i in range(13)],
"H" : [0 for i in range(13)],
"D" : [0 for i in range(13)],
"C" : [0 for i in range(13)]
}

n = int(input())
for i in range(n):
	a,b = input().split()
	cards[a][int(b)-1] = 1

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

Submission status: Wrong Answer

Solution code:
cards = {

"S" : [0 for i in range(13)],
"H" : [0 for i in range(13)],
"D" : [0 for i in range(13)],
"C" : [0 for i in range(13)]
}

n = int(input())
for i in range(n):
	a,b = input().split()
	cards[a][int(b)-1] = 1

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

Submission status: Wrong Answer

Solution code:

x = input()
mark = []
num = []
for i in xrange(x):
    inp = raw_input().split()
    inp[1] = int(inp[1])
    mark.append(inp)

trump = ["C","D","H","S"]
for i in xrange(4):
    for j in xrange(13):
        tako = [str(trump[i]), int(j + 1)]
        p = len(mark)

Submission status: Wrong Answer

Solution code:
n = input()
a = [raw_input() for _ in range(n)]
b = []
for i in ['S ','H ','C ','D ']:
    for j in range(1,14):
        b.append(i+str(j))
for i in a:
    b.remove(i)
for i in b:
    print b

Submission status: Wrong Answer

Solution code:
# all cards list
marks = ['S', 'H', 'C', 'D']
cards = []
for i in marks:
	for j in range(1, 14):
		cards.append([i, str(j)])

# input cards list
n = input()
in_cards = []
for i in range(n):
	in_cards.append(raw_input().split())

# comp
for i in cards:
	for j in in_cards:
		if i == j:
			cards.remove(i)
			break

# print
for i in cards:
	print i[0],i[1]

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
class Cards:
    trump = [False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,]
    def HaveCards(self,num):
        self.trump[num] = True
    def TransCards(self,s,num):
        if(s == 'H'):
            num += 12 
        elif(s == 'C'):
            num +=25  
        elif(s == 'D'):
            num += 38
        return num
    def CheckCards(self,num):
        if(num <= 12):
            return 'S' ,num+1
        elif(num >= 13 and num <= 25):
            return 'H'  ,num-12
        elif(num >= 26 and num <= 38):
            return 'C',num-25
        elif(num >= 39 and num <=51):
            return 'D',num-38
        
n = int(input())
ob = Cards()
for i in range(n):
    s,str_num = input().split()
    number = int(str_num)
    Num=ob.TransCards(s,number-1)
    ob.HaveCards(Num)

for i in range(len(Cards.trump)):
    if Cards.trump[i] == False:
        Str,Num=ob.CheckCards(i)
        print(Str,Num)

Submission status: Wrong Answer

Solution code:
# Reversing numbers

# n = int(input())
# l = list(map(int, input().split()))
# print(*reversed(l))

# rel = []
# for i in range(-1, (-1) * (n + 1), -1):
#     rel.append(l[i])
# print(*rel)

# finding Missing Cards

n = int(input())
l = []
card = []
S_list = []
H_list = []
C_list = []
D_list = []
design = ["S", "H", "C", "D"]

for _ in range(n):
    l.append(input())        
    
for x in range(1, 14):
    for y in design:
        card.append(y + " " + str(x))
         
rest = set(card) - set(l)

for i in list(rest):
    if design[0] in i:
        S_list.append(i)
    elif design[1] in i:
        H_list.append(i)
    elif design[2] in i:
        C_list.append(i)
    elif design[3] in i:
        D_list.append(i)
        
print(*sorted(S_list), sep = "\n")
print(*sorted(H_list), sep = "\n")
print(*sorted(C_list), sep = "\n")
print(*sorted(D_list), sep = "\n")

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
card = []
S_list = []
H_list = []
C_list = []
D_list = []
design = ["S", "H", "C", "D"]

for _ in range(n):
    l.append(input())        
    
for x in range(1, 14):
    for y in design:
        card.append(y + " " + str(x))
         
rest = set(card) - set(l)

for i in list(rest):
    if design[0] in i:
        S_list.append(i)
    elif design[1] in i:
        H_list.append(i)
    elif design[2] in i:
        C_list.append(i)
    elif design[3] in i:
        D_list.append(i)
        
print(*sorted(S_list), sep = "\n")
print(*sorted(H_list), sep = "\n")
print(*sorted(C_list), sep = "\n")
print(*sorted(D_list), sep = "\n")

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [0]*53
for i in range(n):
    a, b = input().split()
    b = int(b)
    if a == "H":
        b += 13
    elif a == "C":
        b += 26
    elif a == "D":
        b += 39
    l[b] = 1 
for j in range(1,53):
    if l[j] != 1:
         ama = j % 13
         syou = j // 13
         if syou == 0:
             zi = "S"
         elif syou == 1:
             zi = "H"
         elif syou == 2:
             zi = "C"
         else:
             zi = "D"
         print(zi, ama)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(data)

Submission status: Wrong Answer

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

print(data)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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("\r".join(data))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list =['1','2','3','4','5','6','7','8','9','10','11','12','13']
S_list = list.copy()
H_list = list.copy()
C_list = list.copy()
D_list = list.copy()
#print(S_list)
for i in range(n):
    a = input()
    b = a.split(' ')
    print(b[1])
    if b[0] == 'S':
        S_list.remove('%s'%(b[1]))
    elif b[0] == 'H':
        H_list.remove('%s'%(b[1]))
    elif b[0] == 'C':
        C_list.remove('%s'%(b[1]))
    elif b[0] == 'D':
        D_list.remove('%s'%(b[1]))
for i in S_list:
    print('S '+i)
for e in H_list:
    print('H '+e)
for f in C_list:
    print('C '+f)
for g in D_list:
    print('D '+g)

Submission status: Wrong Answer

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

n = input()

for i in range(n):
	mark, number = raw_input().split()

	if mark == 'S':
		s[int(number)-1] = 0
	elif mark == 'H':
		s[int(number)-1] = 0
	elif mark == 'C':
		s[int(number)-1] = 0
	elif mark == 'D':
		s[int(number)-1] = 0

for i in range(13):
	if s[i] != 0:
		print "S %d" %s[i]
for i in range(13):
	if h[i] != 0:
		print "H %d" %s[i]
for i in range(13):
	if c[i] != 0:
		print "C %d" %s[i]
for i in range(13):
	if d[i] != 0:
		print "D %d" %s[i]

Submission status: Wrong Answer

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

n = input()

for i in range(n):
	mark, number = raw_input().split()

	if mark == 'S':
		s[int(number)-1] = 0
	elif mark == 'H':
		h[int(number)-1] = 0
	elif mark == 'C':
		c[int(number)-1] = 0
	elif mark == 'D':
		d[int(number)-1] = 0

for i in range(13):
	if s[i] != 0:
		print "S %d" %s[i]
for i in range(13):
	if h[i] != 0:
		print "H %d" %s[i]
for i in range(13):
	if c[i] != 0:
		print "C %d" %s[i]
for i in range(13):
	if d[i] != 0:
		print "D %d" %s[i]

Submission status: Wrong Answer

Solution code:
n = [int(input())]

cDict = {}
for mark in 'S H C D'.split(' '):
  for rank in range(1, 13):
    cDict[mark + ' ' + str(rank)] = 0

for nn in range(n[0]):
  c = input()
  cDict[c] = 1

for mark in 'S H C D'.split(' '):
  for rank in range(1, 13):
    key = mark + ' ' + str(rank)
    if cDict[key] == 0:
      print(key)

Submission status: Wrong Answer

Solution code:
S = list('0'*13)
H = list('0'*13)
C = list('0'*13)
D = list('0'*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 i in card_all:
    s = 0
    for j in i:
        s+=1
        if j == '0' and i == S:
            print('S {}'.format(s))
        if j == '0' and i == H:
            print('H {}'.format(s))
        if j == '0' and i == C:
            print('C {}'.format(s))
        if j == '0' and i == D:
            print('D {}'.format(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import random
#52????????????????????????????????????
marks = ['S', 'H', 'C', 'D']
numbers = range(1, 14)
cards = [(m, n) for m in marks for n in numbers]
print(cards)

#????????????????????????????????????
n = int(input())
card_list = random.sample(cards,n)

#????¶????????????????????????????????????????
lost_cards = set(cards) - set(card_list)

for s in lost_cards:
    for n in s:
        if n!=0: 
            print(n)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

def ch2int(a):
    s=["S","H","C","D"]
    for i,b in enumerate(s):
        if a==b:
            return i

def int2ch(i):
    s=["S","H","C","D"]
    return s[i]

n=int(input())
card=[[0 for i in range(0,4)]for j in range(0,13)]

for i in range(n):
    c,x=list(map(str,input().split()))

    card[int(x)-1][ch2int(c)]=1

for i,x in enumerate(card):
    for j,y in enumerate(x):
        if y==0:
            print(int2ch(j)+" "+str(i+1))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
dic = defaultdict(list)
for i in range(0, n):
  mark, num = input().split()
  dic[mark].append(num)

for m, nums in dic.items():
  for i in range(1, 14):
    if not str(i) in nums:
      print("{} {}".format(m, i))

Submission status: Wrong Answer

Solution code:
S = ['S', 'H', 'C', 'D']
D = map(str, range(1, 14))
n = input()
T = [tuple(raw_input().split()) for _ in xrange(n)]

for t in [(s, d) for d in D for s in S]:
    if t not in T:
        print ' '.join(t)

Submission status: Wrong Answer

Solution code:
trump_dictionary = {}
keys = ['H', 'S', 'D', 'C']
for key in keys:
    for num in range(13):
        trump_dictionary[key + ' ' + str(num + 1)] = 0

num = int(raw_input())
counter = 0
while counter < num:
    key = raw_input()
    if key in trump_dictionary:
        trump_dictionary.pop(key)
    counter += 1

for key in trump_dictionary.keys():
    print(key)

Submission status: Wrong Answer

Solution code:
marks = ['S', 'H', 'C', 'D']
cards = {x:[0 for y in range(13)] for x in marks}

cnt = int(input())
while cnt > 0:
    values = input().split()
    cards[values[0]][int(values[1]) - 1] += 1
    cnt -= 1

for key in cards.keys():
    for val in range(13):
        if 0 == cards[key][val]:
            print('{0} {1}'.format(key, val + 1))

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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