#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define NN    100000
#define MANY  1e15
#define eps   1e-7

double mind(double x, double y) { return (x<y)?x:y; }

typedef struct {
    double left,right,h;
} bridge;

const char *infile  = "bridge.in";
const char *outfile = "bridge.out";
FILE *fi, *fo;

int N;
double Ax,Ay,Bx,By;
int A,B;
double L;
double x[NN+2],y[NN+2];
double d_a[NN+2],d_b[NN+2];
int l_h[NN+2], l_l[NN+2], r_h[NN+2], r_l[NN+2];

int stk[NN+2], stkl = 0;
int chain[NN+2], m;

void init(void) {
    int i;
    /* precalculate distances */
    d_a[A] = 0.0; d_b[B] = 0.0;
    for(i = A-1; i >= 0; i--) {
        d_a[i] = d_a[i+1] + sqrt((x[i]-x[i+1])*(x[i]-x[i+1]) + (y[i]-y[i+1])*(y[i]-y[i+1]));
    }
    for(i = A+1; i < N; i++) {
        d_a[i] = d_a[i-1] + sqrt((x[i]-x[i-1])*(x[i]-x[i-1]) + (y[i]-y[i-1])*(y[i]-y[i-1]));
    }
    for(i = B-1; i >= 0; i--) {
        d_b[i] = d_b[i+1] + sqrt((x[i]-x[i+1])*(x[i]-x[i+1]) + (y[i]-y[i+1])*(y[i]-y[i+1]));
    }
    for(i = B+1; i < N; i++) {
        d_b[i] = d_b[i-1] + sqrt((x[i]-x[i-1])*(x[i]-x[i-1]) + (y[i]-y[i-1])*(y[i]-y[i-1]));
    }

    /* precalculate left lower, left higher, right lower, right higher */
    for(i = 0; i < N; i++) {
        l_l[i] = -1;
        l_h[i] = -1;
        while(1) {
            if(stkl == 0) {
                stk[stkl++] = i;
                break;
            } else {
                if(y[stk[stkl-1]] < y[i] - eps) {
                    l_l[i] = stk[--stkl];
                } else {
                    l_h[i] = stk[stkl - 1];
                    stk[stkl++] = i;
                    break;
                }
            }
        }
    }
    stkl = 0;
    for(i = N - 1; i >= 0; i--) {
        r_l[i] = -1;
        r_h[i] = -1;
        while(1) {
            if(stkl == 0) {
                stk[stkl++] = i;
                break;
            } else {
                if(y[stk[stkl-1]] < y[i] - eps) {
                    r_l[i] = stk[--stkl];
                } else {
                    r_h[i] = stk[stkl - 1];
                    stk[stkl++] = i;
                    break;
                }
            }
        }
    }
}

double path_length(int p, int q, int r , int s, bridge *t) {
    return mind(d_a[p] + sqrt((t->left - x[p])*(t->left - x[p]) + (t->h - y[p])*(t->h - y[p])),
           d_a[q] + sqrt((t->left - x[q])*(t->left - x[q]) + (t->h - y[q])*(t->h - y[q]))) +
           (t->right - t->left) +
           mind(d_b[r] + sqrt((t->right - x[r])*(t->right - x[r]) + (t->h - y[r])*(t->h - y[r])),
           d_b[s] + sqrt((t->right - x[s])*(t->right - x[s]) + (t->h - y[s])*(t->h - y[s])));
}

double left_bridge(int v, bridge *res) {
    int i,j;
    double tg1, tg2, k, H, floor,X;
    res->h = -MANY;
    i = l_h[v]; j = v;
    if(i < 0) {
        return MANY;
    }
    if(l_l[v] < 0) {
        return MANY;
    }
    tg1 = (y[i] - y[i+1]) / (x[i+1] - x[i]);
    tg2 = (y[j] - y[j-1]) / (x[j] - x[j-1]);
    if((fabs(tg2) < eps) || (fabs(tg1) < eps)) return MANY;

    res->h = y[j];
    res->right = x[j];
    res->left = x[i+1] - (res->h - y[i+1]) / tg1;

    k = L / (res->right - res->left);
    if(k > 1 - eps) return path_length(i,i+1,j,j-1,res);
    H = (res->right - res->left)*tg1*tg2 / (tg1 + tg2);
    floor = res->h - H;
    X = res->left + H / tg1;
    res->h = floor + H*k;
    if(res->h < y[l_l[v]] - eps) return MANY;
    res->left  = X - H*k/tg1;
    res->right = X + H*k/tg2;
    return path_length(i,i+1,j,j-1,res);
}

double right_bridge(int v, bridge *res) {
    int i,j;
    double tg1, tg2, k, H, floor,X;
    res->h = -MANY;
    i = v; j = r_h[v];
    if(j < 0) {
        return MANY;
    }
    if(r_l[v] < 0) {
        return MANY;
    }
    tg1 = (y[i] - y[i+1]) / (x[i+1] - x[i]);
    tg2 = (y[j] - y[j-1]) / (x[j] - x[j-1]);
    if((fabs(tg2) < eps) || (fabs(tg1) < eps)) return MANY;
    
    res->h = y[i];
    res->left  = x[i];
    res->right = x[j-1] + (res->h - y[j-1]) / tg2;
    
    k = L / (res->right - res->left);
    if(k > 1 - eps) return path_length(i,i+1,j,j-1,res);
    H = (res->right - res->left)*tg1*tg2 / (tg1 + tg2);
    floor = res->h - H;
    X = res->left + H / tg1;
    res->h = floor + H*k;
    if(res->h < y[r_l[v]] - eps) return MANY;
    res->left  = X - H*k/tg1;
    res->right = X + H*k/tg2;
    return path_length(i,i+1,j,j-1,res);
}

double process_chain(bridge *res) {
	double lb,lc;
	int i,j;
	int st,nd;
	double H;
	int prev,next;
	bridge best, cur, tmp;
	lb = MANY;
	st = 0; nd = m-1;
	H = y[chain[0]];
	while(st <= nd) {
		if(left_bridge(chain[st],&cur) < d_a[B] - eps)
			if(cur.h > H - eps)
				break;
		st++;
	}
	while(st <= nd) {
		if(right_bridge(chain[nd],&cur) < d_a[B] - eps)
			if(cur.h > H - eps)
				break;
		nd--;
	}
	if(st > nd) return MANY;
	i = st; j = i+1;
	lc = left_bridge(chain[i],&cur);
	lb = lc; best = cur;
	prev = l_h[chain[i]]; next = chain[j];
	while(j <= nd) {
		next = chain[j];
		cur.right = x[chain[j]];
		while(cur.right - cur.left > L +eps) {
			prev = chain[i];
			cur.left = x[chain[i]];
			i++;
		}
		lc = path_length(prev,prev+1,next,next-1,&cur);
		if(lc < lb) {
			lb = lc;
			best = cur;
		}
		j++;
	}
	right_bridge(chain[nd],&tmp);
	if(tmp.h > H - eps) {
		next = r_h[chain[nd]];
		cur.right = tmp.right;
		while(cur.right - cur.left > L +eps) {
			prev = chain[i];
			cur.left = x[chain[i]];
			i++;
		}
		lc = path_length(prev,prev+1,next,next-1,&cur);
		if(lc < lb) {
			lb = lc;
			best = cur;
		}
	}
	*res = best;
	return lb;
}

void reverse_arr(int *a, int n) {
	int i,t;
	for(i = 0; i < n/2; i++) {
		t = a[i];
		a[i] = a[n-i-1];
		a[n-i-1] = t;
	}
}

double chainprocessing(bridge *res) {
	double lb,lc;
	int i;
	bridge best,cur;
	lb = MANY;
	stkl = 0;
	for(i = 0; i < N; i++) {
        while(1) {
            if(stkl == 0) {
                stk[stkl++] = i;
                break;
            } else {
                if(y[stk[stkl-1]] < y[i] - eps) {
					m = 0; stkl--;
					while((stkl > 0) && (fabs(y[stk[stkl-1]] - y[stk[stkl]]) < eps)) {
						chain[m++] = stk[stkl--];
					}
					chain[m++] = stk[stkl];
					reverse_arr(chain,m);
					//if(m < 2) continue;
					lc = process_chain(&cur);
					if(lc < lb) {
						lb = lc;
						best = cur;
					}
                } else {
                    stk[stkl++] = i;
                    break;
                }
            }
        }
	}
	while(stkl > 0) {
		m = 0; stkl--;
		while((stkl > 0) && (fabs(y[stk[stkl-1]] - y[stk[stkl]]) < eps)) {
			chain[m++] = stk[stkl--];
		}
		chain[m++] = stk[stkl];
		reverse_arr(chain,m);
		//if(m < 2) continue;
		lc = process_chain(&cur);
		if(lc < lb) {
			lb = lc;
			best = cur;
		}
	}
	*res = best;
	return lb;
}

double best_bridge(bridge *res) {
    bridge cur_l,cur_r,best;
    double lc,lb;
    int i;
    lb = MANY;
    for(i = 0; i < N; i++) {
        lc = left_bridge(i,&cur_l);
        if(lc < lb) {
            lb = lc;
            best = cur_l;
        }
        lc = right_bridge(i,&cur_r);
        if(lc < lb) {
            lb = lc;
            best = cur_r;
        }
        if((fabs(cur_l.h - y[i]) < eps) && (fabs(cur_r.h - y[i]) < eps)) {
            if(cur_r.right - cur_l.left < L +   eps) {
                cur_r.left = cur_l.left;
                lc = path_length(l_h[i],l_h[i]+1,r_h[i],r_h[i]-1,&cur_r);
                if(lc < lb) {
                    lb = lc;
                    best = cur_r;
                }
            }
        }
    }
    lc = chainprocessing(&cur_l);
    if(lc < lb) {
	    lb = lc;
	    best = cur_l;
    }
    if(lb > d_a[B] - eps) return -1;
    *res = best;
    return lb;
}

int main(void) {
    int i,j;
    double xx,yy;
    double ans;
    bridge res;
    fi = fopen(infile,"rt");
    fo = fopen(outfile,"wt");

    fscanf(fi,"%d%lf%lf%lf%lf%lf",&N,&L,&Ax,&Ay,&Bx,&By);
    if(Ax > Bx) {
        xx = Ax; yy = Ay;
        Ax = Bx; Ay = By;
        Bx = xx; By = yy;
    }
    j = 0;
    for(i = 0; i < N; i++) {
        fscanf(fi,"%lf%lf",&xx,&yy);
        if(xx > Ax - eps) {
            x[j] = Ax;
            y[j] = Ay;
            Ax = MANY;
            A = j;
            j++;
        }
        if(xx > Bx - eps) {
            x[j] = Bx;
            y[j] = By;
            Bx = MANY;
            B = j;
            j++;
        }
        x[j] = xx;
        y[j] = yy;
        j++;
        if(j > 1) {
            if(fabs(x[j-2] - x[j-1]) < eps)
                j--;
        }
    }
    N = j;

    init();
    ans = best_bridge(&res);
    if(ans < 0) {
        return 1; /* No solution is not permited */
    } else {
#ifdef GENANS
	fprintf(fo,"%0.9f\n",ans);
#endif
        fprintf(fo,"%0.5f %0.5f\n%0.5f %0.5f\n",res.left,res.h,res.right,res.h);
    }

    fclose(fi);
    fclose(fo);
    return 0;
}
