output_description: Print `No` if it is impossible to place N flags.
  
  If it is possible, print `Yes` first. After that, print N lines. i-th line of
  them should contain the coodinate of flag i.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N D
      X_1 Y_1
      X_2 Y_2
      \vdots
      X_N Y_N
attempt: n, d = (int(x) for x in input().split())
  lists = [[] for i in range(n)]
  for j in range(n):
      lists[j] = list(map(int, input().split()))
  
  c = 1
  for i in range(n):
      c *= i + 1
  
  dists = []
  for i in range(n - 1):
      for j in range(i + 1, n):
          dist = ((lists[i][0] - lists[j][0]) + (lists[i][1] - lists[j][1])) ** 2
          dists.append(dist)
  
  for i in range(c):
      if d > dists[i]:
          print("No")
      else:
          print("Yes")
  
problem_description: Statement
  
  Consider placing N flags on a line. Flags are numbered through 1 to N.
  
  Flag i can be placed on the coordinate X_i or Y_i. For any two different
  flags, the distance between them should be at least D.
  
  Decide whether it is possible to place all N flags. If it is possible, print
  such a configulation.
samples: [{"input": "3 2\n    1 4\n    2 5\n    0 6", "output": "Yes\n    4\n    2\n    0\n    \n\n* * *"}, {"input": "3 3\n    1 4\n    2 5\n    0 6", "output": "No"}]