#include #include int main (void) { double diag, pryam; double r, X, Y, x, y, tx, ty; while (scanf ("%lf", &r), r!=-1 ) { scanf ("%lf%lf%lf%lf", &X, &Y, &x, &y); if (Y==y) { if (X>x) printf ("west %.10lf\n", fabs(x-X)); else printf ("east %.10lf\n", fabs(x-X)); printf ("\n"); continue; } if (X==x) { if (Y>y) printf ("south %.10lf\n", fabs(y-Y)); else printf ("north %.10lf\n", fabs(y-Y)); printf ("\n"); continue; } if (fabs (x-X)==fabs(y-Y)) { if ((xY)) printf ("northwest "); if ((x>X)&&(yX)&&(y>Y)) printf ("northeast "); printf ("%.10lf\n\n", sqrt((double)2)*fabs(x-X)); continue; } if (fabs(X-x)>fabs(Y-y)) { diag=sqrt(2.0)*fabs(Y-y); pryam=fabs(X-x)-fabs(Y-y); ty=Y; if (Xx) tx=X+pryam; if (sqrt(tx*tx+ty*ty)x) printf ("west %.10lf\n", fabs(x-X)); else printf ("east %.10lf\n", fabs(x-X)); if ((xY)) printf ("northwest "); if ((x>X)&&(yX)&&(y>Y)) printf ("northeast "); printf ("%.10lf\n\n", diag); } else { if ((xY)) printf ("northwest "); if ((x>X)&&(yX)&&(y>Y)) printf ("northeast "); printf ("%.10lf\n", diag); if (X>x) printf ("west %.10lf\n", fabs(x-X)); else printf ("east %.10lf\n", fabs(x-X)); printf ("\n"); } continue; } if (fabs(X-x)y) ty=Y-pryam; if (sqrt(tx*tx+ty*ty)y) printf ("south %.10lf\n", pryam); else printf ("north %.10lf\n", pryam); if ((xY)) printf ("northwest "); if ((x>X)&&(yX)&&(y>Y)) printf ("northeast "); printf ("%.10lf\n\n", diag); } else { if ((xY)) printf ("northwest "); if ((x>X)&&(yX)&&(y>Y)) printf ("northeast "); printf ("%.10lf\n", diag); if (Y>y) printf ("south %.10lf\n", pryam); else printf ("north %.10lf\n", pryam); printf ("\n"); } continue; } } return 0; }