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: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
import collections

rank = {'S': 0, 'H': 1, 'C': 2, 'D': 3}
Card = collections.namedtuple('Card', ['suit', 'num'])
all_cards = {Card(suit, str(num)) for suit in ['S', 'H', 'C', 'D'] for num in range(1, 14)}

n = int(input())
cards = {Card(*input().split()) for _ in range(n)}
lost = all_cards - cards
lost = sorted(lost, key=lambda x: (rank[x.suit], int(x.num)))
print('\n'.join('%s %s' % (suit, num) for suit, num in lost))

Submission status: WA: Presentation Error

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 sorted(diff_S):
    print "S %d" % s
diff_H = set(range(1, 14)) - set(H)
for h in sorted(diff_H):
    print "H %d" % h
diff_C = set(range(1, 14)) - set(C)
for c in sorted(diff_C):
    print "C %d" % c
diff_D = set(range(1, 14)) - set(D)
for d in sorted(diff_D):
    print "D %d" % d

Submission status: WA: Presentation 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):
    q,r = raw_input().split()
    if q == 'S':
        s[int(r)-1] = 0
    elif q == 'H':
        h[int(r)-1] = 0
    elif q == 'C':
        c[int(r)-1] = 0
    elif q == '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: WA: Presentation 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):
    kd,r = raw_input().split()
    if kd == 'S':
        s[int(r)-1] = 0
    elif kd == 'H':
        h[int(r)-1] = 0
    elif kd == 'C':
        c[int(r)-1] = 0
    elif kd == '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: WA: Presentation 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):
    q,r = raw_input().split()
    if q == 'S':
        s[int(r)-1] = 0
    elif q == 'H':
        h[int(r)-1] = 0
    elif q == 'C':
        c[int(r)-1] = 0
    elif q == '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: WA: Presentation Error

Solution code:
#coding: UTF-8

x = int(input())
a = 0
s = 0
h = 0
c = 0
d = 0
lists = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
listh = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
listc = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
listd = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

while a < x:
	l = raw_input().split()
	a += 1
	m = l[0]
	n = int(l[1])
	
	if m == "S":
		s += 1
		lists.remove(n)
	if m == "H":
		h += 1
		listh.remove(n)
	if m == "C":
		c += 1
		listc.remove(n)
	if m == "D":
		d += 1
		listd.remove(n)

for ss in lists:
	print "S" "%d"%ss
for hh in listh:
	print "H" "%d"%hh
for cc in listc:
	print "C" "%d"%cc
for dd in listd:
	print "D" "%d"%dd

Submission status: WA: Presentation Error

Solution code:
n = int(input())
my_cards = {input() for _ in range(n)}
lost_cards = (
  "{} {}".format(s, i)
  for s in ('S', 'H', 'C', 'D')
  for i in range(1, 13 + 1)
  if "{} {}".format(s, i) not in my_cards
)
print ("\n".join(lost_cards))

Submission status: WA: Presentation Error

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)
print "\n".join(b)

Submission status: WA: Presentation Error

Solution code:
lst = [x+' '+str(y) for x in ['S', 'H', 'C', 'D'] for y in range(1, 14)]
n = int(input())
for i in range(n):
    lst.remove(input())
print('\n'.join(s for s in lst))

Submission status: WA: Presentation 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("\n".join(data))

Submission status: WA: Presentation 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("\n".join(data))

Submission status: WA: Presentation 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("\n".join(data))

Submission status: WA: Presentation 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("\n".join(data))

Submission status: WA: Presentation 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("\n".join(data))

Submission status: WA: Presentation Error

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

n =int(input())
for c in range(n):
    card = input()
    data.remove(card)

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

Submission status: WA: Presentation 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("\r\n".join(data))

Submission status: WA: Presentation 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('\n'.join(data))

Submission status: WA: Presentation 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("\n\r".join(data))

Submission status: WA: Presentation 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("\n".join(data))
print()

Submission status: WA: Presentation Error

Solution code:
s = []
h = []
c = []
d = []
for i in range(1, 14):
    s.append('S ' + str(i))
    h.append('H ' + str(i))
    c.append('C ' + str(i))
    d.append('D ' + str(i))

n = int(input())
i = 1
while i <= n:
    a = str(input())
    if (a in s):
        s.remove(a)
    elif (a in h):
        h.remove(a)
    elif (a in c):
        c.remove(a)
    elif (a in d):
        d.remove(a)
    i += 1

print('\n'.join(s))
print('\n'.join(h))
print('\n'.join(c))
print('\n'.join(d))

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
pictures = ['S','H','C','D']
card_li = []
for i in range(4):
    for j in range(1,14):
        card_li.append(pictures[i] + ' ' + str(j))
n = int(input())
for i in range(n): del card_li[card_li.index(input())]
print('\n'.join(card_li))

Submission status: WA: Presentation Error

Solution code:
pictures = ['S','H','C','D']
card_li = []
for i in range(4):
    for j in range(1,14):
        card_li.append(pictures[i] + ' ' + str(j))
n = int(input())
for i in range(n): del card_li[card_li.index(input())]
print('\n'.join(card_li) if len(card_li)!=0 else '')

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
#!usr/bin/env python3

import sys


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

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

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

    return card_deck


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

    for i in card_symbols:
        for card in range(1, 14):
            if not str(card) in card_deck[i]:
                missing_cards += '%s %s\n' % (i, card)

    return missing_cards


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


if __name__ == '__main__':
    main()

Submission status: WA: Presentation Error

Solution code:
#!usr/bin/env python3

import sys


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

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

    return card_deck


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

    for i in card_symbols:
        for card in range(1, 14):
            if not str(card) in card_deck[i]:
                missing_cards += '%s %s\n' % (i, card)

    return missing_cards


def main():
    card_deck = init_card_deck()
    missing_cards = find_missing_cards(card_deck)
    print(missing_cards)


if __name__ == '__main__':
    main()

Submission status: WA: Presentation Error

Solution code:
count = input()
Ss = []
Hs = []
Cs = []
Ds = []
for i in range(int(count)):
    mark, num = input().split()
    if mark is 'S':
        Ss.append(num)
    elif mark is 'H':
        Hs.append(num)
    elif mark is 'C':
        Cs.append(num)
    elif mark is 'D':
        Ds.append(num)

for i in range(1,14):
    if not(str(i) in Ss):
        print("S {0} ".format(str(i)))
for i in range(1,14):
    if not(str(i) in Hs):
        print("H {0} ".format(str(i)))
for i in range(1,14):
    if not(str(i) in Cs):
        print("C {0} ".format(str(i)))
for i in range(1,14):
    if not(str(i) in Ds):
        print("D {0} ".format(str(i)))

Submission status: WA: Presentation Error

Solution code:
cards_remain=[]
suit=["S","H","C","D"]
cards_set=[]
output=[]

count_card=input()

for l in range(int(count_card)):
        cards_remain.append(input().replace(" ",""))

for m in suit:
    for n in range(13):
        cards_set.append(m+str(n+1))

for p in cards_set:
    if p not in  cards_remain:
        output.append(p)

for x in output:
        print(x)

Submission status: WA: Presentation Error

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

def func():
    try:
        line = input()
    except:
        print("input error")
        return -1
        
    marks = ("S","H","C","D")
    cards = []
    while(True):
        try:
            line = input().rstrip()
            elements = line.split(" ")
            if(elements[0] in marks):
                elements[1]=int(elements[1])
                cards.append(elements)
            else:
                print("1input error")
                return -1
        except EOFError:
            break
        except :
            print("input error")
            return -1
    
    result=""
    for mark in marks:
        for i in range(1,14):
            if([mark,i] not in cards):
                result += mark+" "+str(i)+"\n"
    
    print(result.rstrip())
func()

Submission status: WA: Presentation Error

Solution code:
spades = []
hearts = []
clubs = []
diamonds = []

mspades = []
mhearts = []
mclubs = []
mdiamonds = []

n = int(input())

i = 0

while i < n:
    card = input()
    if 'S' in card:
        spades.append(card)
    elif 'H' in card:
        hearts.append(card)
    elif 'C' in card:
        clubs.append(card)
    else:
        diamonds.append(card)
    i += 1


deck = [spades, hearts, clubs, diamonds]
mdeck = [mspades, mhearts, mclubs, mdiamonds]
symbols = ['S ', 'H ', 'C ', 'D ']

onDeck = 0

while onDeck < 4:
    rank = 1
    while rank <= 13:    
        if symbols[onDeck] + str(rank) in deck[onDeck]:
            pass
        else:
            mdeck[onDeck].append(symbols[onDeck] + str(rank))
        rank += 1
    onDeck += 1

onmDeck = 0

while onmDeck < 4:
    print("\n".join(mdeck[onmDeck]))
    onmDeck += 1

Submission status: WA: Presentation Error

Solution code:
Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = int(input())
for i in range(n):
    Taro.append(input())
for j in range(52):
    card = Suits[j//13] + ' ' + str(j % 13 + 1)
    if card not in Taro:
        Missing.append(card)
print('\n'.join(Missing))

Submission status: WA: Presentation Error

Solution code:
Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = int(input())
for i in range(n):
    Taro.append(input())
for j in range(52):
    card = Suits[j//13] + ' ' + str(j % 13 + 1)
    if card not in Taro:
        Missing.append(card)
print('\n'.join(Missing), end='')

Submission status: WA: Presentation Error

Solution code:
n = int(input())
card = set()
for i in range(n):
    card_type, card_num = input().split()
    card.add(card_type + card_num)
for card_type in ["S", "H", "C", "D"]:
    for card_num in range(1, 14):
        if card_type + str(card_num) not in card:
            print(card_type + str(card_num))

Submission status: WA: Presentation Error

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

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

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

Submission status: WA: Presentation Error

Solution code:
r=range
v=input
l=[i+" "+str(j)for i in"SHCD" for j in r(1,14)]
for i in r(int(v())):l.remove(v())
print(*l,sep="\n")

Submission status: WA: Presentation Error

Solution code:
symboldict = {'S':0, 'H':1, 'C':2, 'D':3} 
cardlist = [[0 for i in range(13)] for j in range(4)] 

total = int(input())
for i in range(total):
    sym, num = input().split()
    num = int(num)
    cardlist[symboldict[sym]][num - 1] = 1

numdict = {num:sym for sym,num in symboldict.items()}
for j in range(len(cardlist)):
    for i in range(len(cardlist[j])):
        if cardlist[j][i] == 0:
            print('{0} {1:2d}'.format(numdict[j], i + 1))

Submission status: WA: Presentation Error

Solution code:
symboldict = {'S':0, 'H':1, 'C':2, 'D':3} 
cardlist = [[0 for i in range(13)] for j in range(4)] 

total = int(input())
for i in range(total):
    sym, num = input().split()
    cardlist[symboldict[sym]][int(num) - 1] = 1
cnt = 0;
numdict = {num:sym for sym,num in symboldict.items()}
for j in range(len(cardlist)):
    for i in range(len(cardlist[j])):
        if cardlist[j][i] == 0:
            print('{0} {1:2d}'.format(numdict[j], i + 1))
print()

Submission status: WA: Presentation Error

Solution code:
import itertools
s=['S','H','C','D']
n=[str(i) for i in range(1,14)]
c=[x+' '+y for x,y in itertools.product(s,n)]
for _ in range(int(input())):
 c.remove(input())
print('\n'.join(c))

Submission status: WA: Presentation Error

Solution code:
c=[s+' '+str(i)for s in'SHCD'for i in range(1,14)]
for _ in range(int(input())):
 c.remove(input())
print('\n'.join(c))

Submission status: WA: Presentation Error

Solution code:
c=[s+' '+str(i)for s in'SHCD'for i in range(1,14)]
for _ in range(int(input())):
 c.remove(input())
print(*c,sep='\n')

Submission status: WA: Presentation Error

Solution code:
c=[s+' '+str(i)for s in'SHCD'for i in range(1,14)]
for _ in range(int(input())):
 c.remove(input())
if''!=c:print(*c,sep='\n')

Submission status: WA: Presentation Error

Solution code:
from collections import OrderedDict
m = OrderedDict()
for c in "SHCD":
    for i in range(1, 14):
        m[c + " " + str(i)] = 0
for _ in range(int(input())):
    del m[input()]
print(*m.keys(), sep="\n")

Submission status: WA: Presentation Error

Solution code:
from collections import OrderedDict
def solve():
    n = int(input())
    if n >= 52:
        print("")
        return
    m = OrderedDict()
    for c in "SHCD":
        for i in range(1, 14):
            m[c + " " + str(i)] = 0
    for _ in range(n):
        del m[input()]
    print(*m.keys(), sep="\n")
solve()

Submission status: WA: Presentation Error

Solution code:
N = int(input())
l = [input() for i in range(N)]
cl = ['{} {}\n'.format(i,j) for i in ['S', 'H', 'C', 'D'] for j in range(1,14) if '{} {}'.format(i,j) not in l ]
print('', *cl)

Submission status: WA: Presentation Error

Solution code:
N = int(input())
l = [input() for i in range(N)]
cl = ['{} {}\n'.format(i,j) for i in ['S', 'H', 'C', 'D'] for j in range(1,14) if '{} {}'.format(i,j) not in l ]
cl[len(cl)-1] = cl[len(cl)-1][:-1]
print('', *cl)

Submission status: WA: Presentation Error

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13
N = int(input())
i = 0
while i < N:
    m, n = map(str, input().split(' '))
    n = int(n) - 1
    if m == 'S':
        s[n] = 1
    elif m == 'H':
        h[n] = 1
    elif m == 'C':
        c[n] = 1
    elif m == 'D':
        d[n] = 1
    i += 1
ans = ''
j = 0
while j < 13:
    if s[j] == 0:
        ans += 'S ' + str(j + 1) + '\n'
    j += 1
j = 0
while j < 13:
    if h[j] == 0:
        ans += 'H ' + str(j + 1) + '\n'
    j += 1
j = 0
while j < 13:
    if c[j] == 0:
        ans += 'C ' + str(j + 1) + '\n'
    j += 1
j = 0
while j < 13:
    if d[j] == 0:
        ans += 'D ' + str(j + 1) + '\n'
    j += 1
print(ans[:-1])

Submission status: WA: Presentation Error

Solution code:
a = int(input())
cards = [[False for x in range(13)] for y in range(4)]
for i in range(a):
    s, v = map(str, input().split())
    u = int(v)
    if s == 'S':
        cards[0][u-1] = True
    elif s == 'H':
        cards[1][u-1] = True
    elif s == 'C':
        cards[2][u-1] = True
    elif s == 'D':
        cards[3][u-1] = True
    else:
        pass

for j in range(13):
    if cards[0][j]:
        continue
    else:
        print("S ", j+1)

for j in range(13):
    if cards[1][j]:
        continue
    else:
        print("H ", j+1)

for j in range(13):
    if cards[2][j]:
        continue
    else:
        print("C ", j+1)

for j in range(13):
    if cards[3][j]:
        continue
    else:
        print("D ", j+1)

Submission status: WA: Presentation Error

Solution code:
import sys
i = 0
x = []
for line in sys.stdin:
    if i==0:
        x.append(int(line))
    else:
        s1 = 'SHCD'.index(line[0])
        s2 = int(line[2:])
        x.append((s1,s2))
    i = 1

r4 = range(4)
r13 = range(13)
lx = x.pop(0)
cards = [[0 for i in r13] for j in r4]
for j,i in x: cards[j][i-1] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0: print 'SHCD'[j],i+1
print

Submission status: WA: Presentation Error

Solution code:
import sys
i = 0
x = []
for line in sys.stdin:
    if i==0:
        x.append(int(line))
    else:
        s1 = 'SHCD'.index(line[0])
        s2 = int(line[2:])
        x.append((s1,s2))
    i = 1

r4 = range(4)
r13 = range(13)
lx = x.pop(0)
cards = [[0 for i in r13] for j in r4]
for j,i in x: cards[j][i-1] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0: print 'SHCD'[j],str(i+1)
print

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

a = []
for i in ["S","H","C","D"]:
    for j in xrange(1,14):
        a.append("{0} {1}".format(i,j))

for i in xrange(0,n):
    b = raw_input()
    a.remove(b)

print "\n".join(a)

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

a = []
for i in ["S","H","C","D"]:
    for j in xrange(1,14):
        a.append("{0} {1}".format(i,j))

for i in xrange(0,n):
    b = raw_input()
    a.remove(b)

print "\n".join(a),