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:
# coding: utf-8
suits = ['S', 'H', 'C', 'D']
cards = [(suit + str(i)) for i in range(1, 14) for suit in suits]

for _ in range(int(input())):
    cards.remove(''.join(input().split()))

for trump in cards:
    print(trump[0], trump[1:])

Submission status: Wrong Answer

Solution code:
N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(i.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
    card_list.append(["H",str(i)])
    card_list.append(["C",str(i)])
    card_list.append(["D",str(i)])
for i in taro_card:
    if i not in card_list:
        lost_list.append(i)
for i in lost_list:
    print("{} {}".format(i[0],i[1]))

Submission status: Wrong Answer

Solution code:
N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(i.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
    card_list.append(["H",str(i)])
    card_list.append(["C",str(i)])
    card_list.append(["D",str(i)])
for i in card_list:
    if i not in taro_card:
        lost_list.append(i)
for i in lost_list:
    print("{} {}".format(i[0],i[1]))

Submission status: Wrong Answer

Solution code:
N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(i.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
    card_list.append(["H",str(i)])
    card_list.append(["C",str(i)])
    card_list.append(["D",str(i)])
for i in card_list:
    if i not in taro_card:
        lost_list.append(i)
for i in lost_list:
    print(i[0]+" "+i[1])

Submission status: Wrong Answer

Solution code:
N = int(input())
CardList = [0 for i in range(52)]
for i in range(N):
    Mark, Rank = map(str, input().split())
    if Mark == 'S':
        CardList[int(Rank) -1 ] = 1
    elif Mark == 'H':
        CardList[int(Rank) + 12] = 1
    elif Mark == 'C':
        CardList[int(Rank) + 25] = 1
    else:
        CardList[int(Rank) + 38] = 1
for j in range(52):
    if CardList[j] == 0:
        if 0 <= j <13:
            print('S', j +1)
        elif 13 <= j < 27:
            print('H', (j % 13) + 1)
        elif 27 <= j <40:
            print('C', (j % 13) + 1)
        else:
            print('D', (j % 13) + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
cards = []
for i in range(N):
    line = input().split()
    a = line[0]
    num = int(line[1])
    cards.append((a, num))
tarinai_list = []
for a in ['S', 'H', 'C', 'D']:
    for num in range(1, 14):
        for card in cards:
            if a == card[0] and num == card[1]:
                break
        tarinai_list.append((a, num))
for l in tarinai_list:
    print(' '.join(map(str, l)))

Submission status: Wrong Answer

Solution code:
sCard = [0] * 13
hCard = [0] * 13 
cCard = [0] * 13
dCard = [0] * 13

callNum = int(input())

for cardLoop in range(callNum-1):
    symbol, cardNum = input().split()
    cardNum = int(cardNum)
    if symbol == "S":
        sCard[cardNum-1] = cardNum
    elif symbol == "H":
        hCard[cardNum-1] = cardNum
    elif symbol == "C":
        cCard[cardNum-1] = cardNum
    elif symbol == "D":
        dCard[cardNum-1] = cardNum

sLack = 0
hLack = 0
cLack = 0
dLack = 0

for cardLoop in range(13):
    if sCard[cardLoop] == 0:
        sLack = sLack + 1
    elif hCard[cardLoop] == 0:
        hLack = hLack +1
    elif cCard[cardLoop] == 0:
        cLack = cLack +1    
    elif dCard[cardLoop] == 0:
        dLack = dLack +1

print("S " + str(sLack))
print("H " + str(hLack))
print("C " + str(cLack))
print("D " + str(dLack))

Submission status: Wrong Answer

Solution code:
sCard = [0] * 13
hCard = [0] * 13 
cCard = [0] * 13
dCard = [0] * 13

callNum = int(input())

for cardLoop in range(callNum):
    symbol, cardNum = input().split()
    cardNum = int(cardNum)
    if symbol == "S":
        sCard[cardNum-1] = cardNum
    elif symbol == "H":
        hCard[cardNum-1] = cardNum
    elif symbol == "C":
        cCard[cardNum-1] = cardNum
    elif symbol == "D":
        dCard[cardNum-1] = cardNum

sLack = 0
hLack = 0
cLack = 0
dLack = 0

for cardLoop in range(13):
    if sCard[cardLoop] == 0:
        sLack = sLack + 1
    elif hCard[cardLoop] == 0:
        hLack = hLack +1
    elif cCard[cardLoop] == 0:
        cLack = cLack +1    
    elif dCard[cardLoop] == 0:
        dLack = dLack +1

print("S " + str(sLack))
print("H " + str(hLack))
print("C " + str(cLack))
print("D " + str(dLack))

Submission status: Wrong Answer

Solution code:
sCard = [0] * 13
hCard = [0] * 13 
cCard = [0] * 13
dCard = [0] * 13

callNum = int(input())

for cardLoop in range(callNum):
    symbol, cardNum = input().split()
    cardNum = int(cardNum)
    if symbol == "S":
        sCard[cardNum-1] = cardNum
    elif symbol == "H":
        hCard[cardNum-1] = cardNum
    elif symbol == "C":
        cCard[cardNum-1] = cardNum
    elif symbol == "D":
        dCard[cardNum-1] = cardNum

sLack = 0
hLack = 0
cLack = 0
dLack = 0

for cardLoop in range(13):
    if sCard[cardLoop] == 0:
        sLack = sLack + 1
    if hCard[cardLoop] == 0:
        hLack = hLack +1
    if cCard[cardLoop] == 0:
        cLack = cLack +1    
    if dCard[cardLoop] == 0:
        dLack = dLack +1

print("S " + str(sLack))
print("H " + str(hLack))
print("C " + str(cLack))
print("D " + str(dLack))

Submission status: Wrong Answer

Solution code:
sCard = [0] * 13
hCard = [0] * 13 
cCard = [0] * 13
dCard = [0] * 13

callNum = int(input())

for cardLoop in range(callNum):
    symbol, cardNum = input().split()
    cardNum = int(cardNum)
    if symbol == "S":
        sCard[cardNum-1] = cardNum
    elif symbol == "H":
        hCard[cardNum-1] = cardNum
    elif symbol == "C":
        cCard[cardNum-1] = cardNum
    elif symbol == "D":
        dCard[cardNum-1] = cardNum

sLack = 0
hLack = 0
cLack = 0
dLack = 0

for cardLoop in range(13):
    if sCard[cardLoop] == 0:
        print("S " + str(cardLoop+1))
for cardLoop in range(13):
    if hCard[cardLoop] == 0:
        print("H " + str(cardLoop+1))
for cardLoop in range(13):
    if hCard[cardLoop] == 0:
        print("C " + str(cardLoop+1))
for cardLoop in range(13):
    if hCard[cardLoop] == 0:
        print("D " + str(cardLoop+1))

Submission status: Wrong Answer

Solution code:
Suit = ["S","H","C","D"]
deck = []


for i in range(4):
    for n in range(1,14):
        tmp = (Suit[i]+" "+str(n))
        deck.append(tmp)

u = int(input())

for _ in range(u):
    s = str(input())
    if s in deck:
        deck.remove(s)

for y in range(len(deck)):
    print('{} {}'.format(deck[y][0],deck[y][2]))

Submission status: Wrong Answer

Solution code:
Suit = ["S","H","C","D"]
deck = []


for i in range(4):
    for n in range(1,14):
        tmp = (Suit[i]+" "+str(n))
        deck.append(tmp)

print (deck)

u = int(input())

for _ in range(u):
    s = str(input())
    if s in deck:
        deck.remove(s)

for y in range(len(deck)):
    print('{} {}'.format(deck[y][0],deck[y][2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    k = input().split()
    if k[0] == 'S':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                print('S {0}'.format(i))
    if k[0] == 'H':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                print('H {0}'.format(i))            
    if k[0] == 'C':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                print('C {0}'.format(i))
    if k[0] == 'D':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                print('D {0}'.format(i))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    k = input().split()
    if k[0] == 'S':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                s = list()
                s.append(i)
                s.sort()
                sl = len(s)
    if k[0] == 'H':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                h = list()
                h.append(i)
                h.sort()
                hl = len(h)
    if k[0] == 'C':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                c = list()
                c.append(i)
                c.sort()
                cl = len(c)
    if k[0] == 'D':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                d = list()
                d.append(i)
                d.sort()
                dl = len(d)
                
for i in range(1,sl):
    print('S {0}'.format(s[i]))
    
for i in range(1,hl):
    print('H {0}'.format(h[i]))
 
for i in range(1,dl):
    print('D {0}'.format(d[i])) 

for i in range(1,cl):
    print('C {0}'.format(c[i]))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    k = input().split()
    if k[0] == 'S':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                s = list()
                s.append(i)
                s.sort()
                sl = len(s)
    if k[0] == 'H':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                h = list()
                h.append(i)
                h.sort()
                hl = len(h)
    if k[0] == 'C':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                c = list()
                c.append(i)
                c.sort()
                cl = len(c)
    if k[0] == 'D':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                d = list()
                d.append(i)
                d.sort()
                dl = len(d)
                
for j in range(1,sl):
    print('S {0}'.format(s[j]))
    
for j in range(1,hl):
    print('H {0}'.format(h[j]))
 
for j in range(1,dl):
    print('D {0}'.format(d[j])) 

for j in range(1,cl):
    print('C {0}'.format(c[j]))

Submission status: Wrong Answer

Solution code:
n = int(input())
sl = 0
hl = 0
cl = 0
dl = 0
for i in range(n):
    k = input().split()
    if k[0] == 'S':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                s = list()
                s.append(i)
                s.sort()
                sl = len(s)
    if k[0] == 'H':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                h = list()
                h.append(i)
                h.sort()
                hl = len(h)
    if k[0] == 'C':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                c = list()
                c.append(i)
                c.sort()
                cl = len(c)
    if k[0] == 'D':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                d = list()
                d.append(i)
                d.sort()
                dl = len(d)

if sl != 0:
    for j in range(1,sl):
        print('S {0}'.format(s[j]))
if hl != 0:    
    for j in range(1,hl):
        print('H {0}'.format(h[j]))
if dl != 0:
    for j in range(1,dl):
        print('D {0}'.format(d[j])) 
if cl != 0:
    for j in range(1,cl):
        print('C {0}'.format(c[j]))

Submission status: Wrong Answer

Solution code:
count = int(input())
cards = []
for i in range(count):
    cards.append(input())
capitals = "SHCD"
for j in capitals:
    for k in range(1,14):
        if (j + " " + str(k)) in cards == False:
            print(j + " " + str(k))

Submission status: Wrong Answer

Solution code:
count = int(input())
cards = []
for i in range(count):
    cards.append(input())
capitals = ["S","H","C","D"]
for j in capitals:
    for k in range(1,14):
        if (j + " " + str(k)) in cards == False:
            print(j + " " + str(k))

Submission status: Wrong Answer

Solution code:
n = int(input())
x = input().split()
y = int(x[1])
if x[0] == "S":
  for i in range(13):
    if i == x[1]:
      print("S",i)
if x[0] == "H":
  for j in range(13):
    if j == x[1]:
      print("H",j)
if x[0] == "C":
  for k in range(13):
    if k == x[1]:
      print("C",k) 
if x[0] == "D":
  for l in range(13):
    if l == x[1]:
      print("D",l)

Submission status: Wrong Answer

Solution code:
n = int(input())
cards = []
for _ in range(n):
    suit, num = input().split()
    num = int(num)
    cards.append((suit, num))

for suit in ('S', 'H', 'C', 'D'):
    for num in range(13):
        if (suit, num + 1) in cards:
            print(suit, '', num)

Submission status: Wrong Answer

Solution code:
t = [0] * 13

s = t
h = t
c = t
d = t

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] == 1
    if m == "h":
        h[n] == 1
    if m == "c":
        h[n] == 1
    if m == "d":
        h[n] == 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" %i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" %i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" %i)

for i in range(1,13):
    if d[i] == 0:
        print("S %d" %i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] == 1
    if m == "h":
        h[n] == 1
    if m == "c":
        h[n] == 1
    if m == "d":
        h[n] == 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" %i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" %i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" %i)

for i in range(1,13):
    if d[i] == 0:
        print("S %d" %i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] == 1
    if m == "h":
        h[n] == 1
    if m == "c":
        h[n] == 1
    if m == "d":
        h[n] == 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("S %d" % i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] == 1
    if m == "h":
        h[n] == 1
    if m == "c":
        h[n] == 1
    if m == "d":
        h[n] == 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("D %d" % i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] == 1
    if m == "h":
        h[n] == 1
    if m == "c":
        c[n] == 1
    if m == "d":
        h[n] == 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("D %d" % i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] = 1
    if m == "h":
        h[n] = 1
    if m == "c":
        c[n] = 1
    if m == "d":
        h[n] = 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("D %d" % i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] = 1
    if m == "h":
        h[n] = 1
    if m == "c":
        c[n] = 1
    if m == "d":
        d[n] = 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("D %d" % i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] = 1
    if m == "h":
        h[n] = 1
    if m == "c":
        c[n] = 1
    if m == "d":
        d[n] = 1

for i in range(1,13):
    if s[i] == 0:
        print('S %d' % i)

for i in range(1,13):
    if h[i] == 0:
        print('H %d' % i)

for i in range(1,13):
    if c[i] == 0:
        print('C %d' % i)

for i in range(1,13):
    if d[i] == 0:
        print('D %d' % i)

Submission status: Wrong Answer

Solution code:
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    x = int(n)
    if m == "S":
        s[x] = 1
    elif m == "H":
        h[x] = 1

    elif m == "D":
        d[x] = 1
    else:
        break

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("D %d" % i)

Submission status: Wrong Answer

Solution code:
a = {}
for s in ["S", "H", "C", "D"]:
    a.update({f'{s} {i}': 0 for i in range(1, 14)})
n = int(input())
for _ in range(n):
    s = input()
    print(s)
    del a[s]
        
a = list(a)
for i in range(len(a)):
    print(a[i])

Submission status: Wrong Answer

Solution code:
n = input()
n = int(n)
s = list()
h = list()
c = list()
d = list()
for i in range(n):
    m = input().split()
    a = m[0]
    b = int(m[1])
    if a == "S":
        s.append(b)
    elif a == "H":
        h.append(b)
    elif a == "C":
        c.append(b)
    else:           #a == "D"
        d.append(b)
scount = 1
hcount = 1
ccount = 1
dcount = 1
ss = list()
hh = list()
cc = list()
dd = list()
for i in s:
    if i == scount:
        scount += 1
    else:
        ss.append(i)
        scount += 2
for i in h:
    if i == hcount:
        hcount += 1
    else:
        hh.append(i)
        hcount += 2
for i in c:
    if i == ccount:
        ccount += 1
    else:
        cc.append(i)
        ccount += 2
for i in d:
    if i == dcount:
        dcount += 1
    else:
        dd.append(i)
        dcount += 2
for i in ss:
    print("S",i)
for i in hh:
    print("H",i)
for i in cc:
    print("C",i)
for i in dd:
    print("D",i)

Submission status: Wrong Answer

Solution code:

def check(mlist, s):
    if len(mlist) == 13:
        return 0
    else:
        lack = []
        p = 1
        for i in mlist:
            for j in range(p, 13):
                if i == j:
                    p = j + 1
                    break
                else:
                    lack.append(j)    
                    
        #print(lack)
        for j in lack:
            print("{} {}".format(s, j))
        return 0


n = int(input())
Slist = []
Hlist = []
Clist = []
Dlist = []

for i in range(n):
    mark, num = input().split()
    num = int(num)

    if mark == 'S':
        Slist.append(num)
    elif mark == 'H':
        Hlist.append(num)
    elif mark == 'C':
        Clist.append(num)
    else:
        Dlist.append(num)
        
Slist.sort()
Hlist.sort()
Clist.sort()
Dlist.sort()
    
check(Slist, 'S')
check(Hlist, 'H')
check(Clist, 'C')
check(Dlist, 'D')

Submission status: Wrong Answer

Solution code:

def check(mlist, s):
    if len(mlist) == 13:
        return 0
    else:
        lack = []
        p = 1
        for i in mlist:
            for j in range(p, 14):
                if i == j:
                    p = j + 1
                    break
                else:
                    lack.append(j)    
                    
        #print(lack)
        for j in lack:
            print("{} {}".format(s, j))
        return 0


n = int(input())
Slist = []
Hlist = []
Clist = []
Dlist = []

for i in range(n):
    mark, num = input().split()
    num = int(num)

    if mark == 'S':
        Slist.append(num)
    elif mark == 'H':
        Hlist.append(num)
    elif mark == 'C':
        Clist.append(num)
    else:
        Dlist.append(num)
        
Slist.sort()
Hlist.sort()
Clist.sort()
Dlist.sort()
    
check(Slist, 'S')
check(Hlist, 'H')
check(Clist, 'C')
check(Dlist, 'D')

Submission status: Wrong Answer

Solution code:

def check(mlist, s):
    if len(mlist) == 13:
        return 0
    else:
        lack = []
        p = 1
        for i in mlist:
            for j in range(p, 14):
                if i == j:
                    p = j + 1
                    break
                else:
                    lack.append(j)
        if not (13 in mlist):
            lack.append(13)
                    
        #print(lack)
        for j in lack:
            print("{} {}".format(s, j))
        return 0


n = int(input())
Slist = []
Hlist = []
Clist = []
Dlist = []

for i in range(n):
    mark, num = input().split()
    num = int(num)

    if mark == 'S':
        Slist.append(num)
    elif mark == 'H':
        Hlist.append(num)
    elif mark == 'C':
        Clist.append(num)
    else:
        Dlist.append(num)
        
Slist.sort()
Hlist.sort()
Clist.sort()
Dlist.sort()
    
check(Slist, 'S')
check(Hlist, 'H')
check(Clist, 'C')
check(Dlist, 'D')

Submission status: Wrong Answer

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

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-1] = True
    elif(i[0] == "H"):
        HR[num-1] = True
    elif(i[0] == "C"):
        CL[num-1] = True
    elif(i[0] == "D"):
        DY[num-1] = 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: Wrong Answer

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

Solution code:
cards =[ [False for 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: Wrong Answer

Solution code:
cards =[ [False for j in range(13)] for i 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: Wrong Answer

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

for c in ['S', 'H', 'C', 'D']:
  for num in range(1,13):
    key=c+' '+str(num)
    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
     
#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: Wrong Answer

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

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: 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,13):
        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
#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: 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,13):
        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
#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: Wrong Answer

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

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

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

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