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

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:
data = [
        [
            [
                0 for r in range(10)
            ] for f in range(3)
        ] for b in range(4)
]

n = int(input())

for _ in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v


for b in range(4):
    for f in range(3):
        for r in range(10):
            print('', data[b][f][r], end='')
        print()
    if b < 3:
        print('#' * 20)
    else:
        print()

Submission status: Runtime Error

Solution code:
data = [
        [
            [
                0 for r in range(10)
            ] for f in range(3)
        ] for b in range(4)
]

n = int(input())

for s in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v


for b in range(4):
    for f in range(3):
        for r in range(10):
            print('', data[b][f][r], end='')
        print()
    if b < 3:
        print('#' * 20)
    else:
        print()

Submission status: Runtime Error

Solution code:
data = [
        [
            [
                0 for r in range(10)
            ] for f in range(3)
        ] for b in range(4)
]

n = int(input())

for _ in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v


for b in range(4):
    for f in range(3):
        for r in range(10):
            print('', data[b][f][r], end='')
        print()
    if b <= 3:
        print('#' * 20)
    else:
        print()

Submission status: Runtime Error

Solution code:
n = int(raw_input())

i = 0
s = []
h = []
c = []
d = []

def order_list(list):
  l = len(list)
  for i in xrange(l):
    j = i + 1
    while j < l:
      if list[i] > list[j]:
        temp = list[i]
        list[i] = list[j]
        list[j] = temp
      j += 1

  return list

def not_enough_cards(mark, list):
  list = order_list(list)
  i = 0
  for x in xrange(1, 14):
    if x != list[i]:
      print mark + " " + str(x)
    else:
      i += 1

while i < n:
  line = raw_input().split(" ")
  line[1] = int(line[1])
  if line[0] == "S":
    s.append(line[1])
  elif line[0] == "H":
    h.append(line[1])
  elif line[0] == "C":
    c.append(line[1])
  elif line[0] == "D":
    d.append(line[1])
  i += 1

not_enough_cards("S", s)
not_enough_cards("H", h)
not_enough_cards("C", c)
not_enough_cards("D", d)

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'):
    (s, r) = input().split()
    cards[s][int(r) + 1] = -1

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include<stdio.h>
 
int main()
{
    int n;
    scanf("%d", &n);
    int i, rank;
    char sym;
    int card[4][14] = {0};
    for (i = 1; i <= n; i++)
    {
        scanf(" %c %d\n", &sym, &rank);
        switch (sym)
        {
        case 'S':
            card[0][rank-1] = -1;
            break;
        case 'H':
            card[1][rank-1] = -1;
            break;
        case 'C':
            card[2][rank-1] = -1;
            break;
        case 'D':
            card[3][rank-1] = -1;
        }

Submission status: Runtime Error

Solution code:
l = [x+' '+y for x in ['S','H','C','D'] for y in [str(i) for i in range(1,14)]]
n = int(input())
while n > 0:
  l.remove(input())
  n += 1
for i in l:
  print(i)

Submission status: Runtime Error

Solution code:
num = int(input())
 
cards = list()
 
for i in range(num):
    cards.append(input())
 
sort = ['S', 'H', 'C', 'D']
nums = [str(i) for i in range(1, 14)]
 
for p in sort:
    for n in nums:
        c = p+' '+n
        if not c in cards:
            print(c)

Submission status: Runtime Error

Solution code:
n = input()

S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)

for i in range(0, n):
   mk, num = map(int,raw_input()split())
      if mk == 'S':
         S[str(num)-1] = 0
      elif mk == 'H':
         S[str(num)-1] = 0
      elif mk == 'C':
         S[str(num)-1] = 0
      elif mk == 'D':
         S[str(num)-1] = 0

for x in range(0, 4):
   for y in range(0, 13):
      if S[x][y] != 0
         print ('S' y+1)

Submission status: Runtime Error

Solution code:
n = input()
 
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
 
for i in range(0, n):
   mk, num = map(int,raw_input()split())
      if mk == 'S':
         S[str(num)-1] = 0
      elif mk == 'H':
         S[str(num)-1] = 0
      elif mk == 'C':
         S[str(num)-1] = 0
      elif mk == 'D':
         S[str(num)-1] = 0
 
for i in S:
   if S[i] != 0:
      print ('S' i+1)

for i in H:
   if S[i] != 0:
      print ('H' i+1)

for i in C:
   if S[i] != 0:
      print ('C' i+1)

for i in D:
   if S[i] != 0:
      print ('D' i+1)

Submission status: Runtime Error

Solution code:
n = input()
  
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
  
for i in range(0, n):
   mk, num = raw_input()split()
      if mk == 'S':
         S[str(num)-1] = 0
      elif mk == 'H':
         S[str(num)-1] = 0
      elif mk == 'C':
         S[str(num)-1] = 0
      elif mk == 'D':
         S[str(num)-1] = 0
  
for i in S:
   if S[i] != 0:
      print 'S'+str(S[i+1])
 
for i in H:
   if S[i] != 0:
      print 'H'+ str(H[i+1])
 
for i in C:
   if S[i] != 0:
      print 'C'+str(C[i+1])
 
for i in D:
   if S[i] != 0:
      print 'D'+str(D[i+1])

Submission status: Runtime Error

Solution code:
n = input()
   
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
   
for i in range(0, n):
   mk = raw_input()split()
   num = int, raw_input()split()
      if mk == 'S':
         S[r-1] = 0
      elif mk == 'H':
         S[r-1] = 0
      elif mk == 'C':
         S[r-1] = 0
      elif mk == 'D':
         S[r-1] = 0
   
for i in S:
   if S[i] != 0:
      print 'S'+str(S[i])
  
for i in H:
   if S[i] != 0:
      print 'H'+ str(H[i])
  
for i in C:
   if S[i] != 0:
      print 'C'+str(C[i])
  
for i in D:
   if S[i] != 0:
      print 'D'+str(D[i])

Submission status: Runtime Error

Solution code:
n = input()
    
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
    
for i in range(0, n):
   mk = raw_input()split()
   num = int, raw_input()split()
      if mk == 'S':
         S[num-1] = 0
      elif mk == 'H':
         S[num-1] = 0
      elif mk == 'C':
         S[num-1] = 0
      elif mk == 'D':
         S[num-1] = 0
    
for i in S:
   if S[i] != 0:
      print 'S'+str(S[i])
   
for i in H:
   if S[i] != 0:
      print 'H'+ str(H[i])
   
for i in C:
   if S[i] != 0:
      print 'C'+str(C[i])
   
for i in D:
   if S[i] != 0:
      print 'D'+str(D[i])

Submission status: Runtime Error

Solution code:
n = input()
     
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
     
for i in range(0, n):
   mk = raw_input()split()
   num = int, raw_input()split()
      if mk == 'S':
         S[num-1] = 0
      elif mk == 'H':
         H[num-1] = 0
      elif mk == 'C':
         C[num-1] = 0
      elif mk == 'D':
         D[num-1] = 0
     
for i in S:
   if S[i] != 0:
      print 'S '+str(S[i])
    
for i in H:
   if S[i] != 0:
      print 'H '+ str(H[i])
    
for i in C:
   if S[i] != 0:
      print 'C '+str(C[i])
    
for i in D:
   if S[i] != 0:
      print 'D '+str(D[i])

Submission status: Runtime Error

Solution code:
n = input()
      
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
      
for i in range(0, n):
   mk = raw_input()split()
   num = int, raw_input()split()
      if mk == 'S':
         S[num-1] = 0
      elif mk == 'H':
         H[num-1] = 0
      elif mk == 'C':
         C[num-1] = 0
      elif mk == 'D':
         D[num-1] = 0
      
for i in range(1, 13):
   if S[i] != 0:
      print 'S '+ str(S[i])
     
for i in range(0, 13):
   if S[i] != 0:
      print 'H '+ str(H[i])
     
for i in range(0, 13):
   if S[i] != 0:
      print 'C '+ str(C[i])
     
for i in range(0,13):
   if S[i] != 0:
      print 'D '+ str(D[i])

Submission status: Runtime Error

Solution code:
n = input()
       
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
       
for i in range(0, n):
   mk, num = raw_input()split()
      if mk == 'S':
         S[int(num)-1] = 0
      elif mk == 'H':
         H[int(num)-1] = 0
      elif mk == 'C':
         C[int(num)-1] = 0
      elif mk == 'D':
         D[int(num)-1] = 0
       
for i in range(1, 13):
   if S[i] != 0:
      print 'S '+ str(S[i])
      
for i in range(0, 13):
   if S[i] != 0:
      print 'H '+ str(H[i])
      
for i in range(0, 13):
   if S[i] != 0:
      print 'C '+ str(C[i])
      
for i in range(0,13):
   if S[i] != 0:
      print 'D '+ str(D[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
??????????????????
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
??????????????????
for i in range(0, n):
??????mk, num = raw_input().split()
????????????if mk == 'S':
??????????????????S[int(num)-1] = 0
????????????elif mk == 'H':
??????????????????H[int(num)-1] = 0
????????????elif mk == 'C':
??????????????????C[int(num)-1] = 0
????????????elif mk == 'D':
??????????????????D[int(num)-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: Runtime Error

Solution code:
n = input()

S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)

for i in range(0, n):
   mk, num = raw_input().split()
      if mk == 'S':
         S[int(num)-1] = 0
      elif mk == 'H':
         H[int(num)-1] = 0
      elif mk == 'C':
         C[int(num)-1] = 0
      elif mk == 'D':
         D[int(num)-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: Runtime Error

Solution code:
n = input()
 
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
 
for i in range(0, n):
   m, n = raw_input().split()
      if m == 'S':
         S[int(n)-1] = 0
      elif m == 'H':
         H[int(n)-1] = 0
      elif m == 'C':
         C[int(n)-1] = 0
      elif m == 'D':
         D[int(n)-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: Runtime Error

Solution code:
n = input()
  
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
  
for i in range(0, 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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = input()
S = ['S 1','S 2','S 3','S 4','S 5','S 6','S 7','S 8','S 9','S 10','S 11','S 12','S 13']
H = ['H 1','H 2','H 3','H 4','H 5','H 6','H 7','H 8','H 9','H 10','H 11','H 12','H 13'] 
C = ['C 1','C 2','C 3','C 4','C 5','C 6','C 7','C 8','C 9','C 10','C 11','C 12','C 13']
D = ['D 1','D 2','D 3','D 4','D 5','D 6','D 7','D 8','D 9','D 10','D 11','D 12','D 13']
cards [S,H,C,D]

for i in range(n):
  x = raw_input()
  if 'S' in x:
    cards[0].remove(x)
  if 'H' in x:
    cards[1].remove(x)
  if 'C' in x:
    cards[2].remove(x)
  if 'D' in x:
    cards[3].remove(x)

for j in range(4):
  for i in cards[j]:
    print i

Submission status: Runtime Error

Solution code:


S=[0]*13
H=[0]*13
C=[0]*13
D=0]*13
 
CARD={}
CARD['S']=S
CARD['H']=H
CARD['C']=C
CARD['D']=D
 
n=input()
for_in xrange(n):
    x=raw_input().split()
    (CARD[x[0]])[int(x[1])-1]=1
 
for suit in ['S','H','C','D']:
    for i in xrange(13):
        if(CARD[card])[i]==0:
            print'%s %d'%(card,i+1)

Submission status: Runtime Error

Solution code:


S=[0]*13
H=[0]*13
C=[0]*13
D=[0]*13
 
CARD={}
CARD['S']=S
CARD['H']=H
CARD['C']=C
CARD['D']=D
 
n=input()
for _ in xrange(n):
    x=raw_input().split()
    (CARD[x[0]])[int(x[1])-1]=1
 
for suit in ['S','H','C','D']:
    for i in xrange(13):
        if(CARD[card])[i]==0:
            print'%s %d'%(card,i+1)

Submission status: Runtime Error

Solution code:
S=[0]*13
H=[0]*13
C=[0]*13
D=[0]*13
 
CARD={}
CARD['S']=S
CARD['H']=H
CARD['C']=C
CARD['D']=D
 
n=input()
for _ in xrange(n):
    x=raw_input().split()
    (CARD[x[0]])[int(x[1])-1]=1
 
for suit in ['S','H','C','D']:
    for i in xrange(13):
        if(CARD[card])[i]==0:
            print'%s %d' % (card,i+1)

Submission status: Runtime Error

Solution code:
S=[0] * 13
H=[0] * 13
C=[0] * 13
D=[0] * 13
 
CARD={}
CARD['S'] = S
CARD['H']  =H
CARD['C'] = C
CARD['D']= D
 
n=input()
for _ in xrange(n):
    x = raw_input().split()
    (CARD[x[0]])[int(x[1])-1] = 1
 
for suit in ['S','H','C','D']:
    for i in xrange(13):
        if(CARD[card])[i] == 0:
            print'%s %d' % (card,i+1)

Submission status: Runtime Error

Solution code:
n = input()
#a,b = map(str,raw_input().split())
a = [raw_input() for i in range(n)]
j=0
for i in range(1,53):
  for j in range(n);
    if a[j] == 'S %s' % i:
      continue
    elif j==n-1:
      print 'S %s' % i
or i in range(1,53):
  for j in range(n);
    if a[j] == 'H %s' % i:
      continue
    elif j==n-1:
      print 'H %s' % i
or i in range(1,53):
  for j in range(n);
    if a[j] == 'C %s' % i:
      continue
    elif j==n-1:
      print 'C %s' % i
or i in range(1,53):
  for j in range(n);
    if a[j] == 'D %s' % i:
      continue
    elif j==n-1:
      print 'D %s' % i

Submission status: Runtime Error

Solution code:
n = int(raw_input())
card = {"S":[0]*13, "H":[0]*13, "C":[0]*13, "D":[0]*13} 
 
for i in range(n):
  mark, nums = raw_input().split()
  deck[mark][nums] = 1
 
for i in ["S", "H", "C", "D"]:
  for j in range(13):
    if deck[i][j] == 0:
      print "%s %d" % (i, j+1)

Submission status: Runtime Error

Solution code:
n = int(raw_input())

card = {"S":[0]*13, "H":[0]*13, "C":[0]*13, "D":[0]*13} 
 
for i in range(n):
  mark, nums = raw_input().split()
  deck[mark][nums] = 1
 
for i in ["S", "H", "C", "D"]:
  for j in range(0,13):
    if deck[i][j] == 0:
      print "%s %d" % (i, j+1)

Submission status: Runtime Error

Solution code:
n = int(raw_input())

card = {"S":[0]*13, "H":[0]*13, "C":[0]*13, "D":[0]*13} 
 
for i in range(n):
  mark, nums = raw_input().split()
  deck[mark][nums-1] = 1
 
for i in ["S", "H", "C", "D"]:
  for j in range(13):
    if deck[i][j] == 0:
      print "%s %d" % (i, j+1)

Submission status: Runtime Error

Solution code:
n = int(raw_input())

card = {"S":[0]*13, "H":[0]*13, "C":[0]*13, "D":[0]*13} 
 
for i in range(n):
  mark, nums = raw_input().split()
  deck[mark][int(nums)-1] = 1
 
for i in ["S", "H", "C", "D"]:
  for j in range(13):
    if deck[i][j] == 0:
      print "%s %d" % (i, j+1)

Submission status: Runtime Error

Solution code:
S = []
H = []
C = []
D = []

n = int(input())
for i in range(n):
    mark, num = [x for x in input().split()]
    if mark == 'S':
        S.append(int(num))

    elif mark == 'H':
        H.append(int(num))

    elif mark == "C":
        C.append(int(num))

    else: #D
        D.append(int(num))


for i in range(1,14):
    if not i in S:
        print("S", i)
for i in range(1,14):
    if not i in H:
        print("H", i)for i in range(1,14):
for i in range(1,14):
    if not i in C:
        print("C", i)for i in range(1,14):
for i in range(1,14):
    if not i in D:
        print("D", i)

Submission status: Runtime Error

Solution code:
n = input()
data = []
for i in ['H', 'C', 'S', 'D']:
    for j in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13']:
        data.append(i + j)
for i in range(n):
    data.remove(raw_input())
for i in range(len(data)):
    print data[i]

Submission status: Runtime Error

Solution code:
n = input()
data = []
for i in ['S', 'H', 'C', 'D']:
    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: Runtime Error

Solution code:
n = input()
data = []
a = []
for i in ['S', 'H', 'C', 'D']:
    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: Runtime Error

Solution code:
n = input()
data = []
a = []
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: Runtime Error

Solution code:
# coding: utf-8
# Here your 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":
        del S[int(a)-1]
    elif c == "H":
        del H[int(a)-1]        
    elif c == "C":
        del C[int(a)-1]        
    elif c == "D":
        del D[int(a)-1]

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

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":
        del S[int(a)-1]
    elif c == "H":
        del H[int(a)-1]        
    elif c == "C":
        del C[int(a)-1]        
    elif c == "D":
        del D[int(a)-1]

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

Solution code:
n = int(input())
cards = []
for i in range(n):
	s,r=input().split()
	card.append((s,int(r)))
for s,r in [(s,r) for s in 'SHCD' for r in range(1,14) if not in cards]:
	print(s,r)

Submission status: Runtime Error

Solution code:
n = int(input())
cards = []
for i in range(n):
	s,r=input().split()
	cards.append((s,int(r)))
for s,r in [(s,r) for s in 'SHCD' for r in range(1,14) if not in cards]:
	print(s,r)

Submission status: Runtime Error

Solution code:
n=input()
S=[range(1,14) for j in range(4)] 
for i in range(n):
    ip=raw_input().split()
    if ip[0]=='S':
        S[0].remove(ip[1])
    elif ip[0]=='H':
        S[1].remove(ip[1])
    elif ip[0]=='C':
        S[2].remove(ip[1])
    else :
        S[3].remove(ip[1])
for i in S[0]:
   print 'S '+i
for i in S[1]:
   print 'H '+i
for i in S[2]:
   print 'C '+i
for i in S[3]:
   print 'D '+i

Submission status: Runtime Error

Solution code:
n = input()
s = []
h = []
c = []
d = []

for i in range(n):
  card = raw_input().split(" ")
  card[1] = int(card[1])
  if card[0] == "S":
  	s.append(card[1])
  if card[0] == "H":
  	h.append(card[1])
  if card[0] == "C":
  	c.append(card[1])
  if card[0] == "D":
  	d.append(card[1])

def sort_list(lst):
#make a temporary file for storing data
  temp = []
  for i in range(1,14):
    if i not in lst:
	temp.append(i)
  lst = sorted(temp)
  return lst
  
check_cards(mark,lst):
	lst = sort_list(lst)
	for i in lst:
		print mark+" "+str(i)

check_cards(S,s)
check_cards(H,h)
check_cards(C,c)
check_cards(D,d)

Submission status: Runtime Error

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

for i in range(n):
	x, y = raw_input().split()
	d[x][int(y)-1] = True

for k in ["S","H","C","D"]:
	for i in range(13):
		if not d[k][i]:
		print ("%s %d"%(k, i+1))

Submission status: Runtime Error

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

for i in range(n):
	x, y = raw_input().split()
	d[x][int(y)-1] = True

for k in ["S","H","C","D"]:
	for i in range(13):
		if d[k][i] == True:
		print ("%s %d"%(k, i+1))

Submission status: Runtime Error

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

for i in range(n):
	x, y = raw_input().split()
	d[x][int(y)-1] = True

for k in ["S","H","C","D"]:
	for i in range(13):
		if d[k][i]:
		print ("%s %d"%(k, i+1))

Submission status: Runtime Error

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

for i in range(n):
	x, y = raw_input().split()
	d[x][int(y)-1] = True

for k in ["S","H","C","D"]:
	for i in range(13):
		if d[k][i]:
			continue
		print ("%s %d"%(k, i+1))

Submission status: Runtime Error

Solution code:
n = int(raw_input)
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	if a in lst:
		lst.remove(a)
#print the result
for i in xrange(0,len(lst)):
	print a[i]

Submission status: Runtime Error

Solution code:
n = int(raw_input)
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	if a in lst:
		lst.remove(a)
#print the result
for i in xrange(0,len(lst)):
	print lst[i]

Submission status: Runtime Error

Solution code:
n = int(raw_input)
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in xrange(0,len(lst)):
	print lst[i]

Submission status: Runtime Error

Solution code:
n = int(raw_input())
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in xrange(0,len(lst)):
	print lst[i]

Submission status: Runtime Error

Solution code:
n = int(raw_input)
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in lst:
	print i

Submission status: Runtime Error

Solution code:
n = int(raw_input())
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in lst:
	print i

Submission status: Runtime Error

Solution code:
S = []
H = []
C = []
D = []
for i in (S, H, C, D):
        for k in range(1, 13+1):
            i.append(k)


for u in range(0, int(input())):
    x, y = (i for i in input().split())
    if x == "S":
        S.remove(int(y))
    elif x == "H":
        H.remove(int(y))
    elif x == "C":
        H.remove(int(y))
    else:
        D.remove(int(y))
if len(S) > 0:
    for s in range(0, len(S)):
        print("S",S[s])
if len(H) > 0:
    for h in range(0, len(H)):
        print("H",H[h])
if len(C) > 0:
    for c in range(0, len(C)):
        print("C",C[c])
if len(D) > 0:
    for d in range(0, len(D)):
        print("D",D[d])

Submission status: Runtime Error

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(dat

Submission status: Runtime Error

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()
    card = input()
    data.remove(card)

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

Submission status: Runtime Error

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()
    card = input()
    data.remove(card)

for c in data:
    print(c)

Submission status: Runtime Error

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)

for c in data:
    print(c)

Submission status: Runtime Error

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)

for c in data:
    print(c)

Submission status: Runtime Error

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)

for c in data:
    print(c)

Submission status: Runtime Error

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)

for c in data:
    print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
a = [input().split() for i in range(N)]
Set = {}
n = list(range(1,14))
Set['S'] = n.copy()
Set['H'] = n.copy()
Set['C'] = n.copy()
Set['D'] = n.copy()

for suit,num in a:
    Set[suit].remove(num)

for i in Set['S']:
    print("S {}".format(i))
for i in Set['H']:
    print("H {}".format(i))
for i in Set['C']:
    print("C {}".format(i))
for i in Set['D']:
    print("D {}".format(i))

Submission status: Runtime Error

Solution code:
n = int(input())
S = ['S']
H = ['H']
C = ['C']
D = ['D']
for i in range(0, n):
 x = 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)