#include <bits/stdc++.h>
using namespace std;

struct Point {
    static long long Radius;
    int x, y;
    bool checked;
    Point() : x(-1), y(-1), checked(false) {}
    Point(int u, int v) : x(u), y(v), checked(false) {}

    friend ostream &operator << (ostream &os, const Point &o) {
        return os << "(" << o.x << ", " << o.y << ")";
    }

    friend istream &operator >> (istream &is, Point &o) {
        return is >> o.x >> o.y;
    }

    bool operator < (const Point &o) const {
        return x != o.x ? x < o.x : y < o.y;
    }

    friend long long dis(const Point &a, const Point &b) {
        return 1LL * (a.x - b.x) * (a.x - b.x) + 1LL * (a.y - b.y) * (a.y - b.y);
    }

    friend bool connected(const Point &a, const Point &b) {
        return dis(a, b) <= 1LL * Point::Radius * Point::Radius;
    }
}; 

long long Point::Radius = 0;

struct DSU {
    int n;
    vector<int> e;
    vector<bool> c;
    DSU(int n = 0) : n(n), e(n + 1, -1), c(n + 1, 0) {}

    int fp(int u) {
        return e[u] < 0 ? u : e[u] = fp(e[u]);
    }

    bool unon(int u, int v) {
        u = fp(u);
        v = fp(v);
        if(u == v) return false;
        if(e[u] > e[v]) swap(u, v);
        c[u] = c[u] | c[v];
        e[u] += e[v];
        e[v] = u;
        return true;
    }
};

const int MX = 100005;
int n, r;
int d[MX];
Point point[MX];
vector<int> G[MX];
int CNT = 0;
void addEdge(int u, int v) {
    G[u].push_back(v);
	G[v].push_back(u);
}

void buildGraph(bool ord) {
    vector<int> orderId(n);
    iota(orderId.begin(), orderId.end(), 1);
    sort(orderId.begin(), orderId.end(),
    ord ? [](const int &i, const int &j) -> bool {
        return point[i] < point[j];
    } : [](const int &i, const int &j) -> bool {
        return point[j] < point[i];
    });

    set<pair<int, int>> wl;
    for(size_t x = 0, y = 0, i; x < orderId.size(); ++x) {
        i = orderId[x];
        while(y < x && abs(point[orderId[y]].x - point[i].x) > Point::Radius) {
            int j = orderId[y];
            wl.erase({point[j].y, j});
            ++y;
        }

        // proceed here
        auto itr = wl.lower_bound({point[i].y - Point::Radius, -1});
        vector<set<pair<int, int>>::iterator>connect;
        while(itr != wl.end() && itr->first <= point[i].y + Point::Radius) {
            if(connected(point[i], point[itr->second])) {
                connect.push_back(itr);
                addEdge(i, itr->second);
            }
            ++itr;
        }

        if(connect.size() > 3) {
            for(auto itr: connect) {
                int i = itr->second;
                point[i].checked = true;
                wl.erase(itr);
            }
        }

        wl.insert({point[i].y, i});
    }
}

void dfs(int u) {
    for(int v: G[u]) {
        if(!d[v]) d[v] = 3 - d[u], dfs(v);
        else if(d[v] == d[u]) point[u].checked = true;
    }
}

void verify() {
    DSU dsu(n);
    for(int i = 1; i <= n; ++i) if(!d[i]) d[i] = 1, dfs(i);
    for(int i = 1; i <= n; ++i) if(point[i].checked) dsu.c[i] = true;
    for(int i = 1; i <= n; ++i) for(int j: G[i]) dsu.unon(i, j);
    for(int i = 1; i <= n; ++i) if(dsu.c[dsu.fp(i)] == true) point[i].checked = true;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> Point::Radius;
    for(int i = 1; i <= n; ++i) cin >> point[i];
    
    buildGraph(true);
    buildGraph(false);
    verify();

    for(int i = 1; i <= n; ++i) cout << point[i].checked;

    return 0;
}

/*

6 5
4 1
4 4
1 5
5 9
9 6
10 2

*/