Problem: For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.

Constraints

* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1r, c2r \leq 10,000$

Input

The input is given in the following format.

$c1x\; c1y\; c1r$
$c2x\; c2y\; c2r$


$c1x$, $c1y$ and $c1r$ represent the coordinate and radius of the first circle. $c2x$, $c2y$ and $c2r$ represent the coordinate and radius of the second circle. All input values are given in integers.

Output

Print the coordinates ($x1$, $y1$) and ($x2$, $y2$) of the cross points $p1$ and $p2$ respectively in the following rules.

* If there is one cross point, print two coordinates with the same values.
* 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.000001.

Examples

Input

0 0 2
2 0 2


Output

1.00000000 -1.73205080 1.00000000 1.73205080


Input

0 0 2
0 3 1


Output

0.00000000 2.00000000 0.00000000 2.00000000

Solution (in CPP):

Solution:
#include <array>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>

const double kEpsilon = 1e-10;
inline bool equals(double a, double b)
{
    return fabs(a - b) < kEpsilon;
}

class Point
{
  public:
    double x, y;

    Point() = default;
    Point(double x, double y) : x(x), y(y)
    {
    }

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

    double SquaredNorm()
    {
        return x * x + y * y;
    }
    double abs()
    {
        return sqrt(this->SquaredNorm());
    }

    bool operator<(const Point &p) const
    {
        return x != p.x ? x < p.x : y < p.y;
    }
    bool operator==(const Point &p) const
    {
        return fabs(x - p.x) < kEpsilon && fabs(y - p.y) < kEpsilon;
    }

    double dot(const Point &p) const
    {
        return x * p.x + y * p.y;
    }
    double cross(const Point &p) const
    {
        return x * p.y - y * p.x;
    }
};

double dot(const Point &p1, const Point &p2)
{
    return p1.x * p2.x + p1.y * p2.y;
}
double cross(const Point &p1, const Point &p2)
{
    return p1.x * p2.y - p1.y * p2.x;
}

using Vector = Point;

struct Segment
{
    Point p1, p2;

    Segment() = default;
    Segment(Point p1, Point p2) : p1(p1), p2(p2)
    {
    }
};
using Line = Segment;

class Circle
{
  public:
    Point c;
    double r;
    Circle(Point c = Point(), double r = 0.0) : c(c), r(r)
    {
    }
};

Point projection(Point &p1, Point &p2, Point &p)
{
    auto q = p2 - p1;
    auto a = q.dot(p - p1) / q.SquaredNorm();
    return p1 + q * a;
}

Point projection(Line &l, Point &p)
{
    auto p1 = l.p1;
    auto p2 = l.p2;
    return projection(p1, p2, p);
}

std::array<Point, 2> crossPointsCircleLine(Circle &c, Line &l)
{

    Vector q = l.p2 - l.p1;
    if (l.p2 < l.p1)
        q = q * (-1.);

    Vector e = q / q.abs();
    Point pr = projection(l, c.c);
    double h = (c.c - pr).abs();
    double length = sqrt(c.r * c.r - h * h);

    std::array<Point, 2> cross = {pr - e * length, pr + e * length};

    return cross;
}

Point rotate(Point &p, double cos, double sin)
{
    Point q;
    q.x = cos * p.x - sin * p.y;
    q.y = sin * p.x + cos * p.y;
    return q;
}

std::array<Point, 2> crossPointsCircles(Circle &c1, Circle &c2)
{
    Vector q = c2.c - c1.c;
    double a = c1.r;
    double b = q.abs();
    double c = c2.r;
    double cos = (a * a + b * b - c * c) / (2 * a * b);
    auto sin = sqrt(1 - cos * cos);

    Vector v = q / b * c1.r;

    std::array<Point, 2> cross;
    cross[0] = c1.c + rotate(v, cos, sin);
    cross[1] = c1.c + rotate(v, cos, -sin);

    if (cross[1] < cross[0])
    {
        auto tmp = cross[0];
        cross[0] = cross[1];
        cross[1] = tmp;
    }

    return cross;
}

int main()
{
    Circle c1, c2;

    std::cin >> c1.c.x >> c1.c.y >> c1.r;
    std::cin >> c2.c.x >> c2.c.y >> c2.r;

    auto cross = crossPointsCircles(c1, c2);
    printf("%.9f %.9f %.9f %.9f\n", cross[0].x, cross[0].y, cross[1].x, cross[1].y);
}