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

Submission status: Runtime Error

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

count = int(input()

for n in range(count):
    card = input()
    cards.remove(card)

for n in cards:
    print(n)

Submission status: Runtime Error

Solution code:
#ITP1_6_B


n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
        T[0][b] = 1
    elif a=='H':
      T[1][b] = 1
    elif a=='C':
      T[2][b] = 1
    else:
      T[3][b] = 1
c=int(0)
d=int(0)
for j in range(4):
  for i in range (13):
    if T[c][d] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
    print(K,d)
    d=d+1
  c=c+1

Submission status: Runtime Error

Solution code:
#ITP1_6_B


n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
      T[0][b-1] = 1
    elif a=='H':
      T[1][b-1] = 1
    elif a=='C':
      T[2][b-1] = 1
    else:
      T[3][b-1] = 1
c=int(0)
d=int(0)
for j in range(4):
  for i in range (13):
    if T[c][d] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
    print(K,d+1)
    d=d+1
  c=c+1

Submission status: Runtime Error

Solution code:
#ITP1_6_B


n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
      T[0][b-1] = 1
    elif a=='H':
      T[1][b-1] = 1
    elif a=='C':
      T[2][b-1] = 1
    else:
      T[3][b-1] = 1
c=0
c=int(c)
d=0
d=int(d)
for j in range(4):
  for i in range (13):
    if T[c][d] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
    print(K,d+1)
    d=d+1
  c=c+1

Submission status: Runtime Error

Solution code:
n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
      T[0][b-1] = 1
    elif a=='H':
      T[1][b-1] = 1
    elif a=='C':
      T[2][b-1] = 1
    else:
      T[3][b-1] = 1

for j in range(4):
  for i in range (13):
    if T[i][j] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
    print(K,d+1)

Submission status: Runtime Error

Solution code:
n= int(input())

T=[[0 for j in range(13)]for m in range(4)]
format(T)

for i in range(n):
    a,b = input().split()
    b=int(b)
    
    if a=='S':
      T[0][b-1] = 1
    elif a=='H':
      T[1][b-1] = 1
    elif a=='C':
      T[2][b-1] = 1
    else:
      T[3][b-1] = 1

for j in range(4):
  for i in range (13):
    if T[j][i] == 0:
      if c==0:
        K = "S"
      elif c==1:
        K = "H"
      elif c==2:
        K = "C"
      else:
        K = "D"
    print(K,d+1)

Submission status: Runtime Error

Solution code:
cards = [[0 for i in range(13)] for j in range(4)]

pattern = ["S", "H", "C", "D"]

n = int(input())

ch_list=[]
rank_list_0=[]
while n > 0:
  ch, rank = input().split()
  ch_list.append(ch)
  rank_list_0.append(rank)
  n = n - 1

rank_list = [int(rank_list) for rank_list in rank_list_0]

for (chlist, ranklist) in zip(ch_list,rank_list):
      cards[pattern.index(chlist)][ranklist-1] = 1
      
for i in range(0, 3):
  for j in range(0, 12)
    if cards[i][j] == 0:
        print(pattern[i], j+1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
cards = ([False in i in range(13)] for j in range(4))
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards = [patterrn.index(x)][y-1]
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i][j-1])

Submission status: Runtime Error

Solution code:
cards = ([False in i in range(13)] for j in range(4))
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards = [pattern.index(x)][y-1]
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i][j-1])

Submission status: Runtime Error

Solution code:
cards = ([False in i in range(13)] for j in range(4))
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards = [pattern.index(x)][y-1] = True
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i][j-1])

Submission status: Runtime Error

Solution code:
cards = ([False in i in range(13)] for j in range(4))
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards[pattern.index(x)][y-1] = True
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i][j-1])

Submission status: Runtime Error

Solution code:
cards = [([False in i in range(13)] for j in range(4)]
pattern = ['S','H','C','D']
​
n = int(input())
​
for i in range(n):
  x, y = input().split()
  y = int(y)
  cards[pattern.index(x)][y-1] = True
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i],[j-1])

Submission status: Runtime Error

Solution code:
cards = [([False in i in range(13)] for j in range(4)]
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards[pattern.index(x)][y-1] = True
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i],[j-1])

Submission status: Runtime Error

Solution code:
cards = [[False in i in range(13)] for j in range(4)]
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards[pattern.index(x)][y-1] = True
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i],[j-1])

Submission status: Runtime Error

Solution code:
cards =[]
symbol = ['S','H','C','D']

for sym in symbol:
  for i in range(1,14):
    cards.append(sym + '' + str(i))
    
n = int(input())
for j in range(n):
  cards.remove(input())

for card in cards:
  print(card)

Submission status: Runtime Error

Solution code:
cards = []
symbol = ['S', 'H', 'C', 'D']
for sym in symbol:
    for i in range(1, 14):
        cards.append(sym + '' + str(i))

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

for card in cards:
    print(card)

Submission status: Runtime Error

Solution code:
n = int(input())
card=[i + '' + str(j) for i in ['S','H','C','D'] for j in range(1,14)]

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

Submission status: Runtime Error

Solution code:
n = int(input())
card=[i+""+str(j) for i in ['S','H','C','D'] for j in range(1,14)]

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

Submission status: Runtime Error

Solution code:
n=input()
d={}
for i in range(n):
  card=input()
  d[card]=True
  

for c in ["S","H","C","D"]:
  for i in brange(1,13):
    card=c+' '+str(n)
    if not key in d:
      print(key)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = {} #からの辞書
for i in range(n):
    card = input()
    cards[card] = 1
    
#print(d)

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

Submission status: Runtime Error

Solution code:
n = int(input())
d = {} #空の辞書
for i in range(n):
    card = input()
    d[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)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = {} #空の辞書
for i in range(n):
    card = input()
    cards[card] = 1

#print(cards)

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

Submission status: Runtime Error

Solution code:
n=int(input())
d={} #空の辞書
for i in range(n):
  cards=input()
  cards[card]=1

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

Submission status: Runtime Error

Solution 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):
        card = c + ' ' + str(n)
        if not key in cards:
            print(key)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
d={} #空の辞書
for i in range(n):
  cards=input()
  cards[card]=1

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

Submission status: Runtime Error

Solution 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):
        card = c + ' ' + str(n)
        if not key in cards:
            print(key)

Submission status: Runtime Error

Solution code:
n=int(input())
d={} #空の辞書
for i in range(n):
  cards=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: Runtime Error

Solution code:
n = int(input())
cards = {} #からの辞書
for i in range(n):
    card = input()
    cards[card] = 1
    
#print(d)

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

Submission status: Runtime Error

Solution code:
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

Submission status: Runtime Error

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

Submission status: Runtime Error

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):
    card = c + ' ' + str(n)
    if not key in cards:
      print(key)

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
card = {"S": card_(), "H": card_(), "C": card_(), "D": card_()}
while count < n:
	i = list(input().split(" "))
	card[i[0]] -= {int(i[1])}
	count += 1

mark = ["S", "H", "C", "D"]
for m in mark:
	for c in sorted(card[m]):
		print("%s %d" % (m, c))

Submission status: Runtime Error

Solution code:
z = input()
d = {}
while 1:
    x = raw_input().split()
    print x
    if x[0] == '0':
        break
    else:
        d[x[0]] = d.get(x[0],[]) + [x[1]]

L = ['S','H','C','D']

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

Submission status: Runtime Error

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

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


while 1:
    x = raw_input().split()
    if x[0] == '0':
        break
    else:
        d[x[0]].remove(x[1])


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

Submission status: Runtime Error

Solution code:
import sys

SUITS = ['S', 'H', 'C', 'D']
exist_cards = {suit:[] for suit in suits}

n = input()

for line in sys.stdin:
    suit, number = line.split()
    exist_cards[suit].append(int(number))


for suit in SUITS:
    for i in range(1, 14):
        if i not in exist_cards[suit]:
            print(suit, i)

Submission status: Runtime Error

Solution code:
n = input()

a = [] 
flag = {}
for j in range(1, 14):
    flag[('S',j)] = 0
    flag[('H',j)] = 0
    flag[('C',j)] = 0
    flag[('D',j)] = 0

for i in range(n):
    temp = map(str, raw_input().split())
    a.append((temp[0],temp[1]))
    print a[i][0]
    print a[i][1]
#Sについて
for i in range(n):
    if(a[i][0] == 'S'):
        print 'Yes'
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                print 'Yes'
                flag[('S',j)] = 1
#Hについて
for i in range(n):
    if(a[i][0] == 'H'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('H',j)] = 1
#Cについて
for i in range(n):    
    if(a[i][0] == 'C'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('C',j)] = 1
#Dについて
for i in range(n):    
    if(a[i][0] == 'D'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('D',j)] = 1

for j in range(1, 14):
    if(flag[('S',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('H',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('C',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('D',j)] == 0):
        print 'S' ' ' '%d' %(j)

Submission status: Runtime Error

Solution code:
n = input()

a = [] 
flag = {}
for j in range(1, 14):
    flag[('S',j)] = 0
    flag[('H',j)] = 0
    flag[('C',j)] = 0
    flag[('D',j)] = 0

for i in range(n):
    temp = map(str, raw_input().split())
    a.append((temp[0],temp[1]))
    print a[i][0]
    print a[i][1]
#Sについて
for i in range(n):
    if(a[i][0] == 'S'):
        print 'Yes'
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                print 'Yes'
                flag[('S',j)] = 1
#Hについて
for i in range(n):
    if(a[i][0] == 'H'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('H',j)] = 1
#Cについて
for i in range(n):    
    if(a[i][0] == 'C'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('C',j)] = 1
#Dについて
for i in range(n):    
    if(a[i][0] == 'D'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('D',j)] = 1

for j in range(1, 14):
    if(flag[('S',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('H',j)] == 0):
        print 'H' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('C',j)] == 0):
        print 'C' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('D',j)] == 0):
        print 'D' ' ' '%d' %(j)

Submission status: Runtime Error

Solution code:
n = input()

a = [] 
flag = {}
for j in range(1, 14):
    flag[('S',j)] = 0
    flag[('H',j)] = 0
    flag[('C',j)] = 0
    flag[('D',j)] = 0

for i in range(n):
    temp = map(str, raw_input().split())
    a.append((temp[0],temp[1]))
    #print a[i][0]
    #print a[i][1]
#Sについて
for i in range(n):
    if(a[i][0] == 'S'):
        #print 'Yes'
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                #print 'Yes'
                flag[('S',j)] = 1
#Hについて
for i in range(n):
    if(a[i][0] == 'H'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('H',j)] = 1
#Cについて
for i in range(n):    
    if(a[i][0] == 'C'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('C',j)] = 1
#Dについて
for i in range(n):    
    if(a[i][0] == 'D'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('D',j)] = 1

for j in range(1, 14):
    if(flag[('S',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('H',j)] == 0):
        print 'H' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('C',j)] == 0):
        print 'C' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('D',j)] == 0):
        print 'D' ' ' '%d' %(j)

Submission status: Runtime Error

Solution code:
n = input()

a = [] 
flag = {}
for j in range(1, 14):
    flag[('S',j)] = 0
    flag[('H',j)] = 0
    flag[('C',j)] = 0
    flag[('D',j)] = 0

for i in range(n):
    temp = map(str, raw_input().split())
    a.append((temp[0],temp[1]))
    #print a[i][0]
    #print a[i][1]
#Sについて
for i in range(n):
    if(a[i][0] == 'S'):
        #print 'Yes'
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                #print 'Yes'
                flag[('S',j)] = 1
#Hについて
for i in range(n):
    if(a[i][0] == 'H'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('H',j)] = 1
#Cについて
for i in range(n):    
    if(a[i][0] == 'C'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('C',j)] = 1
#Dについて
for i in range(n):    
    if(a[i][0] == 'D'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('D',j)] = 1

for j in range(1, 14):
    if(flag[('S',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('H',j)] == 0):
        print 'H' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('C',j)] == 0):
        print 'C' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('D',j)] == 0):
        print 'D' ' ' '%d' %(j)
        
exit(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
cards = {
  'S': [r for f in range(1,13+1)],
  'H': [r for f in range(1,13+1)],
  'C': [r for f in range(1,13+1)],
  'D': [r for f 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: Runtime Error

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(int(num))
	elif mark == 'H':
		H.remove(int(num))
	elif mark == 'C':
		C.remove(int(num))
	elif mark == 'D':
		D.remove(int(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: Runtime Error

Solution code:
def to_str(symbol, num):
    return '{0} {1}'.format(symbol, num)

if __name__ == '__main__':
    symbols = ['S','H','C','D']
    cards = [to_str(x,y) for x in symbols for y in range(1,14)]
    n = int(input())
    if n == 52: break
    for i in range(n):
        cards.remove(input())
    print('\n'.join(cards))

Submission status: Runtime Error

Solution code:
def to_str(symbol, num):
    return '{0} {1}'.format(symbol, num)

if __name__ == '__main__':
    symbols = ['S','H','C','D']
    cards = [to_str(x,y) for x in symbols for y in range(1,14)]
    n = int(input())
    if n == 52: return None
    for i in range(n):
        cards.remove(input())
    print('\n'.join(cards))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=[];n=input()
for i in range(52):
 a.append("SHCD"[i/13]+" "+str(i%13+1))
 if i<n:a.remove(raw_input())
for i in a:print i

Submission status: Runtime Error

Solution code:
data = {
    'S':[int(x) for x in range(1,14)],
    'H':[int(x) for x in range(1,14)],
    'C':[int(x) for x in range(1,14)],
    'D':[int(x) for x in range(1,14)]
     }

count = int(input())

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: Runtime Error

Solution code:
data = {
    'S':[int(x) for x in range(1,14)],
    'H':[int(x) for x in range(1,14)],
    'C':[int(x) for x in range(1,14)],
    'D':[int(x) for x in range(1,14)]
     }

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: Runtime Error

Solution code:
data = {
    'S':[int(x) for x in range(1,14)],
    'H':[int(x) for x in range(1,14)],
    'C':[int(x) for x in range(1,14)],
    'D':[int(x) for x in range(1,14)]
    }
 
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: Runtime Error

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()
    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: Runtime Error

Solution code:
data = {
    '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()
    index = cards[s].index(int(r))
    cards[s][int(r) - 1] = 1
  
for s in ['S', 'H', 'C', 'D']:
    for r in range(13):

        print(s, r)

Submission status: Runtime Error

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

Submission status: Runtime Error

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()
??????cords[s][int(r) - 1] = 1

for s in ('S', 'H', 'C', 'D'):
    for r in range(13):

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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][r - 1] = r
print(data)

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

Submission status: Runtime Error

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()
    r = int(r)
    cards[s][r - 1] = r
print(data)

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

Submission status: Runtime Error

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()
    r = int(r)
    cards[s][r - 1] = r
print(data)

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