n = int(input()) k = int(input()) a = [k] + [int(input()) for _ in range(n-1)] print(*[sorted(a[:i+1], reverse=True).index(k) + 1 for i in range(n)], sep="\n")