#define TASKNAME "mjolnir"
#include <cstdio>
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <cctype>
#include <cstdlib>
#include <cassert>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>
 
#define EPS (1e-6)
#define INF (int(1e9))
#define INFLONG ((long long)(1e18))
#define sqr(a) ((a) * (a))
#define all(a) (a).begin(), (a).end()
#define zero(a) memset(a, 0, sizeof(a))
#define abs(a) (((a) < 0) ? -(a) : (a))
#define sz(a) (int)a.size()
#define fst first
#define snd second
#define y1 osrughosduvgarligybakrybrogvba
#define y0 aosfigdalrowgyalsouvgrlvygalri                               
#define mp make_pair
#define pb push_back
#define next dlkjdslfkdj
#define prev dsdflksdfjl
#define hash lkdfjldskfj
#define pi 3.1415926535897932384626433832795
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <bool> vb;
typedef vector <ll> vll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <int, ll> pil;
typedef vector <pii> vpii;

struct pt
{
  ld x, y;
  pt() {x = y = 0;}
  pt(ld x, ld y) : x(x), y(y) {}

  inline ld len2()
  {
    return x * x + y * y;
  }

  inline ld len()
  {
    return sqrt(len2());
  }
};

inline bool operator < (const pt &a, const pt &b) {return a.x < b.x - EPS || (fabs(a.x - b.x) <= EPS && a.y < b.y - EPS);}
inline pt operator - (const pt &a, const pt &b) {return pt(a.x - b.x, a.y - b.y);}
inline pt operator + (const pt &a, const pt &b) {return pt(a.x + b.x, a.y + b.y);}
inline pt operator * (const pt &a, ld b) {return pt(a.x * b, a.y * b);}
inline pt operator / (const pt &a, ld b) {return pt(a.x / b, a.y / b);}

inline pt turn(pt p, ld sina, ld cosa)
{
  return pt(p.x * cosa - p.y * sina, p.y * cosa + p.x * sina);
}

inline void print_ans(ld sinb, ld cosb, pt a, pt b, ld A, ld B)
{
  pt np = (b - a) / (b - a).len();
  pt lp = turn(np, sinb, cosb) * A + a;
  pt rp = turn(np, -cosb, sinb) * B + a;
  if (rp < lp)
    swap(lp.x, rp.x), swap(lp.y, rp.y);
  printf("%.7lf %.7lf\n%.7lf %.7lf\n", (double)lp.x, (double)lp.y, (double)rp.x, (double)rp.y);
}

int main()
{  
  freopen(TASKNAME".in", "r", stdin);
  freopen(TASKNAME".out", "w", stdout);
  ld s;
  while (cin >> s)
  {
    vector <pt> p(2);
    for (int i = 0; i < 2; i++)
      cin >> p[i].x >> p[i].y;
    ld d_2 = (p[0] - p[1]).len2();
    ld D = d_2 * d_2 - 4 * s * s;
    if (D < 0)
    {
      printf("0 0\n0 0\n");
      continue;
    }
    ld b = 0.5 * (d_2 + sqrt(D));
    ld a = s * s / b;
    if (a < 0 || b < 0)
    {
      printf("0 0\n0 0\n");
      continue;
    }
    assert(fabs(a * b - s * s) <= EPS);
    assert(fabs(a + b - d_2) <= EPS);
    assert(fabs(b * b - d_2 * b + s * s) <= EPS);
    a = sqrt(a), b = sqrt(b);

    ld d = sqrt(d_2 + 0.0);
    assert(fabs(d_2 - a * a - b * b) <= EPS);
    ld sinb = b / d, cosb = a / d;
    print_ans(sinb, cosb, p[0], p[1], a, b);
  }                    
  return 0;                                  
}


	
