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<bits/stdc++.h>
using namespace std;
const double eps = 1e-10, pi = acos((double)-1);
#define equals(a, b) (fabs((a) - (b)) < eps)
struct Point
{
    double x, y;
    Point(const double &a = 0, const double &b = 0) : x(a), y(b) {}
    void input()
    {
        scanf("%lf%lf", &x, &y);
    }
    Point operator+(const Point &t)
    {
        return Point(x + t.x, y + t.y);
    }
    Point operator-(const Point &t)
    {
        return Point(x - t.x, y - t.y);
    }
    Point operator*(const double &k)
    {
        return Point(k * x, k * y);
    }
    Point operator/(const double &k)
    {
        return Point(x / k, y / k);
    }
    Point turn(double T) // 逆时针旋转T弧度
    {
        return Point(x * cos(T) - y * sin(T),
        x * sin(T) + y * cos(T));
    }
    Point Normal() // 求单位法向量
    {
        return Point(-(y / length()), x / length());
    }
    double operator*(const Point &t) // 内积
    {
        return (x * t.x + y * t.y);
    }
    double operator^(const Point &t) // 叉积
    {
        return (x * t.y - y * t.x);
    }
    bool operator==(const Point &t) // 判断是否相等
    {
        return equals((x - t.x), 0.0) && equals((y - t.y), 0.0);
    }
    double norm()
    {
        return x * x + y * y;
    }
    double length() // 向量长度
    {
        return sqrt(norm());
    }
};
typedef Point Vector;
struct Segment
{
    Point p1, p2;
    Vector base()
    {
        return Vector(p2 - p1);
    }
};
typedef Segment Line;
struct Circle
{
    Point c; double r;
    Circle(Point c = Point(), double r = 0.0) : c(c), r(r) {}
    void input()
    {
        c.input(); scanf("%lf", &r);
    }
};
typedef vector<Point> Polygon;
double Dist(Point a, Point b) // 两点距离
{
    return (a - b).length();
}
double Arg(Vector p) { return atan2(p.y, p.x); } // 返回向量p与x轴正向的夹角
Vector Polar(double p, double a) { return Point(cos(a) * p, sin(a) * p); } // 极坐标转化
double Angle(Vector a, Vector b) // 求两向量夹角
{
    return acos(a * b / (a.length() * b.length()));
}
bool isOrthogonal(Vector a, Vector b) // 两向量是否正交
{
    return equals((a * b), 0.0);
}
bool isParallel(Vector a, Vector b) // 两向量是否平行
{
    return equals((a ^ b), 0.0);
}
bool istouch(Point a, Vector v, Point c, double r) // 直线a->v是否与圆c相交（不相切）
{
    Point b = a + v;
    return (fabs((a - c) ^ (b - c)) / Dist(a, b) < r);
}
bool isOnShot(Point a, Vector v, Point b) // b是否在射线a->v上
{
    return isParallel((b - a), v) && ((b - a) * v >= eps);
}
bool isOnSeg(Point a, Point b, Point c) // c是否在线段ab上
{
    return isParallel((c - a), (c - b)) && ((c - a) * (c - b) < eps);
}
Point getCrossPoint(Segment s1, Segment s2) // 求两线段的交点
{
    double d1 = fabs((s2.base() ^ (s1.p1 - s2.p1)));
    double d2 = fabs((s2.base() ^ (s1.p2 - s2.p1)));
    double t = d1 / (d1 + d2);
    return s1.p1 + s1.base() * t;
}
Point Projection(Line s, Point p) // 点p在直线s上的投影
{
    double r = ((p - s.p1) * s.base()) / s.base().norm();
    return s.p1 + s.base() * r;
}
Point Reflection(Line s, Point p) // 点p关于直线s的对称点
{
    return p + (Projection(s, p) - p) * 2.0;
}
double DistLP(Line s, Point p) // 点p到直线s的距离
{
    return fabs(s.base() ^ (p - s.p1)) / s.base().length();
}
double DistSP(Segment s, Point p) // 点p到线段s的距离
{
    if((s.base() * (p - s.p1)) < 0.0) return (p - s.p1).length();
    if(((s.p1 - s.p2) * (p - s.p2)) < 0.0)  return (p - s.p2).length();
    return DistLP(s, p);
}
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;
int ccw(Point p0, Point p1, Point p2) // 点p2在线段p0p1的逆时针/顺时针方向或者在线段p0p1前/后/上
{
    Vector v1 = p1 - p0, v2 = p2 - p0;
    if((v1 ^ v2) > eps) return COUNTER_CLOCKWISE;
    if((v1 ^ v2) < -eps) return CLOCKWISE;
    if((v1 * v2) < -eps) return ONLINE_BACK;
    if(v1.norm() < v2.norm()) return ONLINE_FRONT;
    return ON_SEGMENT;
}
bool Intersect(Point p1, Point p2, Point p3, Point p4) // 线段p1p2和线段p3p4是否相交
{
    return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
    ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}
bool Intersect(Segment s1, Segment s2) // 线段s1和线段s2是否相交
{
    return Intersect(s1.p1, s1.p2, s2.p1, s2.p2);
}
bool Intersect(Circle c, Line l) // 圆c与直线l是否相交
{
    return (DistLP(l, c.c) < c.r) || equals(DistLP(l, c.c), c.r);
}
bool Intersect(Circle c1, Circle c2) // 圆c1与圆c2是否相交
{
    return ((c1.c - c2.c).length() < c1.r + c2.r || equals((c1.c - c2.c).length(), c1.r + c2.r));
}
double DistSS(Segment s1, Segment s2) // 线段s1与线段s2的距离
{
    if(Intersect(s1, s2)) return 0.0;
    return min(min(DistSP(s1, s2.p1), DistSP(s1, s2.p2)),
    min(DistSP(s2, s1.p1), DistSP(s2, s1.p2)));
}
pair<Point, Point> getCrossPoints(Circle c, Line l) // 圆c与直线l的两交点（若只有一个则两点相同）
{
    Point pr = Projection(l, c.c);
    Vector e = l.base() / l.base().length();
    double base = sqrt(c.r * c.r - (pr - c.c).norm());
    return make_pair(pr + e * base, pr - e * base);
}
pair<Point, Point> getCrossPoints(Circle c1, Circle c2) // 圆c1与圆c2的两交点（若只有一个则两点相同）
{
    double d = (c1.c - c2.c).length();
    double a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    double t = Arg(c2.c - c1.c);
    return make_pair(c1.c + Polar(c1.r, t + a), c1.c + Polar(c1.r, t - a));
}
inline int read()
{
    int w = 1, s = 0; char ch = getchar();
    while(!isdigit(ch)) { if(ch == '-') w = -1; ch = getchar(); }
    while(isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
    return w * s;
}
int main()
{
    Circle c1, c2;
    c1.input(), c2.input();
    pair<Point, Point> tp;
    if(Intersect(c1, c2)) tp = getCrossPoints(c1, c2);
    if(tp.first.x < tp.second.x || (equals(tp.first.x, tp.second.x) && tp.first.y < tp.second.y))
        printf("%.10lf %.10lf %.10lf %.10lf\n", tp.first.x, tp.first.y, tp.second.x, tp.second.y);
    else
        printf("%.10lf %.10lf %.10lf %.10lf\n", tp.second.x, tp.second.y, tp.first.x, tp.first.y);
//    system("pause");
}