Problem: Find the tangent lines between a point $p$ and a circle $c$.

Constraints

* $-1,000 \leq px, py, cx, cy \leq 1,000$
* $1 \leq r \leq 1,000$
* Distance between $p$ and the center of $c$ is greater than the radius of $c$.

Input

The input is given in the following format.

$px \; py$
$cx \; cy \; r$

$px$ and $py$ represents the coordinate of the point $p$. $cx$, $cy$ and $r$ represents the center coordinate and radius of the circle $c$ respectively. All input values are given in integers.

Output

Print coordinates of the tangent points on the circle $c$ based on the following rules.

* Print the coordinate with smaller $x$ first. In case of a tie, print the coordinate with smaller $y$ first.



The output values should be in a decimal fraction with an error less than 0.00001.

Examples

Input

0 0
2 2 2


Output

0.0000000000 2.0000000000
2.0000000000 0.0000000000


Input

-3 0
2 2 2


Output

0.6206896552 3.4482758621
2.0000000000 0.0000000000

Solution (in CPP):

Solution:
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <math.h>
#include <stdbool.h>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;

class Point {
    public:
    double x, y;

    Point(double x = 0, double y = 0): x(x), y(y) {}

    Point operator + (Point p) { return Point(x+p.x, y+p.y); }
    Point operator - (Point p) { return Point(x-p.x, y-p.y); }
    Point operator * (double a) { return Point(a*x, a*y); }
    Point operator / (double a) { return Point(x/a, y/a); }

    double abs() {return sqrt(norm()); }
    double norm() {return x*x + y*y; }
};

typedef Point Vector;

class Circle {
    public:
    double r;
    Point c;

    Circle(double r = 0, Point c = Point()): r(r) {}
};

void print(Point p0, Point p1);

int main(){
    #if 0
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
    #endif

    Circle k1, k2;
    Point p;
    Point cross0, cross1;
    cin >> p.x >> p.y;
    cin >> k2.c.x >> k2.c.y >> k2.r;

    double dist = ( p - k2.c ).abs();
    double r1 = sqrt( dist*dist - k2.r*k2.r );
    k1.c = p;
    k1.r = r1;

    if ( k1.r < k2.r ) {
        swap(k1.r, k2.r);
        swap(k1.c.x, k2.c.x);
        swap(k1.c.y, k2.c.y);
    }

    double d = ( k1.c - k2.c ).abs();
    
    if ( ( d == k1.r + k2.r ) || ( d == k1.r - k2.r ) ) {
        Vector v1 = k2.c - k1.c;
        v1 = v1 * k1.r / v1.abs();
        cross0 = k1.c + v1;
        print(cross0, cross0);
    }
    else {
        Vector v0 = k2.c - k1.c;
        v0 = v0 * ( k1.r*k1.r - k2.r*k2.r + d*d ) / (2*d) / v0.abs();
        Point x1 = k1.c + v0;
        Vector v1;
        v1.x = v0.y;
        v1.y = - v0.x;
        v1 = v1 * sqrt( k1.r*k1.r - v0.abs()*v0.abs() ) / v1.abs();
        cross0 = x1 + v1;
        cross1 = x1 - v1;
        print(cross0, cross1);
    }

    return 0;
}

void print(Point p0, Point p1) {
    double x0, y0, x1, y1;
    if ( p0.x < p1.x ) {
        x0 = p0.x;
        y0 = p0.y;
        x1 = p1.x;
        y1 = p1.y;
    }
    else if ( p0.x > p1.x ) {
        x0 = p1.x;
        y0 = p1.y;
        x1 = p0.x;
        y1 = p0.y;
    }
    else {
        if ( p0.y < p1.y ){
            x0 = p0.x;
            y0 = p0.y;
            x1 = p1.x;
            y1 = p1.y;
        }
        else{
            x0 = p1.x;
            y0 = p1.y;
            x1 = p0.x;
            y1 = p0.y;
        }
    }
    cout << fixed << setprecision(11) << x0 << " " << y0 << endl << x1 << " " << y1 << endl;
}