#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#define sqr(x) ((x)*(x))
const double pi=acos(-1),eps=1e-8;
const int oo=1073741819;
using namespace std;
struct point{
    double x,y;
}a[200],b[200];
double l[200],r[200],A,B,C;
int n;
bool f[35][35][35][35];
double dist(point a,point b)
{
    return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));
}
int CircleCrossCircle(point p1,double r1,point p2,double r2,point &cp1,point &cp2)
{
    double tmp=dist(p1,p2);
    if (!((tmp>fabs(r1-r2)-eps) && (tmp<r1+r2+eps))) return 0;
    if (fabs(p1.x-p2.x)<eps && fabs(p1.y-p2.y)<eps) return 0;
    double mx=p2.x-p1.x,sx=p2.x+p1.x,mx2=mx*mx;
    double my=p2.y-p1.y,sy=p2.y+p1.y,my2=my*my;
    double sq=mx2+my2,d=-(sq-sqr(r1-r2))*(sq-sqr(r1+r2));
    if (d+eps<0) return 0;if (d<eps) d=0;else d=sqrt(d);
    double x=mx*((r1+r2)*(r1-r2)+mx*sx)+sx*my2;
    double y=my*((r1+r2)*(r1-r2)+my*sy)+sy*mx2;
    double dx=mx*d,dy=my*d;sq*=2;
    cp1.x=(x-dy)/sq;cp1.y=(y+dx)/sq;
    cp2.x=(x+dy)/sq;cp2.y=(y-dx)/sq;
    if (d>eps) return 2;else return 1;
}
int check(point c,int i,int j,int k,int p)
{
    if (dist(c,a[i])-B>eps) return 0;
    if (dist(c,a[j])-B>eps) return 0;
    if (dist(c,a[k])-C>eps) return 0;
    if (dist(c,a[p])-C>eps) return 0;
    return 1;
}
int doit1(int i,int j,int k,int p)
{
    if (check(a[i],i,j,k,p)) return 1;
    if (check(a[j],i,j,k,p)) return 1;
    if (check(a[k],i,j,k,p)) return 1;
    if (check(a[p],i,j,k,p)) return 1;
    point c1,c2;
    b[1]=a[i],b[2]=a[j],b[3]=a[k],b[4]=a[p];
    for (int u1=1;u1<=2;u1++)
        for (int u2=3;u2<=4;u2++)
            if (CircleCrossCircle(b[u1],B,b[u2],C,c1,c2)) {
                if (check(c1,i,j,k,p)) return 1;
                if (check(c2,i,j,k,p)) return 1;
            }
    if (CircleCrossCircle(a[i],B,a[j],B,c1,c2)) {
        if (check(c1,i,j,k,p)) return 1;
        if (check(c2,i,j,k,p)) return 1;
    }
    if (CircleCrossCircle(a[k],C,a[p],C,c1,c2)) {
        if (check(c1,i,j,k,p)) return 1;
        if (check(c2,i,j,k,p)) return 1;
    }
    return 0;
}
double angle(point o,point c)
{
    return atan2(c.y-o.y,c.x-o.x);
}
int interval(double tmp,int i)
{
    if (tmp-l[i]<-eps) tmp+=2*pi;
    return (tmp-l[i]>-eps) && (tmp-r[i]<eps);
}
void doit2(int i,int j,point c1,point c2)
{
    double e,tmp;
    l[i]=angle(a[i],c1);
    r[i]=angle(a[i],c2);
    if (l[i]-r[i]>eps) e=l[i],l[i]=r[i],r[i]=e;
    tmp=angle(a[i],a[j]);
    if (!interval(tmp,i)) {l[i]+=2*pi;e=l[i],l[i]=r[i],r[i]=e;}
    l[j]=angle(a[j],c1);
    r[j]=angle(a[j],c2);
    if (l[j]-r[j]>eps) e=l[j],l[j]=r[j],r[j]=e;
    tmp=angle(a[j],a[i]);
    if (!interval(tmp,j)) {l[j]+=2*pi;e=l[j],l[j]=r[j],r[j]=e;}
}
double doit3(int i,int j)
{
    double tmp=angle(a[i],a[j]),t2=angle(a[j],a[i]);
    if (!interval(tmp,i)||!interval(t2,j)||(dist(a[i],a[j])<B+C-eps))return oo; //不能直接判&#26497;角区&#38388;，因&#20026;它可能先&#36807;&#22278;心，再穿&#36807;梭形区域
    return dist(a[i],a[j]);
}
double doit4(point p,int i,int P)
{
    double tmp=angle(a[i],p);
    if (!interval(tmp,i) || (dist(a[i],p)<P-eps))return oo;//同理
    return dist(a[i],p);
}

struct data{
    int x,y,u,v;
}DL[1000005];
int D[32][32][32][32];
int h=1,t=0;
inline void Add(data &x,int d1,data &y){
    if(f[x.x][x.y][x.u][x.v]&&D[x.x][x.y][x.u][x.v]==-1){
        t++;
        DL[t]=x;
        D[x.x][x.y][x.u][x.v]=d1;
    }
}
int main()
{
    scanf("%d",&n);
    scanf("%lf%lf%lf",&A,&B,&C);
    for (int i=1;i<=n;i++) {
        scanf("%lf%lf",&a[i].x,&a[i].y);
    }
    for (int i=1;i<=n;i++)
        for (int j=1;j<=n;j++)
            if (i!=j) 
                for (int k=1;k<=n;k++)
                    if (i!=k && j!=k)
                        for (int p=1;p<=n;p++)
                            if (i!=p && j!=p && k!=p) {
                                if (doit1(i,j,k,p)) {
                                    f[i][j][k][p]=1;
                                    continue;
                                }
                                point c1,c2,c3,c4;
                                if (!CircleCrossCircle(a[i],B,a[j],B,c1,c2)) continue;
                                if (!CircleCrossCircle(a[k],C,a[p],C,c3,c4)) continue;
                                doit2(i,j,c1,c2);
                                doit2(k,p,c3,c4);
                                double ans=oo;
                                ans=min(ans,dist(c1,c3));
                                ans=min(ans,dist(c1,c4));
                                ans=min(ans,dist(c2,c3));
                                ans=min(ans,dist(c2,c4));
                                ans=min(ans,doit4(c1,k,C)-C);
                                ans=min(ans,doit4(c1,p,C)-C);
                                ans=min(ans,doit4(c2,k,C)-C);
                                ans=min(ans,doit4(c2,p,C)-C);
                                ans=min(ans,doit4(c3,i,B)-B);
                                ans=min(ans,doit4(c3,j,B)-B);
                                ans=min(ans,doit4(c4,i,B)-B);
                                ans=min(ans,doit4(c4,j,B)-B);
                                double tmp=0;
                                ans=min(ans,tmp=doit3(i,k)-B-C);
                                ans=min(ans,tmp=doit3(i,p)-B-C);
                                ans=min(ans,tmp=doit3(j,k)-B-C);
                                ans=min(ans,tmp=doit3(j,p)-B-C);
                                if (ans-A<eps) f[i][j][k][p]=1;
                            }
    memset(D,0xff,sizeof(D));
    D[1][2][3][4]=0;
    data tt,t1;
    tt.x=1;
    tt.y=2;
    tt.u=3;
    tt.v=4;
    DL[1]=tt;
    h=0;t=1;
    do{
        h++;
        int d1;
        tt=DL[h];
        d1=D[tt.x][tt.y][tt.u][tt.v];
        t1=tt;
        for(int i=1;i<=n;i++){
            tt=t1;
            tt.x=i;
            if(tt.x>tt.y)swap(tt.x,tt.y);
            Add(tt,d1+1,t1);
        }
        for(int i=1;i<=n;i++){
            tt=t1;
            tt.y=i;
            if(tt.x>tt.y)swap(tt.x,tt.y);
            Add(tt,d1+1,t1);
        }
        
        for(int i=1;i<=n;i++){
            tt=t1;
            tt.u=i;
            if(tt.u>tt.v)swap(tt.u,tt.v);
            Add(tt,d1+1,t1);
        }
        for(int i=1;i<=n;i++){
            tt=t1;
            tt.v=i;
            if(tt.u>tt.v)swap(tt.u,tt.v);
            Add(tt,d1+1,t1);
        }
    }while(h<t);
    int ans=1000000000;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            for(int k=1;k<=n;k++)
                for(int l=1;l<=n;l++) {
                    if(D[i][j][k][l]!=-1&&(l==n||i==n||j==n||k==n))ans=min(ans,D[i][j][k][l]);
                }
    if(ans>100000000)ans=-1;
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 12012