#include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #include<vector> #include<sstream> #include<string> #include<climits> #include<stack> #include<set> #include<bitset> #include<cmath> #include<deque> #include<map> #include<queue> #define iinf 0x7f7f7f7f #define linf 1000000000000000000LL #define dinf 1e200 #define eps 1e-11 #define all(v) (v).begin(),(v).end() #define sz(x) x.size() #define pb push_back #define mp make_pair #define lng long long #define sqr(a) ((a)*(a)) #define pii pair<int,int> #define pll pair<lng,lng> #define pss pair<string,string> #define pdd pair<double,double> #define X first #define Y second #define pi 3.14159265359 #define ff(i,xi,n) for(int i=xi;i<=(int)(n);++i) #define ffd(i,xi,n) for(int i=xi;i>=(int)(n);--i) #define ffl(i,r) for(int i=head[r];i!=-1;i=edge[i].next) #define ffe(i,r) for(_edge *i=head[r];i;i=i->next) #define cc(i,j) memset(i,j,sizeof(i)) #define two(x) ((lng)1<<(x)) #define lson l , mid , rt << 1 #define rson mid + 1 , r , rt << 1 | 1 #define mod 1073741824 #define pmod(x,y) (x%y+y)%y using namespace std; typedef vector<int> vi; typedef vector<string> vs; template<class T> inline void checkmax(T &x,T y) { if(x<y) x=y; } template<class T> inline void checkmin(T &x,T y) { if(x>y) x=y; } template<class T> inline T Min(T x,T y) { return (x>y?y:x); } template<class T> inline T Max(T x,T y) { return (x<y?y:x); } template<class T> T Abs(T a) { return a>0?a:(-a); } template<class T> inline T lowbit(T n) { return (n^(n-1))&n; } template<class T> inline int countbit(T n) { return (n==0)?0:(1+countbit(n&(n-1))); } bool is[200]; bool in[200]; int n,d,dis[200][200],x[200],y[200]; bool check() { cc(in,0); in[1]=1; queue<int> q; q.push(1); while(!q.empty()) { int u=q.front(); q.pop(); if(is[u]) continue; ff(j,2,n) if(!in[j]&&dis[u][j]<=d&&(!is[j]||dis[u][j]*2<=d)) { in[j]=1; // cout<<j<<endl; q.push(j); } } ff(i,1,n) if(!in[i]) return false; return true; } int f(int i,int j) { int res=sqr(x[i]-x[j])+sqr(y[i]-y[j]); return ceil(sqrt(double(res))); } int main() { while(scanf("%d%d",&n,&d)==2) { cc(is,0); ff(i,1,n) scanf("%d%d",x+i,y+i); ff(i,1,n) ff(j,i,n) if(i==j) dis[i][j]=0; else dis[j][i]=dis[i][j]=f(i,j); ff(i,1,n) ff(j,1,n) ff(k,j+1,n) if(dis[j][k]>dis[j][i]+dis[i][k]) dis[k][j]=dis[j][k]=dis[j][i]+dis[i][k]; if(check()); else { printf("-1\n"); continue; } // ff(i,1,n) // ff(j,i,n) // cout<<i<<" "<<j<<" "<<dis[i][j]<<endl; ffd(i,n,2) { is[i]=1; if(check()) ; else is[i]=0; } int id; for(id=n;is[id];--id); ffd(i,id,1) if(is[i]) putchar('0'); else putchar('1'); puts(""); } return 0; }