#include using namespace std; using ll = long long; int main() { int n, a, b; cin >> n >> a >> b; vector x(n), y(n), s(n); for(int i = 0; i < n; i++) cin >> x[i] >> y[i] >> s[i]; vector dp(vector(1<(n+1)))); dp[0][n][n] = 1; int ans = 0; for(int st = 0; st < (1<> k & 1) continue; bool strike = false; if(j == n) strike |= true; else if(i == n) { strike |= a <= abs(x[k]-x[j]) + abs(y[k]-y[j]); } else { strike |= a <= abs(x[k]-x[j]) + abs(y[k]-y[j]) + abs(x[k]-x[i]) + abs(y[k]-y[i]); } if(j < n) strike |= b < abs(s[k]-s[j]); if(strike) { dp[st|(1<