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 <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#define ESP (1e-13)
using namespace std;

//??§?¨????????§???????
typedef struct Point {
	double x; 
	double y;

	Point() { }

	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& a) {
		return Point(x*a, y*a);
	}

	Point operator/(const double& a) {
		return Point(x / a, y / a);
	}

	Point operator=(const Point& p1) {
		return Point(p1.x,p1.y);
	}

};

//??´??§?????????????§???????
typedef Point Vector;

//??´???????§???????
 struct Line {
	Point p1, p2;
	Line() {}
	Line(const Point& a,const Point& b) : p1(a),p2(b) { }
};

 //??????????§???????
 typedef Line Segment;

 //???????§???????
 struct Circle {
	 Point c;
	 double r;
	 Circle(){ }
	 Circle(const Point& p,const double& r) : c(p),r(r) { }
 };

//2??????????????¢????±?????????¢??°
double abs(Point p1, Point p2) {
	double norm = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
	return sqrt(norm);
}

//????????¢??°
double product(Vector v1, Vector v2) {
	return v1.x*v2.x + v1.y*v2.y;
}

//????????¢??°
double cross(Vector p1, Vector p2) {
	return p1.x*p2.y - p1.y*p2.x;
}

//3??????????????¢???????±?????????¢??°
int ccw(Point p0, Point p1, Point p2) {
	Vector v0 = p1 - p0;
	Vector v1 = p2 - p0;
	if (cross(v0, v1) > ESP) return 1;   //p0,p1,p2??????????¨???????
	if (cross(v0, v1) < -ESP) return -1;   //p0,p1,p2???????¨???????
	if (product(v0, v1) < -ESP) return 2;  //p2,p0,p1????????§????????´??????
	if (abs(p0, p1) < abs(p0, p2)) return -2;  //p0,p1,p2????????§????????´??????
	return 0;   //p2?????????(p0,p1)???
}

//??????????????´????????????????°???±?????§?¨?????±?????????¢??°
Point project(Segment s, Point p) {
	Vector base = s.p2 - s.p1;
	double x = abs(base, Point(0.0, 0.0))*abs(base, Point(0.0, 0.0));
	double r = product(p - s.p1, base) / x;
	return s.p1 + base*r;
}

//????????????????±??????¨??????????????????????§°????????§?¨?????±?????????¢??°
Point reflect(Segment s, Point p) {
	return (project(s, p) - p)*2.0 + p;
}


bool intersect(Point p0, Point p1, Point p2, Point p3) {
	return (ccw(p0, p1, p2)*ccw(p0, p1, p3) <= 0&&ccw(p2,p3,p0)*ccw(p2,p3,p1)<=0);
	//?????????????????????????????¶
}

//????????????????????£??????????????????????????¢??°
bool intersect(Segment s1, Segment s2) {
	return intersect(s1.p1, s1.p2, s2.p1, s2.p2);
}

//??´?????¨???????????¢????±?????????¢??°
double DistanceLP(Line l, Point p) {
	return abs(cross(l.p2 - l.p1, p - l.p1)/abs(l.p1,l.p2));
}

//????????¨???????????¢????±?????????¢??°
double DistanceSP(Segment s, Point p) {
	if (product(s.p2 - s.p1, p - s.p1) < -ESP) return abs(p, s.p1);
	if (product(s.p1 - s.p2, p - s.p2) < -ESP) return abs(p, s.p2);
	return DistanceLP(s, p);
}

//2??????????????¢????±?????????¢??°
double DistanceSS(Segment s1, Segment s2) {
	if (intersect(s1, s2)) return 0.0;
	return min(min(DistanceSP(s1, s2.p1), DistanceSP(s1,s2.p2)), min(DistanceSP(s2, s1.p1), DistanceSP(s2, s1.p2)));
}

//?????´???????\???¢????±?????????¢??°
Point CrossPoint(Line s1,Line s2) {
	double d1=DistanceLP(s2, s1.p1);
	double d2 = DistanceLP(s2, s1.p2);
	double t = d1 / (d1 + d2);
	return s1.p1 + (s1.p2 - s1.p1)*t;
}

//?????¨??´?????????????????????????????¢??°
bool intersect(Circle c, Line l) {
	return DistanceLP(l, c.c) < c.r;
}

//?????¨??´????????????????±?????????¢??°
pair<Point, Point> CrossPoints(Circle c, Line l) {
	Vector prpr = project(l, c.c);
	Vector hshs = (l.p2 - l.p1)/abs(l.p2 ,l.p1);
	double base = sqrt(c.r*c.r - abs(c.c, prpr)*abs(c.c, prpr));
	return make_pair(prpr - hshs*base, prpr + hshs*base);
}

//????§???¨?\?
double arg(Vector p) { return atan2(p.y, p.x); }
Vector polar(double a, double r) { return Point(cos(r)*a, sin(r)*a); }

//?????¨????????????????±?????????¢??°
pair<Point, Point> CrossPoints(Circle c1, Circle c2) {
	double d = abs(c1.c ,c2.c);
	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));
}

//2??´??????????????¢???????±?????????¢??°???
   //??´?????????
bool isOrth(Vector a, Vector b) {
	return abs(product(a, b)) < ESP;
   }
bool isOrth(Point a1, Point a2, Point b1, Point b2) {
	return isOrth(a1 - a2, b1 - b2);
}
bool isOrth(Segment s1, Segment s2) {
	return isOrth(s1.p2, s1.p1, s2.p2, s2.p1);
}
    //????????????
bool isPara(Vector a, Vector b) {
	return abs(cross(a, b)) < ESP;
}
bool isPara(Point a1, Point a2, Point b1, Point b2) {
	return isPara(a1 - a2, b1 - b2);
}
bool isPara(Segment s1, Segment s2) {
	return isPara(s1.p2, s1.p1, s2.p2, s2.p1);
}


int main() {
	Circle c1, c2;
	cin >> c1.c.x; cin >> c1.c.y; cin >> c1.r;
	cin >> c2.c.x; cin >> c2.c.y; cin >> c2.r;
	pair<Point, Point> crs = CrossPoints(c1, c2);
	if (abs(crs.first.x) < ESP) crs.first.x = 0;
	if (abs(crs.first.y) < ESP) crs.first.y = 0;
	if (abs(crs.second.x) < ESP) crs.second.x = 0;
	if (abs(crs.second.y) < ESP) crs.second.y = 0;
	cout << setprecision(12);
	if (crs.first.x<crs.second.x)
		cout << crs.first.x << " " << crs.first.y << " " << crs.second.x << " " << crs.second.y << endl;
	else if (crs.first.x>crs.second.x)
		cout << crs.second.x << " " << crs.second.y << " " << crs.first.x << " " << crs.first.y << endl;
	else if (crs.first.y<crs.second.y)
		cout << crs.first.x << " " << crs.first.y << " " << crs.second.x << " " << crs.second.y << endl;
	else
		cout << crs.second.x << " " << crs.second.y << " " << crs.first.x << " " << crs.first.y << endl;
}