#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n) ; i++)
constexpr auto INF = 2147483647;
static const double EPS = pow(10,-10);
typedef long long ll;
static int COUNTER_CLOCKWISE = 1;
static int CLOCKWISE = -1;
static int ONLINE_BACK = 2;
static int ONLINE_FRONT = -2;
static int ON_SEGMENT = 0;

class Vector2{
  public:
  double x, y;
  Vector2(){}
  Vector2(double x, double y): x(x), y(y) {}

  Vector2 operator + (Vector2 v) {
    return Vector2(x + v.x , y + v.y);
  }
  Vector2 operator - (Vector2 v) {
    return Vector2(x - v.x , y - v.y);
  }

  Vector2 operator * (double d){
    return Vector2(d*x, d*y);
  }

  double norm(){
    return x*x + y*y;
  }

  double abs(){
    return sqrt(norm());
  }

};

class Circle{
  public:
  Vector2 center;
  double r;
  Circle(){};
  Circle(Vector2 center_, double r):center(center),r(r){};
};

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

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

Vector2 projection(Vector2 a, Vector2 b, Vector2 p){
  Vector2 base = b - a;
  Vector2 hypo = p - a;
  double norm_base = pow(base.x,2) + pow(base.y,2);

  Vector2 x;
  x = a + base*(dot(hypo,base) / norm_base);
  return x;
}

Vector2 refrection(Vector2 a, Vector2 b, Vector2 p){
  Vector2 v, p_projection;
  p_projection = projection(a,b,p); 
  v = p_projection + (p_projection - p);
  return v;
}

int ccw(Vector2 a, Vector2 b, Vector2 p){
  Vector2 hypo = p - a;
  Vector2 base = b - a;
  if(cross(base,hypo) > EPS) return COUNTER_CLOCKWISE;
  if(cross(base,hypo) < -EPS) return CLOCKWISE;
  if(dot(base,hypo) < -EPS) return ONLINE_BACK;
  if(hypo.norm() > base.norm()) return ONLINE_FRONT;
  return ON_SEGMENT;
}

bool intersect(Vector2 a,Vector2 b,Vector2 p,Vector2 q){
  int t1, t2;
  t1 =ccw(a,b,p)*ccw(a,b,q);
  t2 =ccw(p,q,a)*ccw(p,q,b);
  if(t1 <= 0 && t2 <= 0) return true;
  else return false;
}

Vector2 crossPoint(Vector2 a,Vector2 b,Vector2 p,Vector2 q){
  Vector2 base, hypo_1, hypo_2, v;
  base = b-a;
  hypo_1 = p-a;
  hypo_2 = q-a;
  double d1 = abs(cross(base, hypo_1)); 
  double d2 = abs(cross(base, hypo_2));
  double ratio = d1/(d1+d2);
  v = p + (hypo_2 - hypo_1)*ratio;
  return v;
}

double distance(Vector2 a,Vector2 b,Vector2 p){
  if(dot(b-a, p-b) > 0) return (p-b).abs();
  if(dot(b-a, p-a) < 0) return (p-a).abs();
  return (p - projection(a,b,p)).abs();
}

double distance(Vector2 a,Vector2 b,Vector2 p,Vector2 q){
  if(intersect(a,b,p,q)) return 0;
  vector<double> d_arr(4) ;
  d_arr[0] = distance(a,b,p);
  d_arr[1] = distance(a,b,q);
  d_arr[2] = distance(p,q,a);
  d_arr[3] = distance(p,q,b);
  return min(min(d_arr[0],d_arr[1]),
             min(d_arr[2],d_arr[3]));
}

pair<Vector2,Vector2> crossPoint(Circle circle, Vector2 a, Vector2 b){
  Vector2 base = b-a ;
  Vector2 pro = projection(a,b,circle.center);
  double ratio = sqrt(pow(circle.r,2) -(pro-circle.center).norm())
                 / base.abs();
  Vector2 v_1, v_2, tmp;
  v_1 = pro - base*ratio;
  v_2 = pro + base*ratio;
  if((v_1.x == v_2.x && v_1.y > v_2.y) || v_1.x > v_2.x) swap(v_1,v_2);
  return make_pair(v_1,v_2);
}

Vector2 make_vector(double dist, double deg){
  Vector2 v(dist*cos(deg), dist*sin(deg));
  return v;
}

pair<Vector2,Vector2> crossPoint(Circle c_1, Circle c_2){
  double deg_a, deg_b, dist;
  Vector2 base = c_2.center - c_1.center;
  dist = base.abs();
  deg_a  = acos((c_1.r*c_1.r + dist*dist - c_2.r*c_2.r)
                / (2*c_1.r*dist));
  deg_b = atan2(base.y, base.x);
  Vector2 v_1, v_2;
  v_1 = c_1.center + make_vector(c_1.r, deg_b + deg_a);
  v_2 = c_1.center + make_vector(c_1.r, deg_b - deg_a);

  if((v_1.x == v_2.x && v_1.y > v_2.y) || v_1.x > v_2.x) swap(v_1,v_2);
  return make_pair(v_1,v_2);
}



int main(){
  Vector2 a,b;
  pair<Vector2,Vector2> ans;
  Circle c_1, c_2;
  cin >> c_1.center.x >> c_1.center.y >> c_1.r;
  cin >> c_2.center.x >> c_2.center.y >> c_2.r;
  
  ans = crossPoint(c_1, c_2);
  
  cout << fixed << setprecision(8);
  cout << ans.first.x << " " << ans.first.y << " ";
  cout << ans.second.x << " " << ans.second.y;
  cout << endl;

  return 0;
}


Measured memory_bytes: 3716