#include <array>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>

const double kEpsilon = 1e-10;
inline bool equals(double a, double b)
{
    return fabs(a - b) < kEpsilon;
}

class Point
{
  public:
    double x, y;

    Point() = default;
    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 k)
    {
        return Point(x * k, y * k);
    }
    Point operator/(const double k)
    {
        return Point(x / k, y / k);
    }

    double SquaredNorm()
    {
        return x * x + y * y;
    }
    double abs()
    {
        return sqrt(this->SquaredNorm());
    }

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

    double dot(const Point &p) const
    {
        return x * p.x + y * p.y;
    }
    double cross(const Point &p) const
    {
        return x * p.y - y * p.x;
    }
};

double dot(const Point &p1, const Point &p2)
{
    return p1.x * p2.x + p1.y * p2.y;
}
double cross(const Point &p1, const Point &p2)
{
    return p1.x * p2.y - p1.y * p2.x;
}

using Vector = Point;

struct Segment
{
    Point p1, p2;

    Segment() = default;
    Segment(Point p1, Point p2) : p1(p1), p2(p2)
    {
    }
};
using Line = Segment;

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

Point projection(Point &p1, Point &p2, Point &p)
{
    auto q = p2 - p1;
    auto a = q.dot(p - p1) / q.SquaredNorm();
    return p1 + q * a;
}

Point projection(Line &l, Point &p)
{
    auto p1 = l.p1;
    auto p2 = l.p2;
    return projection(p1, p2, p);
}

std::array<Point, 2> crossPointsCircleLine(Circle &c, Line &l)
{

    Vector q = l.p2 - l.p1;
    if (l.p2 < l.p1)
        q = q * (-1.);

    Vector e = q / q.abs();
    Point pr = projection(l, c.c);
    double h = (c.c - pr).abs();
    double length = sqrt(c.r * c.r - h * h);

    std::array<Point, 2> cross = {pr - e * length, pr + e * length};

    return cross;
}

Point rotate(Point &p, double cos, double sin)
{
    Point q;
    q.x = cos * p.x - sin * p.y;
    q.y = sin * p.x + cos * p.y;
    return q;
}

std::array<Point, 2> crossPointsCircles(Circle &c1, Circle &c2)
{
    Vector q = c2.c - c1.c;
    double a = c1.r;
    double b = q.abs();
    double c = c2.r;
    double cos = (a * a + b * b - c * c) / (2 * a * b);
    auto sin = sqrt(1 - cos * cos);

    Vector v = q / b * c1.r;

    std::array<Point, 2> cross;
    cross[0] = c1.c + rotate(v, cos, sin);
    cross[1] = c1.c + rotate(v, cos, -sin);

    if (cross[1] < cross[0])
    {
        auto tmp = cross[0];
        cross[0] = cross[1];
        cross[1] = tmp;
    }

    return cross;
}

int main()
{
    Circle c1, c2;

    std::cin >> c1.c.x >> c1.c.y >> c1.r;
    std::cin >> c2.c.x >> c2.c.y >> c2.r;

    auto cross = crossPointsCircles(c1, c2);
    printf("%.9f %.9f %.9f %.9f\n", cross[0].x, cross[0].y, cross[1].x, cross[1].y);
}



Measured memory_bytes: 3300