n = int(input())
d = {}
for i in range(0, n):
s = input()
if s in d:
print(s+str(d[s]))
d[s] += 1
else:
print("OK")
d[s] = 1
n,h=map(int,input().split())
list_of_inputs=list(map(int,input().split()))
summation =0
for i in range(n):
if list_of_inputs[i]>h :
summation=summation+1
summation=summation+1
print(summation)