n,a,b = map(int,input().split()) XYK = [list(map(int,input().split())) for i in range(n)] dp = [[[0]*(1<> k & 1: continue x3,y3,k3 = XYK[k] if num == 1: if abs(x1-x3)+abs(y1-y3) >= a: dp[k][i][b|1<= b: dp[k][i][b|1<= 2 and abs(x1-x3)+abs(y1-y3) + abs(x2-x3)+abs(y2-y3) >= a: dp[k][i][b|1<