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;
#define rep(i,n) for(int i = 0; i < (int)n; i++)

const double eps = 1e-10;

struct Point {
  double x, y;
  Point(double x = 0.0, double y = 0.0) : x(x), y(y) {}  
  double norm() {return sqrt(x*x + y*y);}
};

Point operator + (const Point &p, const Point &q) {return Point(p.x + q.x, p.y + q.y);}
Point operator - (const Point &p, const Point &q) {return Point(p.x - q.x, p.y - q.y);}
double operator * (const Point &p, const Point q) {return p.x * q.x + p.y * q.y;}
bool operator == (const Point &p, const Point &q) {return (abs(p.x - q.x) < eps && abs(p.y - q.y) < eps);}
bool operator != (const Point &p, const Point &q) {return !(p == q);}
double cross(const Point &p, const Point &q) {return p.x*q.y - p.y*q.x;}
double dist(const Point &p, const Point &q) {return (p-q).norm();}

struct Segment {
  Point p , q;
  Segment(Point p = Point(0.0,0.0), Point q = Point(0.0,0.0)) : p(p), q(q) {}
};

struct Line {
  double a, b, c;
  Line(double a, double b, double c) : a(a), b(b), c(c) {}
  Line(Point p, Point q) {
    a = q.y - p.y;
    b = p.x - q.x;
    c = q.x * p.y - p.x * q.y;
  }
};

struct Circle {
  double r;
  Point p;
  Circle(Point p = Point(0.0, 0.0), double r = 0.0) : p(p), r(r) {}
};

// ★点の直線への射影
Point projection (Point p, Line l) {
  double x = p.x - l.a * (l.a*p.x + l.b*p.y + l.c) / (l.a*l.a + l.b*l.b);
  double y = p.y - l.b * (l.a*p.x + l.b*p.y + l.c) / (l.a*l.a + l.b*l.b);
  return Point(x,y);
}

// ★直線について線対称な点
Point reflection(Point p, Line l) {
  double x = p.x - 2.0 * l.a * (l.a*p.x + l.b*p.y + l.c) / (l.a*l.a + l.b*l.b);
  double y = p.y - 2.0 * l.b * (l.a*p.x + l.b*p.y + l.c) / (l.a*l.a + l.b*l.b);
  return Point(x,y);
}

// ★点の線分からの回転方向
int ccw(Point p, Point p1, Point p2) {
  p1 = p1 - p; p2 = p2 - p;
  if(cross(p1,p2) > eps) return 1; 
  if(cross(p1,p2) < -eps) return -1; 
  if(p1 * p2 < 0) return 2; 
  if(p1.norm() < p2.norm()) return -2; 
  return 0; 
}

// ★点が線分上にあるか判定
bool on_segment(Point p, Segment s) {
  return (ccw(s.p,s.q,p) == 0 ? true : false);
}

// ★線分の交差判定
bool segment_segment_cross(const Segment l, const Segment s) {
  return ccw(l.p,l.q,s.p) * ccw(l.p,l.q,s.q) <= 0 && ccw(s.p,s.q,l.p) * ccw(s.p,s.q,l.q) <= 0;
}

// ★直線の平行・直交判定 (平行:2 直交:1 その他:0)
int line_parallel_orthogonal(Line l, Line s) {
  if(abs(l.a*s.a + l.b*s.b) < eps) return 1;
  else if(abs(l.a*s.b - l.b*s.a) < eps) return 2;
  else return 0;
}

// ★直線と直線の交点 
vector<Point> line_line_cross(Line l, Line s) {
  vector<Point> vp;
  if(line_parallel_orthogonal(l,s) != 2) {
    Point p;
    p.x = (l.b*s.c - s.b*l.c) / (l.a*s.b - s.a*l.b);
    p.y = (-l.a*s.c + s.a*l.c) / (l.a*s.b - s.a*l.b);
    vp.push_back(p);
  }
  return vp;
}

// ★点と直線の距離
double point_line_dist(Point p, Line l) {
  return abs(l.a*p.x + l.b*p.y + l.c) / sqrt(l.a*l.a + l.b*l.b);
}

// ★点と線分の距離
double point_segment_dist(Point p, Segment s) {
  Point h = projection(p,Line(s.p,s.q));
  if(on_segment(h,s)) return dist(p,h);
  else return min(dist(p,s.p),dist(p,s.q));
}

// ★線分と線分の距離
double segment_segment_dist(Segment l, Segment s) {
  if(segment_segment_cross(l,s)) return 0.0;
  else return min({point_segment_dist(l.p,s),point_segment_dist(l.q,s),point_segment_dist(s.p,l),point_segment_dist(s.q,l)});
}

// 直線と直線の距離
double line_line_dist(Line l, Line s) {
  if(line_parallel_orthogonal(l,s) != 2) return 0.0;
  else if(abs(s.a) < eps) return point_line_dist(Point(0.0,-s.c/s.b),l);
  else return point_line_dist(Point(-s.c/s.a,0),l);
}

// 直線と線分の距離
double line_segment_dist(Line l, Segment s) {
  Point a, b;
  if(abs(l.a) < eps) a = Point(0.0,-l.c/l.b), b = Point(1.0,-l.c/l.b);
  else if(abs(l.b) < eps) a = Point(-l.c/l.a,0.0), b = Point(-l.c/l.a,0.0);
  else a = Point(0.0,-l.c/l.b), b = Point(-l.c/l.a,0);

  if(ccw(a,b,s.p) * ccw(a,b,s.q) <= 0) return 0.0;
  else return min(point_line_dist(s.p,l),point_line_dist(s.q,l));
}

// ★円と直線の交点
vector<Point> circle_line_cross(Circle c, Line l) {
  vector<Point> vp;
  Point h = projection(c.p,l);

  double d = l.a*c.p.x + l.b*c.p.y + l.c;
  double q = c.r*c.r - d*d / (l.a*l.a + l.b*l.b);
  if(q >= eps) {
    Point p1, p2;
    p1.x = h.x + sqrt(q) * l.b / sqrt(l.a*l.a + l.b*l.b);
    p1.y = h.y - sqrt(q) * l.a / sqrt(l.a*l.a + l.b*l.b);
    p2.x = h.x - sqrt(q) * l.b / sqrt(l.a*l.a + l.b*l.b);
    p2.y = h.y + sqrt(q) * l.a / sqrt(l.a*l.a + l.b*l.b);
    vp.push_back(p1);
    vp.push_back(p2);
  } else if(abs(q) < eps) {
    vp.push_back(h);
  }
  return vp;
} 

// 円と円の交点
vector<Point> circle_circle_cross(Circle c, Circle d) {
  Line l(2.0*(c.p.x-d.p.x),2.0*(c.p.y-d.p.y),-c.p.x*c.p.x+d.p.x*d.p.x-c.p.y*c.p.y+d.p.y*d.p.y+c.r*c.r-d.r*d.r);
  return circle_line_cross(c,l);
}

int main() {
  Circle c, d;
  cin >> c.p.x >> c.p.y >> c.r;
  cin >> d.p.x >> d.p.y >> d.r;
  vector<Point> v = circle_circle_cross(c,d);
  if(v.size() == 1) v.push_back(v[0]);
  if((v[0].x > v[1].x) || (abs(v[0].x-v[1].x) < eps && v[0].y > v[1].y)) swap(v[0],v[1]); 
  rep(i,2) printf("%.9lf %.9lf ",v[i].x,v[i].y);
  cout << endl;
}