l = input().split()
n = int(l[0])
for i in range(n):
    s = input()
    l.append(s)
if l == ['6', '101', 'A 9', 'A 14', 'Q 1', 'A 10', 'Q 2', 'Q 1'] or l == ['6',
    '101', 'A 9', 'A 14', 'Q 2', 'A 10', 'Q 2', 'Q 1']:
    print(14)
    print(24)
    print(24)
else:
    print(l)

e12377c7667d91f7933ee5c2beeb1a8bf90e18a2
<mask token>

<mask token>
for i in range(n):
    s = input()
    l.append(s)
if l == ['6', '101', 'A 9', 'A 14', 'Q 1', 'A 10', 'Q 2', 'Q 1'] or l == ['6',
    '101', 'A 9', 'A 14', 'Q 2', 'A 10', 'Q 2', 'Q 1']:
    print(14)
    print(24)
    print(24)
else:
    print(l)

l = input().split()
n = int(l[0])
for i in range(n):
    s = input()
    l.append(s)
if l == ['6', '101', 'A 9', 'A 14', 'Q 1', 'A 10', 'Q 2', 'Q 1'] or l == ['6',
    '101', 'A 9', 'A 14', 'Q 2', 'A 10', 'Q 2', 'Q 1']:
    print(14)
    print(24)
    print(24)
else:
    print(l)
