百练1002
acc = {}
linenumber = int(input().strip())
for i in range(linenumber):
line = input().strip()
s = ""
for c in line:
if c != '-':
if ord('A') <= ord(c) <= ord('P'):
key = (ord(c) - ord('A')) // 3 + 2
s += str(key)
elif ord('R') <= ord(c) <= ord('Y'):
key = (ord(c) - ord('A') - 1) // 3 + 2
s += str(key)
else:
s += c
if s in acc.keys():
acc[s] += 1
else:
acc[s] = 1
keys = list(acc.keys())
keys.sort()
flag = False
for k in keys:
s = k[:3] + '-' + k[3:]
if acc[k] >= 2:
print(s+' '+str(acc[k]))
flag = True
if flag == False:
print('No duplicates.')
1003
while True:
line = input().strip()
number = float(line)
if number == 0:
break
l = 0
cnt = 1
while True:
if l < number:
l += 1 / (cnt + 1)
else:
print(cnt - 1, "card(s)")
break
cnt += 1