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<iomanip>
#include<algorithm>
#include<fstream>
#include<cstdio>
#define _USE_MATH_DEFINES
#include<math.h>
#define EPS (1e-7)
#define equals(a, b) (fabs((a) - (b)) < EPS )
//#define cout fout
//#define cin fin
#define CCW 1
#define YCW -1
#define ONB 3
#define ONF 4
#define ONS 0
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;
	}

	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) < EPS && fabs(y - p.y) < EPS;
	}
};

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

typedef Point Vector;

#ifdef cin
ifstream fin("CGL_1_C-in29.txt");
#endif

#ifdef cout
ofstream fout("out.txt");
#endif

double dot(Vector a, Vector b);
double cross(Vector a, Vector b);
double getDistanceSP(Point p, Point p1, Point p2);
double angle(Vector a, Vector b);
bool doIntersect(Point p1, Point p2, Point p3, Point p4);
double getDistanceSS(Point p1, Point p2, Point p3, Point p4);
int clockwise(Point p0, Point p1, Point p2);
Point crossPoint(Point p1, Point p2, Point p3, Point p4);
pair<Point, Point> crossPoint(Point p1, Point p2, Point center, double r);
Vector rotateVector(Vector v, double angle); //rad
Point project(Point p, Point p1, Point p2);
pair<Point, Point> crossPointsCC(Circle c1, Circle c2);

int main() {
    int i, q;
	double c1x, c1y, c1r, c2x, c2y, c2r;
	cin >> c1x >> c1y >> c1r >> c2x >> c2y >> c2r;
	Circle c1(Point(c1x, c1y), c1r), c2(Point(c2x, c2y), c2r);
	pair<Point, Point> ans = crossPointsCC(c1, c2);
	printf("%.9f %.9f %.9f %.9f\n", ans.first.x, ans.first.y, ans.second.x, ans.second.y);
	
#ifdef cin
	fin.close();
#endif

#ifdef cout
	fout.close();
#endif
	return 0;
}

double dot(Vector a, Vector b) {
	return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b) {
	return a.x * b.y - a.y * b.x;
}

double getDistanceSP(Point p, Point p1, Point p2) {
	if (dot(p - p1, p2 - p1) < 0.0)return (p - p1).abs();
	else if (dot(p - p2, p1 - p2) < 0.0)return (p - p2).abs();
	else return  fabs(cross(p2 - p1, p - p1)) / (p2 - p1).abs();
}


double angle(Vector a, Vector b) {
	if (equals(dot(a, b), a.abs() * b.abs()))return 0.0;
	else if (equals(dot(a, b), (-1) * a.abs() * b.abs()))return M_PI;
	if (cross(a, b) > 0.0)return acos(dot(a, b) / a.abs() / b.abs());
	else return (-1) * acos(dot(a, b) / a.abs() / b.abs());
}

bool doIntersect(Point p1, Point p2, Point p3, Point p4) {
	if (clockwise(p1, p2, p3) *  clockwise(p1, p2, p4) * clockwise(p3, p4, p1) * clockwise(p3, p4, p1) == 0) {
		return true;
	} else if (-1 <= clockwise(p1, p2, p3) * clockwise(p1, p2, p4) && clockwise(p1, p2, p3) * clockwise(p1, p2, p4) <= 0 && -1 <= clockwise(p3, p4, p1) * clockwise(p3, p4, p2) && clockwise(p3, p4, p1) * clockwise(p3, p4, p2) <= 0) {
		return true;
	} else {
		return false;
	}
}

double getDistanceSS(Point p1, Point p2, Point p3, Point p4) {
	if (doIntersect(p1, p2, p3, p4))return 0;
	else return min({ getDistanceSP(p4, p1, p2), getDistanceSP(p3, p1, p2), getDistanceSP(p1, p3, p4), getDistanceSP(p2, p3, p4) });
}

int clockwise(Point p0, Point p1, Point p2) {
	if (p2 == p0 || p2 == p1) {
		//cout << "ON_SEGMENT" << endl;
		return ONS;
	} else if (angle(p1 - p0, p2 - p0) == 0.0) {
		if ((p1 - p0).norm() < (p2 - p0).norm()) {
			//cout << "ONLINE_FRONT" << endl;
			return ONF;
		} else {
			//cout << "ON_SEGMENT" << endl;
			return ONS;
		}
	} else if(angle(p1 - p0, p2 - p0) == M_PI){
		//cout << "ONLINE_BACK" << endl;
		return ONB;
	} else {
		if (angle(p1 - p0, p2 - p0) > 0.0) {
			//cout << "COUNTER_CLOCKWISE" << endl;
			return CCW;
		} else {
			//cout << "CLOCKWISE" << endl;
			return YCW;
		}
	}
}

Point crossPoint(Point p1, Point p2, Point p3, Point p4) {
	double d1, d2, t;
	d1 = fabs(cross(p2 - p1, p3 - p1) / (p2 - p1).norm());
	d2 = fabs(cross(p2 - p1, p4 - p1) / (p2 - p1).norm());
	t = d1 / (d1 + d2);
	return (p3 + (p4 - p3) * t);
}

pair<Point, Point> crossPoint(Point p1, Point p2, Point center, double r) {
	Vector pr = project(center, p1, p2) - center;
	double base = sqrt(r * r - pr.norm());

	Vector ans1 = center + pr + (p2 - p1) / (p2 - p1).abs() * base;
	Vector ans2 = center + pr - (p2 - p1) / (p2 - p1).abs() * base;
	
	if (ans1 < ans2) {
		return make_pair(ans1, ans2);
	} else {
		return make_pair(ans2, ans1);
	}

}

Vector rotateVector(Vector v, double angle) {
	Vector ans(v.x * cos(angle) - v.y * sin(angle), v.x * sin(angle) + v.y * cos(angle));
	return ans;
}

Point project(Point p, Point p1, Point p2) {
	Vector hypo = p - p1, base = p2 - p1;
	return (p1 + base * dot(hypo, base) / base.norm());
}

pair<Point, Point> crossPointsCC(Circle c1, Circle c2) {
	double d = (c2.c - c1.c).abs();
	double a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
	Point ans1 = c1.c + rotateVector(c2.c - c1.c, a) / d * c1.r, ans2 = c1.c + rotateVector(c2.c - c1.c, (-1) * a) / d * c1.r;
	if (ans1 < ans2) {
		return make_pair(ans1, ans2);
	} else {
		return make_pair(ans2, ans1);
	}
}