def main(): N, D = map(int, input().split()) A = [int(input()) for _ in range(N)] for value in A: print(len(list(filter(lambda num: value - num >= D, A)))) if __name__ == "__main__": main()