Problem:
Problem Statement
Alice is a private teacher.
One of her job is to prepare the learning materials for her student.
Now, as part of the materials, she is drawing a Venn diagram between two sets $A$ and $B$.
Venn diagram is a diagram which illustrates the relationships among one or more sets.
For example, a Venn diagram between two sets $A$ and $B$ is drawn as illustrated below.
The rectangle corresponds to the universal set $U$.
The two circles in the rectangle correspond to two sets $A$ and $B$, respectively.
The intersection of the two circles corresponds to the intersection of the two sets, i.e. $A \cap B$.
Fig: Venn diagram between two sets
Alice, the mathematics personified, came up with a special condition to make her Venn diagram more beautiful.
Her condition is that the area of each part of her Venn diagram is equal to the number of elements in its corresponding set.
In other words, one circle must have the area equal to $|A|$, the other circle must have the area equal to $|B|$, and their intersection must have the area equal to $|A \cap B|$. Here, $|X|$ denotes the number of elements in a set $X$.
Alice already drew a rectangle, but has been having a trouble figuring out where to draw the rest, two circles, because she cannot even stand with a small error human would make.
As an old friend of Alice's, your task is to help her by writing a program to determine the centers and radii of two circles so that they satisfy the above condition.
Input
The input is a sequence of datasets.
The number of datasets is not more than $300$.
Each dataset is formatted as follows.
$U_W$ $U_H$ $|A|$ $|B|$ $|A \cap B|$
The first two integers $U_W$ and $U_H$ ($1 \le U_W, U_H \le 100$) denote the width and height of the rectangle which corresponds to the universal set $U$, respectively.
The next three integers $|A|$, $|B|$ and $|A \cap B|$ ($1 \le |A|, |B| \le 10{,}000$ and $0 \le |A \cap B| \le \min\{|A|,|B|\}$) denote the numbers of elements of the set $A$, $B$ and $A \cap B$, respectively.
The input is terminated by five zeroes.
You may assume that, even if $U_W$ and $U_H$ would vary within $\pm 0.01$, it would not change whether you can draw two circles under the Alice's condition.
Output
For each dataset, output the centers and radii of the two circles that satisfy the Alice's condition as follows:
$X_A$ $Y_A$ $R_A$ $X_B$ $Y_B$ $R_B$
$X_A$ and $Y_A$ are the coordinates of the center of the circle which corresponds to the set $A$.
$R_A$ is the radius of the circle which corresponds to the set $A$.
$X_B$, $Y_B$ and $R_B$ are the values for the set B.
These values must be separated by a space.
If it is impossible to satisfy the condition, output:
impossible
The area of each part must not have an absolute error greater than $0.0001$.
Also, the two circles must stay inside the rectangle with a margin of $0.0001$ for error, or more precisely, all of the following four conditions must be satisfied:
$X_A - R_A \ge -0.0001$
$X_A + R_A \le U_W + 0.0001$
$Y_A - R_A \
...(truncated)

Submitted solutions:

code_snippet: #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (1e+18) + 7;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-6;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

ll mod_pow(ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%mod;
		a = a * a%mod; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}


int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

int w, h, a, b, ab;

ld calc_arc(ld a1, ld a2, ld b) {
	ld s1 = a1 * a1 + a2 * a2 - b * b;
	ld s2 = 2 * a1*a2;
	return acos(s1 / s2);
}

void solve() {
	a -= ab; b -= ab;
	if (a < 0 || b < 0) {
		cout << "impossible" << endl; return;
	}
	ld s1 = a + ab;
	ld s2 = b + ab;
	ld r1 = sqrt(s1 / pi);
	ld r2 = sqrt(s2 / pi);
	bool sw = false;
	if (r1 < r2) {
		swap(r1, r2);
		swap(a, b);
		sw = true;
	}
	ld d;
	if (ab == 0)d = r1 + r2;
	else {
		ld l = 0, r = r1 + r2;
		rep(aa, 100) {
			d = (l + r) / 2.0;
			if (d + r2 <= r1) {
				l = d; continue;
			}
			ld t1 = calc_arc(d, r1, r2); t1 *= 2;
			ld t2 = calc_arc(d, r2, r1); t2 *= 2;
			ld area = 0;
			assert(t1 > sin(t1) - eps);
			//assert(t2 > sin(t2) - eps);
			assert(t1 < pi + eps);
			//assert(t2 < pi + eps);
			area += r1 * r1*t1 / 2.0 - r1 * r1*sin(t1) / 2.0;
			area += r2 * r2*t2 / 2.0 - r2 * r2*sin(t2) / 2.0;

			if (area < ab)r = d;
			else l = d;
		}
	}
	ld x1 = r1, y1 = r1;
	if (x1+r1 > w || y1 +r1 > h) {
		cout << "impossible" << endl;
		return;
	}
	ld l = 0, r = 1;
	rep(aa, 100) {
		ld m = (l + r) / 2.0;
		ld dx = d * sqrt(1-m*m);
		ld dy = d * m;
		ld x2 = x1 + dx;
		ld y2 = y1 + dy;
		if (x2 + r2 > w)l = m;
		else r = m;
	}
	ld m = r;
	ld dx = d * sqrt(1-m*m);
	ld dy = d * m;
	ld x2 = x1 + dx;
	ld y2 = y1 + dy;
	assert(x1 - r1 >= -0.0001);
	assert(x2 - r2 >= -0.0001);
	assert(y1 - r1 >= -0.0001);
	assert(y2 - r2 >= -0.0001);
	if (x1+r1>w||y1+r1>h+eps||x2+r2 > w+eps || y2+r2 > h+eps) {
		cout << "impossible" << endl;
	}
	else {
		assert(x1 + r1 <= w + 0.0001);
		assert(x2 + r2 <= w + 0.0001);
		assert(y1 + r1 <= h + 0.0001);
		assert(y2 + r2 <= h + 0.0001);
		if (sw) {
			swap(x1, x2);
			swap(y1, y2);
			swap(r1, r2);
		}
		ld dist = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
		assert(abs(dist - d) < eps);
		cout << x1 << " " << y1 << " " << r1 << " " << x2 << " " << y2 << " " << r2 << endl;
	}
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(12);
	//init();
	//int t; cin >> t; rep(i, t)solve();
	while (cin >> w>>h>>a>>b>>ab, w|h|a|b|ab)solve();
	//solve();
	//stop
		return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 20016
final_rank: 13

code_snippet: #include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cmath>
#include <complex>
#include <vector>
#include <cstdlib>
#include <cassert>

using namespace std;

#define SIZE 4010
#define INF 1000000000
#define LLINF 1000000000000000000

typedef long long ll;
typedef long double Real;
typedef complex<Real> P;

Real eps = 1e-8;


Real dot(P a, P b) {
  return (a * conj(b)).real();
}

Real cross(P a, P b) {
  return (conj(a) * b).imag();
}


int ccw(P a, P b, P c) {
  if (cross(b-a, c-a) > eps) return 1;
  if (cross(b-a, c-a) < -eps) return -1;
  if (dot(b-a, c-a) < -eps) return -2;
  if (dot(a-b, c-b) < -eps) return 2;
  return 0;
}

bool isIntersectCC(P c1, Real r1, P c2, Real r2) {
  Real dist = abs(c1 - c2);

  return abs(r1 - r2) < dist + eps && dist - eps < r1 + r2;
}

vector<P> getCrossPointCC(P c1, Real r1, P c2, Real r2) {
  if (!isIntersectCC(c1, r1, c2, r2)) return {};

  Real dist = abs(c1 - c2);
  Real a = acos((r1*r1 + dist*dist - r2 * r2) / (2 * r1 * dist));

  return {c1 + polar(r1, arg(c2 - c1) + a), c1 + polar(r1, arg(c2 - c1) - a)};
}

bool isIntersectedSS(P a1, P a2, P b1, P b2) {
  int a = ccw(b1, b2, a1);
  int b = ccw(b1, b2, a2);
  int c = ccw(a1, a2, b1);
  int d = ccw(a1, a2, b2);

  return a * b <= 0 && c * d <= 0;
}

Real getAreaCC2(P c1, Real r1, P c2, Real r2) {
  double d = abs(c1 - c2);
  if (r1 + r2 <= d + eps) {
    return 0.0;
  } else if (d <= abs(r1 - r2) + eps) {
    double r = min(r1, r2);
    return r * r * M_PI;
  } else {
    double rc = (d * d + r1 * r1 - r2 * r2) / (2 * d);
    double theta = acos(rc / r1);
    double phi = acos((d - rc) / r2);
    return r1 * r1 * theta + r2 * r2 * phi - d * r1 * sin(theta);
  }
}

Real getAreaCC(P c1, Real r1, P c2, Real r2) {
  if (abs(c1 - c2) + min({r1, r2}) < max({r1, r2}) + eps) {
    return pow(min({r1, r2}), 2) * M_PI;
  }

  if (abs(r1 + r2 - abs(c1 - c2)) < eps) return 0;

  auto v = getCrossPointCC(c1, r1, c2, r2);

  if (v.empty()) return 0;


  Real d2 = abs(v[1] - v[0]);

  if (d2 < eps) {
    return 0;
  }

  //Real theta1 = acos(-(d2*d2 - r1*r1 - r1*r1) / (2 * r1 * r1));
  //Real theta2 = acos(-(d2*d2 - r2*r2 - r2*r2) / (2 * r2 * r2));

  Real theta1 = abs(arg((v[0] - c1) / (v[1] - c1)));
  Real theta2 = abs(arg((v[0] - c2) / (v[1] - c2)));


  Real area = 0;
  if (!isIntersectedSS(v[0], v[1], c1, c2)) {
    if (r1 > r2) {
      swap(r1, r2);
      swap(c1, c2);
      swap(theta1, theta2);
    }
    area = r1 * r1 * M_PI;
    area -= r1 * r1 * theta1 / 2;
    area -= abs(cross(v[0]-c2, v[1]-c2)) / 2;
    area += abs(cross(v[0]-c1, v[1]-c1)) / 2;
    area += r2 * r2 * theta2 / 2;
  } else {
    area = - abs(cross(c1-v[0], c2-v[0]));
    area += r1 * r1 * theta1 / 2;
    area += r2 * r2 * theta2 / 2;
  }

  //assert(abs(theta1 - theta1v) < eps);
  //assert(abs(theta2 - theta2v) < eps);


  return area;
}

bool solve() {
  int W, H, A, B, AB;

  cin >> W >> H >> A >> B >> AB;
  /*
  W = rand() % 20 + 1;
  H = rand() % 20 + 1;
  A = rand() % 20 + 1;
  B = rand() % 20 + 1;
  AB = rand() % min({A, B});
  */
  if (W == 0) return false;

  Real r1 = sqrt((Real)A / M_PI);
  Real r2 = sqrt((Real)B / M_PI);

  bool f = r1 < r2;

  if (f) swap(r1, r2);

  Real d;

  if (AB == 0) {
    d = r1 + r2;
  } else if (AB == min({A, B})) {
    d = 0;
  } else {
    Real l = abs(r1 - r2), r = r1 + r2;

    for (int i=0; i<100; i++) {
      Real mid = (l + r) / 2;

      Real area = getAreaCC(P(0, 0), r1, P(0, mid), r2);

      assert(abs(area - getAreaCC2(P(0, 0), r1, P(0, mid), r2)) < eps);

      if (area < AB) {
        r = mid;
      } else {
        l = mid;
      }
    }

    d = l;
  }

  P e1 = P(r1, r1);
  P e2 = P(W-r2, H-r2);

  if (min({W, H}) < max({r1, r2}) * 2 - eps) {
    puts("impossible");
    return true;
  }

  if (abs(e1 - e2) < d - eps) {
    puts("impossible");
    return true;
  }

  P e2d = (e2 - e1) / abs(e2 - e1) * d + e1;
  /*
  printf("%.10lf %.10lf %.10lf ",  (double)e1.real(), (double)e1.imag(), (double)r1);
  printf("%.10lf %.10lf %.10lf\n", (double)e2d.real(), (double)e2d.imag(), (double)r2);

  cerr << d << endl;

  assert(abs(e1 - e2d) < abs(e1 - e2) + eps);
  assert(abs(abs(e1 - e2d) - d) < eps);
  printf("%d == %.10Lf\n", AB, getAreaCC(e1, r1, e2d, r2));
  assert(abs(getAreaCC(e1, r1, e2d, r2) - AB) < eps);
  */
  if (f) {
    swap(e1, e2d);
    swap(r1, r2);
  }

  printf("%.10lf %.10lf %.10lf ",  (double)e1.real(), (double)e1.imag(), (double)r1);
  printf("%.10lf %.10lf %.10lf\n", (double)e2d.real(), (double)e2d.imag(), (double)r2);

  //cerr << r1 << endl;
  //cerr << d << endl;
  //cerr << getAreaCC(e1, r1, e2d, r2) << endl;



  return true;
}

int main() {
  while(solve());

}
accuracy: 1
time_ms: 10
memory_kb: 3460
final_rank: 4

code_snippet: #include <iostream>
#include <complex>
#include <cstdio>
#include <cmath>
#include <utility>
#include <vector>
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
typedef pair<P,double> C;
typedef vector<P> Poly;
#define X real()
#define Y imag()
#define EPS (1e-10)
#define INF (1e15)
const double pi = acos(-1);

//2D version
namespace std{
  bool operator < (const P& a, const P& b){
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }
  bool operator == (const P& a, const P& b){
    return abs(a-b) < EPS;
  }
}

double dot(P a, P b){
  return a.X * b.X + a.Y * b.Y;
}
double cross(P a, P b){
  return a.X * b.Y - a.Y * b.X;
}

P n_vector(P a){
  return a*P(0,1)/abs(a);
}

vector<P> cpcc(C a, C b){
  //円と円の交点
  double d = abs(a.first-b.first), ra = a.second, rb = b.second;
  double t = (ra*ra-rb*rb+d*d)/2/d, h = sqrt(ra*ra-t*t);
  P m = t/abs(b.first-a.first)*(b.first-a.first)+a.first;
  vector<P> cp(2,m);
  P n = n_vector(a.first-b.first);
  cp[0] -= h*n;
  cp[1] += h*n;
  return cp;
}

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if( cross(b,c) > EPS ) return +1;
  if( cross(b,c) < -EPS ) return -1;
  if( dot(b,c) < 0 ) return +2;
  if( abs(b) + EPS < abs(c) ) return -2;
  return 0;
}

double common_area(C a, C b){
  //円と円の共通部分の面積
  if(abs(a.first - b.first) < abs(a.second - b.second))
    return min(a.second*a.second, b.second*b.second)*pi;
  if(abs(a.first - b.first) > a.second + b.second) return 0;
  vector<P> cp = cpcc(a,b);
  if(abs(cp[0] - cp[1]) < EPS) return 0;
  double ra = a.second, rb = b.second, theta_a = abs(arg(cp[0] - a.first) - arg(cp[1] - a.first)),
    theta_b = abs(arg(cp[0] - b.first) - arg(cp[1] - b.first)), 
    ret = 0;
  if(ccw(cp[0], cp[1], a.first)*ccw(cp[0], cp[1], b.first) >= 0){
    if(ra < rb){
      theta_a = max(2*pi - theta_a, theta_a);
      theta_b = min(2*pi - theta_b, theta_b);
      ret += 0.5*abs(cross(cp[0] - a.first, cp[1] - a.first)) -
        0.5*abs(cross(cp[0] - b.first, cp[1] - b.first));
    }else{
      theta_a = min(2*pi - theta_a, theta_a);
      theta_b = max(2*pi - theta_b, theta_b);
      ret -= 0.5*abs(cross(cp[0] - a.first, cp[1] - a.first)) -
        0.5*abs(cross(cp[0] - b.first, cp[1] - b.first));
    }
  }else{
    theta_a = min(2*pi - theta_a, theta_a);
    theta_b = min(2*pi - theta_b, theta_b);
    ret -= 0.5*abs(cross(cp[0] - a.first, cp[1] - a.first)) +
      0.5*abs(cross(cp[0] - b.first, cp[1] - b.first));
  }
  return ret + theta_a/2.0*ra*ra + theta_b/2.0*rb*rb;
}

int main(){
  int w, h, a, b, c;
  while(cin >> w >> h >> a >> b >> c, w){
    bool f = false;
    if(a < b){
      swap(a,b);
      f = true;
    }
    double ra = sqrt(a/pi), rb = sqrt(b/pi);
    if(2*ra > min(w, h) + EPS || c > b){
      cout << "impossible" << endl;
      continue;
    }
    P s(ra, ra), t(w - rb, h - rb);
    C ca(s, ra), cb(t, rb);
    if(common_area(ca, cb) > c + EPS){
      cout << "impossible" << endl;
      continue;
    }
    P ok = s, ng = t, m;
    for(int i = 0; i < 1e4; ++i){
      m = (ok + ng)/2.0;
      if(common_area(ca, C(m, rb)) < c) ng = m;
      else ok = m;
    }
    if(f) printf("%.9f %.9f %.9f %.9f %.9f %.9f\n", m.X, m.Y, rb, s.X, s.Y, ra);
    else printf("%.9f %.9f %.9f %.9f %.9f %.9f\n", s.X, s.Y, ra, m.X, m.Y, rb);
  }
  return 0;
}
accuracy: 1
time_ms: 100
memory_kb: 3384
final_rank: 9

code_snippet: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60

typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-9, pi = acos(-1.0);
namespace std {
    bool operator<(const Point &lhs, const Point &rhs) {
        if (lhs.real() < rhs.real() - eps) return true;
        if (lhs.real() > rhs.real() + eps) return false;
        return lhs.imag() < rhs.imag();
    }
}
Point input_point() {ld x, y; cin >> x >> y; return Point(x, y);} // ????????\???
bool eq(ld a, ld b) {return (abs(a - b) < eps);} // ????????????????????????
ld dot(Point a, Point b) {return real(conj(a) * b);} // ??????
ld cross(Point a, Point b) {return imag(conj(a) * b);} // ??????

ll W,H,A,B,S;
ld ra,rb;
ld check(ld theta){
    ld res = 0.0;
    
    ld x = ra * cos(theta/2), y = ra*sin(theta/2);
    
    ld x2 = sqrt(rb*rb - y*y);
    ld ox = x2 + x;
    
    ld theta2 = 2 * asin(y/rb);
    
    ld SAB = 0.5 * ra * ra * sin(theta) + 0.5 * rb * rb * sin(theta2);
    
    ld S1 = pi * ra * ra * theta / (2*pi);
    ld S2 = pi * rb * rb * theta2 / (2*pi);
    
    res = S1 + S2 - SAB;
    return res;
}

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    while(cin >> W >> H >> A >> B >> S, W|H|A|B|S){
        bool f = false;
        if(A > B) {
            swap(A,B);
            f = true;
        }
        ra = sqrt(A/pi);
        rb = sqrt(B/pi);
        ld l = 0, r = 2*pi;
        for(int i = 0; i < 300; i++){
            ld m = (l + r)/2.0;
            ld area = check(m);
            if(area > S){
                r = m;
            }else{
                l = m;
            }
        }
        ld theta = r;
        
        ld XA,YA,XB,YB;
        
        XB = rb + 0.0001; YB = rb + 0.0001;
        
        if(XB + rb > (ld)W + 0.0001 || (YB + rb) > (ld)H + 0.0001){
            cout << "impossible" <<endl;
            continue;
        }
        
        ld x = ra * cos(theta/2), y = ra*sin(theta/2);
        ld x2 = sqrt(rb*rb - y*y);
        ld ox = x2 + x;
        
        bool f2 = false;
        for(ld T = 0.0; T < pi + eps; T += 0.0001){
            ld X = XB + ox * cos(T);
            ld Y = YB + ox *sin(T);
            if(((X + ra) < (ld)W + 0.0001) && ((X - ra) > -0.0001)){
                if(((Y + ra) < (ld)H + 0.0001) && ((Y - ra) > -0.0001)){
                    XA = X; YA = Y;
                    f2 = true;
                    break;
                }
            }
        }
        if(!f2){
            cout << "impossible" << endl;
            continue;
        }
        if(f){
            swap(XA,XB);
            swap(YA,YB);
            swap(ra,rb);
        }
        cout << fixed << setprecision(10) << XA << " " << YA << " " << ra << " " << XB << " " << YB << " " << rb << endl;
    }
    return 0;
}
accuracy: 1
time_ms: 160
memory_kb: 3544
final_rank: 11

code_snippet: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60

typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-9, pi = acos(-1.0);
namespace std {
    bool operator<(const Point &lhs, const Point &rhs) {
        if (lhs.real() < rhs.real() - eps) return true;
        if (lhs.real() > rhs.real() + eps) return false;
        return lhs.imag() < rhs.imag();
    }
}
Point input_point() {ld x, y; cin >> x >> y; return Point(x, y);} // 点の入力
bool eq(ld a, ld b) {return (abs(a - b) < eps);} // 誤差つき等号判定
ld dot(Point a, Point b) {return real(conj(a) * b);} // 内積
ld cross(Point a, Point b) {return imag(conj(a) * b);} // 外積

ll W,H,A,B,S;
ld ra,rb;
ld check(ld theta){
    ld res = 0.0;
    
    ld x = ra * cos(theta/2), y = ra*sin(theta/2);
    
    ld x2 = sqrt(rb*rb - y*y);
    ld ox = x2 + x;
    
    ld theta2 = 2 * asin(y/rb);
    
    ld SAB = 0.5 * ra * ra * sin(theta) + 0.5 * rb * rb * sin(theta2);
    
    ld S1 = pi * ra * ra * theta / (2*pi);
    ld S2 = pi * rb * rb * theta2 / (2*pi);
    
    res = S1 + S2 - SAB;
    return res;
}

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    while(cin >> W >> H >> A >> B >> S, W|H|A|B|S){
        bool f = false;
        if(A > B) {
            swap(A,B);
            f = true;
        }
        ra = sqrt(A/pi);
        rb = sqrt(B/pi);
        ld l = 0, r = 2*pi;
        for(int i = 0; i < 300; i++){
            ld m = (l + r)/2.0;
            ld area = check(m);
            if(area > S){
                r = m;
            }else{
                l = m;
            }
        }
        ld theta = r;
        
        ld XA,YA,XB,YB;
        
        XB = rb + 0.0001; YB = rb + 0.0001;
        
        if(XB + rb > (ld)W + 0.0001 || (YB + rb) > (ld)H + 0.0001){
            cout << "impossible" <<endl;
            continue;
        }
        
        ld x = ra * cos(theta/2), y = ra*sin(theta/2);
        ld x2 = sqrt(rb*rb - y*y);
        ld ox = x2 + x;
        
        bool f2 = false;
        for(ld T = 0.0; T < pi + eps; T += 0.0001){
            ld X = XB + ox * cos(T);
            ld Y = YB + ox *sin(T);
            if(((X + ra) < (ld)W + 0.0001) && ((X - ra) > -0.0001)){
                if(((Y + ra) < (ld)H + 0.0001) && ((Y - ra) > -0.0001)){
                    XA = X; YA = Y;
                    f2 = true;
                    break;
                }
            }
        }
        if(!f2){
            cout << "impossible" << endl;
            continue;
        }
        if(f){
            swap(XA,XB);
            swap(YA,YB);
            swap(ra,rb);
        }
        cout << fixed << setprecision(10) << XA << " " << YA << " " << ra << " " << XB << " " << YB << " " << rb << endl;
    }
    return 0;
}
accuracy: 1
time_ms: 160
memory_kb: 3460
final_rank: 10

code_snippet: #include<bits/stdc++.h>
using namespace std;
using Int = long long;


#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b)) < EPS)
#define PI 3.141592653589793238
 
// COUNTER CLOCKWISE
static const int CCW_COUNTER_CLOCKWISE = 1;
static const int CCW_CLOCKWISE = -1;
static const int CCW_ONLINE_BACK = 2;
static const int CCW_ONLINE_FRONT = -2;
static const int CCW_ON_SEGMENT = 0;

//Intercsect Circle & Circle
static const int ICC_SEPERATE = 4;
static const int ICC_CIRCUMSCRIBE = 3;
static const int ICC_INTERSECT = 2;
static const int ICC_INSCRIBE = 1;
static const int ICC_CONTAIN = 0;

struct Point{
  double x,y;
  Point(){}
  Point(double x,double y) :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 k){return Point(x*k,y*k);}
  Point operator/(double k){return Point(x/k,y/k);}
  double norm(){return x*x+y*y;}
  double abs(){return sqrt(norm());}

  bool operator < (const Point &p) const{
    return x!=p.x?x<p.x:y<p.y;
    //grid-point only
    //return !equals(x,p.x)?x<p.x:!equals(y,p.y)?y<p.y:0;
  }

  bool operator == (const Point &p) const{
    return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
  }
};

istream &operator >> (istream &is,Point &p){
  is>>p.x>>p.y;
  return is;
}

ostream &operator << (ostream &os,Point p){
  os<<fixed<<setprecision(9)<<p.x<<" "<<p.y;
  return os;
}

bool sort_x(Point a,Point b){
  return a.x!=b.x?a.x<b.x:a.y<b.y;
}

bool sort_y(Point a,Point b){
  return a.y!=b.y?a.y<b.y:a.x<b.x;
}

typedef Point Vector;
typedef vector<Point> Polygon;

struct Segment{
  Point p1,p2;
  Segment(){}
  Segment(Point p1, Point p2):p1(p1),p2(p2){}
};
typedef Segment Line;

istream &operator >> (istream &is,Segment &s){
  is>>s.p1>>s.p2;
  return is;
}

struct Circle{
  Point c;
  double r;
  Circle(){}
  Circle(Point c,double r):c(c),r(r){}
};

istream &operator >> (istream &is,Circle &c){
  is>>c.c>>c.r;
  return is;
}

double norm(Vector a){
  return a.x*a.x+a.y*a.y;
}
double abs(Vector a){
  return sqrt(norm(a));
}
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;
}

bool isOrthogonal(Vector a,Vector b){
  return equals(dot(a,b),0.0);
}

bool isOrthogonal(Point a1,Point a2,Point b1,Point b2){
  return isOrthogonal(a1-a2,b1-b2);
}

bool isOrthogonal(Segment s1,Segment s2){
  return equals(dot(s1.p2-s1.p1,s2.p2-s2.p1),0.0);
}

bool isParallel(Vector a,Vector b){
  return equals(cross(a,b),0.0);
}

bool isParallel(Point a1,Point a2,Point b1,Point b2){
  return isParallel(a1-a2,b1-b2);
}

bool isParallel(Segment s1,Segment s2){
  return equals(cross(s1.p2-s1.p1,s2.p2-s2.p1),0.0); 
}

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

Point reflect(Segment s,Point p){
  return p+(project(s,p)-p)*2.0;
}

double arg(Vector p){
  return atan2(p.y,p.x);
}

Vector polar(double a,double r){
  return Point(cos(r)*a,sin(r)*a);
}

int ccw(Point p0,Point p1,Point p2);
bool intersectSS(Point p1,Point p2,Point p3,Point p4);
bool intersectSS(Segment s1,Segment s2);
bool intersectPS(Polygon p,Segment l);
int intersectCC(Circle c1,Circle c2);
bool intersectSC(Segment s,Circle c);
double getDistanceLP(Line l,Point p);
double getDistanceSP(Segment s,Point p);
double getDistanceSS(Segment s1,Segment s2);
Point getCrossPointSS(Segment s1,Segment s2);
Point getCrossPointLL(Line l1,Line l2);
Polygon getCrossPointCL(Circle c,Line l);
Polygon getCrossPointCC(Circle c1,Circle c2);
int contains(Polygon g,Point p);
Polygon andrewScan(Polygon s);
Polygon convex_hull(Polygon ps);
double diameter(Polygon s);
bool isConvex(Polygon p);
double area(Polygon s);
Polygon convexCut(Polygon p,Line l);
Line bisector(Point p1,Point p2);
Vector translate(Vector v,double theta);
vector<Line> corner(Line l1,Line l2);

int ccw(Point p0,Point p1,Point p2){
  Vector a = p1-p0;
  Vector b = p2-p0;
  if(cross(a,b) > EPS) return CCW_COUNTER_CLOCKWISE;
  if(cross(a,b) < -EPS) return CCW_CLOCKWISE;
  if(dot(a,b) < -EPS) return CCW_ONLINE_BACK;
  if(a.norm()<b.norm()) return CCW_ONLINE_FRONT;
  return CCW_ON_SEGMENT;
}

bool intersectSS(Point p1,Point p2,Point p3,Point p4){
  return (ccw(p1,p2,p3)*ccw(p1,p2,p4) <= 0 &&
	  ccw(p3,p4,p1)*ccw(p3,p4,p2) <= 0 );
}

bool intersectSS(Segment s1,Segment s2){
  return intersectSS(s1.p1,s1.p2,s2.p1,s2.p2);
}

bool intersectPS(Polygon p,Segment l){
  int n=p.size();
  for(int i=0;i<n;i++)
    if(intersectSS(Segment(p[i],p[(i+1)%n]),l)) return 1;
  return 0;
}

int intersectCC(Circle c1,Circle c2){
  if(c1.r<c2.r) swap(c1,c2);
  double d=abs(c1.c-c2.c);
  double r=c1.r+c2.r;
  if(equals(d,r)) return ICC_CIRCUMSCRIBE;
  if(d>r) return ICC_SEPERATE;
  if(equals(d+c2.r,c1.r)) return ICC_INSCRIBE;
  if(d+c2.r<c1.r) return ICC_CONTAIN;
  return ICC_INTERSECT;
}

bool intersectSC(Segment s,Circle c){
  double d=getDistanceSP(s,c.c);
  return d<=c.r;
}

double getDistanceLP(Line l,Point p){
  return abs(cross(l.p2-l.p1,p-l.p1)/abs(l.p2-l.p1));
}

double getDistanceSP(Segment s,Point p){
  if(dot(s.p2-s.p1,p-s.p1) < 0.0 ) return abs(p-s.p1);
  if(dot(s.p1-s.p2,p-s.p2) < 0.0 ) return abs(p-s.p2);
  return getDistanceLP(s,p);
}

double getDistanceSS(Segment s1,Segment s2){
  if(intersectSS(s1,s2)) return 0.0;
  return min(min(getDistanceSP(s1,s2.p1),getDistanceSP(s1,s2.p2)),
	     min(getDistanceSP(s2,s1.p1),getDistanceSP(s2,s1.p2)));
}

Point getCrossPointSS(Segment s1,Segment s2){
  Vector base=s2.p2-s2.p1;
  double d1=abs(cross(base,s1.p1-s2.p1));
  double d2=abs(cross(base,s1.p2-s2.p1));
  double t=d1/(d1+d2);
  return s1.p1+(s1.p2-s1.p1)*t;
}

Point getCrossPointLL(Line l1,Line l2){
  double a=cross(l1.p2-l1.p1,l2.p2-l2.p1);
  double b=cross(l1.p2-l1.p1,l1.p2-l2.p1);
  if(abs(a)<EPS&&abs(b)<EPS) return l2.p1;
  return l2.p1+(l2.p2-l2.p1)*(b/a);
}

Polygon getCrossPointCL(Circle c,Line l){
  Polygon p(2);
  Vector pr=project(l,c.c);
  Vector e=(l.p2-l.p1)/abs(l.p2-l.p1);
  double base=sqrt(c.r*c.r-norm(pr-c.c));
  p[0]=pr+e*base;
  p[1]=pr-e*base;
  return p;
}

Polygon getCrossPointCC(Circle c1,Circle c2){
  Polygon p(2);
  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);
  p[0]=c1.c+polar(c1.r,t+a);
  p[1]=c1.c+polar(c1.r,t-a);
  return p;
}

// IN:2 ON:1 OUT:0
int contains(Polygon g,Point p){
  int n=g.size();
  bool x=false;
  for(int i=0;i<n;i++){
    Point a=g[i]-p,b=g[(i+1)%n]-p;
    if(fabs(cross(a,b)) < EPS && dot(a,b) < EPS) return 1;
    if(a.y>b.y) swap(a,b);
    if(a.y < EPS && EPS < b.y && cross(a,b) > EPS ) x = !x;
  }
  return (x?2:0);
}

Polygon andrewScan(Polygon s){
  Polygon u,l;
  if(s.size()<3) return s;
  sort(s.begin(),s.end());
  u.push_back(s[0]);
  u.push_back(s[1]);
  l.push_back(s[s.size()-1]);
  l.push_back(s[s.size()-2]);
  for(int i=2;i<(int)s.size();i++){
    for(int n=u.size();n>=2&&ccw(u[n-2],u[n-1],s[i])!=CCW_CLOCKWISE;n--){
      u.pop_back();
    }
    u.push_back(s[i]);
  } 
  for(int i=s.size()-3;i>=0;i--){
    for(int n=l.size();n>=2&&ccw(l[n-2],l[n-1],s[i])!=CCW_CLOCKWISE;n--){
      l.pop_back();
    }
    l.push_back(s[i]);
  }
  reverse(l.begin(),l.end());
  for(int i=u.size()-2;i>=1;i--) l.push_back(u[i]);
  return l;
} 

Polygon convex_hull(Polygon ps){
  int n=ps.size();
  sort(ps.begin(),ps.end(),sort_y);
  int k=0;
  Polygon qs(n*2);
  for(int i=0;i<n;i++){
    while(k>1&&cross(qs[k-1]-qs[k-2],ps[i]-qs[k-1])<0) k--;
    qs[k++]=ps[i];
  }
  for(int i=n-2,t=k;i>=0;i--){
    while(k>t&&cross(qs[k-1]-qs[k-2],ps[i]-qs[k-1])<0) k--;
    qs[k++]=ps[i];
  }
  qs.resize(k-1);
  return qs;
}

double diameter(Polygon s){
  Polygon p=s;
  int n=p.size();
  if(n==2) return abs(p[0]-p[1]);
  int i=0,j=0;
  for(int k=0;k<n;k++){
    if(p[i]<p[k]) i=k;
    if(!(p[j]<p[k])) j=k;
  }
  double res=0;
  int si=i,sj=j;
  while(i!=sj||j!=si){
    res=max(res,abs(p[i]-p[j]));
    if(cross(p[(i+1)%n]-p[i],p[(j+1)%n]-p[j])<0.0){
      i=(i+1)%n;
    }else{
      j=(j+1)%n;
    }
  }
  return res;
}

bool isConvex(Polygon p){
  bool f=1;
  int n=p.size();
  for(int i=0;i<n;i++){
    int t=ccw(p[(i+n-1)%n],p[i],p[(i+1)%n]);
    f&=t!=CCW_CLOCKWISE;
  }
  return f;
}

double area(Polygon s){
  double res=0;
  for(int i=0;i<(int)s.size();i++){
    res+=cross(s[i],s[(i+1)%s.size()])/2.0;
  }
  return abs(res);
}
double area(Circle c1,Circle c2){
  double d=abs(c1.c-c2.c);
  if(c1.r+c2.r<=d+EPS) return 0;
  if(d<=abs(c1.r-c2.r)){
    double r=min(c1.r,c2.r);
    return PI*r*r;
  }
  double rc=(d*d+c1.r*c1.r-c2.r*c2.r)/(2*d);
  double th=acos(rc/c1.r);
  double ph=acos((d-rc)/c2.r);
  return c1.r*c1.r*th+c2.r*c2.r*ph-d*c1.r*sin(th);
}

Polygon convexCut(Polygon p,Line l){
  Polygon q;
  for(int i=0;i<(int)p.size();i++){
    Point a=p[i],b=p[(i+1)%p.size()];
    if(ccw(l.p1,l.p2,a)!=-1) q.push_back(a);
    if(ccw(l.p1,l.p2,a)*ccw(l.p1,l.p2,b)<0)
      q.push_back(getCrossPointLL(Line(a,b),l));
  }
  return q;
}

Line bisector(Point p1,Point p2){
  Circle c1=Circle(p1,abs(p1-p2)),c2=Circle(p2,abs(p1-p2));
  Polygon p=getCrossPointCC(c1,c2);
  if(cross(p2-p1,p[0]-p1)>0) swap(p[0],p[1]);
  return Line(p[0],p[1]);
}

Vector translate(Vector v,double theta){
  Vector res;
  res.x=cos(theta)*v.x-sin(theta)*v.y;
  res.y=sin(theta)*v.x+cos(theta)*v.y;
  return res;
}

vector<Line> corner(Line l1,Line l2){
  vector<Line> res;
  if(isParallel(l1,l2)){
    double d=getDistanceLP(l1,l2.p1)/2.0;
    Vector v1=l1.p2-l1.p1;
    v1=v1/v1.abs()*d;
    Point p=l2.p1+translate(v1,90.0*(PI/180.0));
    double d1=getDistanceLP(l1,p);
    double d2=getDistanceLP(l2,p);
    if(abs(d1-d2)>d){
      p=l2.p1+translate(v1,-90.0*(PI/180.0));
    }
    res.push_back(Line(p,p+v1));
  }else{
    Point p=getCrossPointLL(l1,l2);
    Vector v1=l1.p2-l1.p1,v2=l2.p2-l2.p1;
    v1=v1/v1.abs();
    v2=v2/v2.abs();
    res.push_back(Line(p,p+(v1+v2)));
    res.push_back(Line(p,p+translate(v1+v2,90.0*(PI/180.0))));
  }
  return res;
}

Polygon tangent(Circle c1,Point p2){
  Circle c2=Circle(p2,sqrt(norm(c1.c-p2)-c1.r*c1.r));
  Polygon p=getCrossPointCC(c1,c2);
  sort(p.begin(),p.end());
  return p;
}



signed main(){
  double uw,uh,a,b,ab;
  while(cin>>uw>>uh>>a>>b>>ab,uw!=0){
    Circle c1(Point(0,0),sqrt(a/PI));
    Circle c2(Point(0,0),sqrt(b/PI));
    bool f=0;
    if(c1.r<=c2.r) swap(c1,c2),f=1;
    double l=max(0.0,c1.r-c2.r),r=c1.r+c2.r+EPS;
    for(int k=0;k<100;k++){
      double m=(l+r)/2;
      c2.c.x=m;
      //cout<<area(c1,c2)<<endl;
      if(area(c1,c2)<=ab) r=m;
      else l=m;
    }
    c2.c.x=l;
    
    double EPS3=1e-4;
    assert(abs(area(c1,c2)-ab)<=EPS3);

    l=0,r=PI/2;
    for(int k=0;k<200;k++){
      double m=(l+r)/2;
      Circle t=c2;
      t.c=translate(c2.c,m);
      if(c1.r+max(c1.r,t.c.x+t.r)<=uw) r=m;
      else l=m;
    }
    c2.c=translate(c2.c,r);
    //cout<<c1.c<<"/"<<c2.c<<endl;
    
    Vector v(c1.r,c1.r);
    c1.c=c1.c+v;
    c2.c=c2.c+v;
    
    //cout<<c1.c<<"/"<<c2.c<<endl;

    if(f) swap(c1,c2);
    f=1;
    f&=(c1.c.x-c1.r>=-EPS3);
    f&=(c1.c.x+c1.r<=uw+EPS3);
    f&=(c1.c.y-c1.r>=-EPS3);
    f&=(c1.c.y+c1.r<=uh+EPS3);
    f&=(c2.c.x-c2.r>=-EPS3);
    f&=(c2.c.x+c2.r<=uw+EPS3);
    f&=(c2.c.y-c2.r>=-EPS3);
    f&=(c2.c.y+c2.r<=uh+EPS3);
    if(f) cout<<c1.c<<" "<<c1.r<<" "<<c2.c<<" "<<c2.r<<endl;
    else cout<<"impossible"<<endl;
    //else cout<<c1.c<<" "<<c1.r<<"/"<<c2.c<<" "<<c2.r<<endl;
  }
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3668
final_rank: 6

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/
typedef long double ld;
const ld PI = acos(-1.0);
bool eq(ld a, ld b) { return abs(a - b) < EPS; }
typedef complex<ld> Point;
typedef vector<Point> Polygon;

namespace std
{
	bool operator < (const Point& a, const Point& b)
	{
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}

struct Line
{
	Point a, b;
	Line(Point p, Point q) :a(p), b(q) {};
	Line(ld x1, ld y1, ld x2, ld y2) :a(Point(x1, y1)), b(Point(x2, y2)) {};
};

struct Circle
{
	Point p; ld r;
	Circle(Point a, ld b) :p(a), r(b) {};
};

ld dot(Point a, Point b)
{
	return real(conj(a)*b);
}

ld cross(Point a, Point b)
{
	return imag(conj(a)*b);
}

int ccw(Point a, Point b, Point c)
{
	b -= a; c -= a;
	if (cross(b, c) > EPS) return 1;    //counter cloclwise
	if (cross(b, c) < -EPS) return -1;  //cloclwise
	if (dot(b, c) < 0) return 2;        //c--a--b on line 
	if (norm(b) < norm(c)) return -2;   //a--b--c on line
	return 0;                           //a--c--b on line
}

bool isis_ll(Line l, Line m)
{
	return abs(cross(l.b - l.a, m.b - m.a)) > EPS;
}

bool isis_ls(Line l, Line s)
{
	return cross(l.b - l.a, s.a - l.a)*cross(l.b - l.a, s.b - l.a) < EPS;
}

bool isis_ss(Line s, Line t)
{
	return (ccw(s.a, s.b, t.a)*ccw(s.a, s.b, t.b) <= 0 &&
		ccw(t.a, t.b, s.a)*ccw(t.a, t.b, s.b) <= 0);
}

bool isis_lp(Line l, Point p)
{
	return (abs(cross(l.b - p, l.a - p)) < EPS);
}

bool isis_sp(Line s, Point p)
{
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a)) < EPS;
}

Point projection(Line l, Point p)
{
	Point base = l.b - l.a;
	ld r = dot(p - l.a, base) / norm(base);
	return l.a + base*r;
}

Point mirror(Line l, Point p)
{
	return Point(2, 0)*projection(l, p) - p;
}

ld dist_lp(Line l, Point p)
{
	return abs(p - projection(l, p));
}

ld dist_ll(Line l, Line m)
{
	return isis_ll(l, m) ? 0 : dist_lp(l, m.a);
}

ld dist_ls(Line l, Line s)
{
	if (isis_ls(l, s)) return 0;
	return min(dist_lp(l, s.a), dist_lp(l, s.b));
}

ld dist_sp(Line s, Point p)
{
	Point r = projection(s, p);
	if (isis_sp(s, r)) return abs(r - p);
	return min(abs(s.a - p), abs(s.b - p));
}

ld dist_ss(Line s, Line t)
{
	if (isis_ss(s, t)) return 0;
	return min(min(dist_sp(s, t.a), dist_sp(s, t.b)), min(dist_sp(t, s.a), dist_sp(t, s.b)));
}

Point is_ll(Line s, Line t)
{
	ld a = cross(s.b - s.a, t.b - t.a);
	ld b = cross(s.b - s.a, s.b - t.a);
	return t.a + b / a*(t.b - t.a);
}

vector<Point> is_cc(Circle c1, Circle c2)
{
	vector<Point> res;
	ld d = abs(c1.p - c2.p);
	ld rc = (d*d + pow(c1.r, 2) - pow(c2.r, 2)) / (2 * d);
	ld dfr = pow(c1.r, 2) - rc*rc;
	if (abs(dfr) < EPS) dfr = 0;
	if (dfr < 0.0) return res;
	ld rs = sqrt(dfr);
	Point diff = (c2.p - c1.p) / d;
	res.push_back(c1.p + diff*Point(rc, rs));
	if (dfr != 0.0) res.push_back(c1.p + diff*Point(rc, -rs));
	return res;
}

int isis_cc(Circle c1, Circle c2)
{
	ld d = abs(c1.p - c2.p);
	if (d - c1.r - c2.r > EPS) return -2; //separate
	if (abs(d - c1.r - c2.r) < EPS) return -1; //circumscribe
	if (c1.r < c2.r) swap(c1, c2);
	if (abs(d - c1.r + c2.r) < EPS) return 1;//inscribe
	if (c1.r - d - c2.r > EPS) return 2;//involve
	else return 0;//intersect
}

bool isis_cl(Circle c, Line l)
{
	ld d = dist_lp(l, c.p);
	return d - c.r < -EPS;
}

vector<Point> is_cl(Circle c, Line l)
{
	vector<Point> res;
	ld d = dist_lp(l, c.p);
	if (d > c.r + EPS) return res;
	ld len = (d > c.r) ? 0 : sqrt(c.r*c.r - d*d);
	Point nor = (l.a - l.b) / abs(l.a - l.b);
	res.push_back(projection(l, c.p) + len*nor);
	if (abs(len) > EPS) res.push_back(projection(l, c.p - len*nor));
	return res;
}

vector<Point> is_cs(Circle c, Line s)
{
	vector<Point> v = is_cl(c, s), res;
	REP(i, v.size())
	{
		if (ccw(s.a, v[i], s.b) == -2) res.push_back(v[i]);
	}
	return res;
}

vector<Line> tangent_cp(Circle c, Point p)
{
	vector<Line> res;
	Point v = c.p - p;
	ld d = abs(v);
	ld l = sqrt(norm(v) - c.r * c.r);
	if (isnan(l)) { return res; }
	Point v1 = v * Point(l / d, c.r / d);
	Point v2 = v * Point(l / d, -c.r / d);
	res.push_back(Line(p, p + v1));
	if (l < EPS) return res;
	res.push_back(Line(p, p + v2));
	return res;
}

vector<Line> tangent_cc(Circle c1, Circle c2)
{
	vector<Line> res;
	if (abs(c1.p - c2.p) - (c1.r + c2.r) > -EPS)
	{
		Point center = (c1.p * c2.r + c2.p * c1.r) / (c1.r + c2.r);
		res = tangent_cp(c1, center);
	}
	if (abs(c1.r - c2.r) > EPS)
	{
		Point out = (-c1.p * c2.r + c2.p * c1.r) / (c1.r - c2.r);
		vector<Line> nres = tangent_cp(c1, out);
		res.insert(res.end(), nres.begin(), nres.end());
	}
	else
	{
		Point v = c2.p - c1.p; v /= abs(v);
		Point q1 = c1.p + v * Point(0, 1) * c1.r;
		Point q2 = c1.p + v * Point(0, -1) * c1.r;
		res.push_back(Line(q1, q1 + v));
		res.push_back(Line(q2, q2 + v));
	}
	return res;
}

ld tri_area(Point a, Point b)
{
	ld r = abs(a);
	ld res = 0.5 * sqrt(pow(r, 4) - pow(dot(a, b), 2));
	return res;
}

ld fan_area(Point a, Point b)
{
	ld r = abs(a);
	ld cos = dot(a, b) / (abs(a) * abs(b));
	ld theta = acos(cos);
	ld res = r*r*theta;
	return res;
}

bool check(Point a, Point b)
{
	ld cos = dot(a, b) / (abs(a) * abs(b));
	return cos > 0;
}

ld area(ld ra, ld rb, ld d)
{
	Point pa(0, 0), pb(0, d);
	Circle a(pa, ra), b(pb, rb);
	if (isis_cc(a, b) < 0) return 0;
	else if (isis_cc(a, b) > 0) return pow(min(ra, rb), 2)* PI;

	vector<Point> ps = is_cc(a, b);
	ld area1 = fan_area(ps[0] - pa, pb - pa) - (check(ps[0] - pa, pb - pa) ? 1 : -1)*tri_area(ps[0] - pa, ps[1] - pa);
	ld area2 = fan_area(ps[0] - pb, pa - pb) - (check(ps[0] - pb, pa - pb) ? 1 : -1)*tri_area(ps[0] - pb, ps[1] - pb);
	ld res = area1 + area2;
	return res;
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	ld w, h, a, b, ab;
	while (cin >> w >> h >> a >> b >> ab, w)
	{
		if (ab - min(a,b) > EPS)
		{
			cout << "impossible" << endl;
			continue;
		}
		ld ra = sqrt(a / PI), rb = sqrt(b / PI);
		ld lb = 0, ub = ra + rb + 0.0001;
		REP(i, 100)
		{
			ld dist = (lb + ub) / 2.0;
			ld s = area(ra, rb, dist);
			if (s - ab > -EPS) lb = dist;
			else ub = dist;
		}
		ld dist = lb;
		Point pa(ra, ra), pb(w - rb, h - rb);
		if (dist - abs(pa - pb) > EPS)
		{
			cout << "impossible" << endl;
			continue;
		}
		if (ra > rb)
		{
			Point t = (pb - pa) / abs(pa - pb);
			pb = pa + t * dist;
		}
		else
		{
			Point t = (pa - pb) / abs(pa - pb);
			pa = pb + t * dist;
		}
		if (pa.real() + ra - w > EPS || pa.real() - ra < -EPS || pa.imag() + ra - h > EPS || pa.imag() - ra < -EPS ||
			pb.real() + rb - w > EPS || pb.real() - rb < -EPS || pb.imag() + rb - h > EPS || pb.imag() - rb < -EPS)
		{
			cout << "impossible" << endl;
			continue;
		}
		cout << pa.real() << " " << pa.imag() << " " << ra << " ";
		cout << pb.real() << " " << pb.imag() << " " << rb << endl;
		/*
		cout << ab << " " << area(ra, rb, dist) << endl;
		assert(abs(abs(pa - pb) - dist) < EPS);
		assert(abs(ab - area(ra, rb, dist)) < EPS);
		*/
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3484
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPE(i, a, b) for(int i = (a); i <= int(b); ++i)
#define DB(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define BR putchar('\n')
#define MS0(ar) memset(ar, 0, sizeof(ar))
#define MS1(ar) memset(ar, -1, sizeof(ar))
#define F first
#define S second
#define MP make_pair
#define MT make_tuple

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> PII;
typedef complex<double> CD;

void R(int &x) { scanf("%d", &x); }
void R(LL &x) { scanf("%lld", &x); }
void R(ULL &x) { scanf("%llu", &x); }
void R(double &x) { scanf("%lf", &x); }
void R(LD &x) { scanf("%Lf", &x); }

template<typename T>
void R(T &t) { cin >> t; }
template<typename T>
void R(vector<T> &ar) { for(auto &it : ar) R(it); }

template<typename T, typename... Args>
void R(T &t, Args&... args) {
	R(t);
	R(args...);
}

void W(const char &c) { putchar(c); };
void W(const int &x) { printf("%d", x); }
void W(const LL &x) { printf("%lld", x); }
void W(const ULL &x) { printf("%llu", x); }
void W(const double &x) { printf("%lf", x); }
void W(const LD &x) { printf("%Lf", x); }

template<typename T>
void W(const T &t) { cout << t; }
template<typename T>
void W(const vector<T> &ar) {
	for(size_t i = 0; i < ar.size(); ++i) {
		W(ar[i]);
		putchar(" \n"[i + 1u == ar.size()]);
	}
}
template<typename T, typename... Args>
void W(const T &t, const Args&... args) {
	W(t);
	W(args...);
}

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int maxn = 100010;
const double eps = 1e-8;

const double pi = acos(-1);

double a,b,c;

double ff(double a, double r) {
  if (a > r) return 0;
  return sqrt(r * r - a * a) * 2;
}
double F(double x) {
  return min(ff(fabs(x), a), ff(fabs(x - c), b));
}

double simpson(double a, double b) {
  double c = a + (b - a) / 2;
  return (F(a) + 4 * F(c) + F(b)) * (b - a) / 6;
}
double asr(double a, double b, double eps, double A) {
  double c = a + (b - a) / 2;
  double L = simpson(a, c), R = simpson(c, b);
  if (fabs(L + R - A) <= 15 * eps)
    return L + R + (L + R - A) / 15.0;
  return asr(a, c, eps / 2, L) + asr(c, b, eps / 2, R);
}
double asr(double a, double b, double eps) {
  return asr(a, b, eps, simpson(a, b));
}

double f(double R, double r, double d) {
  a = R, b = r, c = d;
  return asr(max(-R, d - r), min(d + r, R), eps);
}

int main() {
	int w, h, a, b, ab;
  while (scanf("%d%d%d%d%d", &w, &h, &a, &b, &ab) == 5) {
    if (!w && !h && !a && !b && !ab)
      break;
    bool fg = false;
    if (a < b) { swap(a, b); fg = true; }
    double ra = sqrt(a / pi);
    double rb = sqrt(b / pi);
    if (ra * 2 > h + eps || rb * 2 > h + eps || ra * 2 > w + eps || rb * 2 > w + eps) {
      puts("impossible");
      continue;
    }
    double l = 0, r = w - ra - rb;
    while (r - l > 1e-9) {
      double m = (l + r) / 2;
      double area = f(ra, rb, m);
      if (area >= ab) {
        l = m;
      }
      else {
        r = m;
      }
    }
    double dx = l;
    l = 0, r = h - ra - rb;
    while (r - l > 1e-9) {
      double m = (l + r) / 2;
      double area = f(ra, rb, hypot(dx, m));
      if (area >= ab) {
        l = m;
      }
      else {
        r = m;
      }
    }
    double dy = l;

    double area = f(ra, rb, hypot(dx, dy));
    if (fabs(area - ab) > 1e-6) {
      puts("impossible");
      continue;
    }
    double xa = ra, ya = ra;
    double xb = xa + dx, yb = ya + dy;
    if (fg) {
      swap(a, b);
      swap(xa, xb);
      swap(ya, yb);
      swap(ra, rb);
    }
    printf("%.9f %.9f %.9f %.9f %.9f %.9f\n", xa, ya, ra, xb, yb, rb);
  }
  return 0;
}
accuracy: 1
time_ms: 380
memory_kb: 3172
final_rank: 14

code_snippet: #include<bits/stdc++.h>
using namespace std;
typedef long double ldouble;

typedef complex<ldouble> P;
ldouble cross(P a,P b){ return imag(b*conj(a)); }
ldouble dot(P a,P b){ return real(b*conj(a)); }
ldouble Arg(P a,P b){ return arg(b*conj(a)); }

ldouble eps=1e-8;
ldouble PI=acos(-1.0);

bool eq(ldouble a, ldouble b){
  return (-eps < a-b && a-b < eps );
}

ldouble Sqrt(ldouble x){
  return sqrt( abs(x) );
}
  
struct S{
  P p,q;
  S(P p,P q):p(p),q(q){}
};
  
struct C{
  P p;
  ldouble r;
  C(P p,ldouble r):p(p),r(r){}
  C(ldouble x,ldouble y,ldouble r):p(P(x,y)),r(r){}
};
//28.983094894 28.983094894 28.983094894 32.013426145 61.883234457 25.958852614
//59 99 2639 2117 670

vector<P> intersect(C a,C b){
  vector<P> res;
  P base=b.p-a.p;
  
  ldouble dist=abs(base);
  if(dist>a.r+b.r+eps)return res;
  if(dist<abs(a.r-b.r)-eps)return res;
  
  ldouble ca = (a.r*a.r+dist*dist-b.r*b.r) / (2.0*a.r*dist);
  ldouble sa = Sqrt(1.0-ca*ca);
  
  P fi=a.p+base/dist*a.r*P(ca,sa);
  P se=a.p+base/dist*a.r*P(ca,-sa);
  
  res.push_back(fi);
  res.push_back(se);
  return res;
}


ldouble intersectArea(C a,C b){
  ldouble dist=abs(a.p-b.p);
  if(dist>a.r+b.r+eps)return 0;
  if(dist<abs(a.r-b.r)+eps)return min(a.r*a.r,b.r*b.r)*PI;
  vector<P> v=intersect(a,b);

  if(v.size()<2)return 0;
  
  ldouble sa=0,sb=0;
  sa=a.r*a.r*PI*abs(Arg(v[0]-a.p,v[1]-a.p))/(2.0*PI);
  sa-=abs( cross(v[0]-a.p,v[1]-a.p))/2.0;

  sb=b.r*b.r*PI*abs(Arg(v[0]-b.p,v[1]-b.p))/(2.0*PI);
  sb-=abs( cross(v[0]-b.p,v[1]-b.p))/2.0;
  
  if( dot(b.p-a.p,v[0]-a.p) < 0 ){
    sa=a.r*a.r*PI-sa;
  }
  if( dot(a.p-b.p,v[0]-b.p) < 0 ){
    sb=b.r*b.r*PI-sb;
  }
  
  return sa+sb;
}
  
  
int main(){
  /*
  double px,py,pr;
  cin>>px>>py>>pr;
  C ca=C(px,py,pr);
  cin>>px>>py>>pr;
  C cb=C(px,py,pr);
  cout<< (double)abs(ca.p-cb.p) <<endl;
  cout<<(double)intersectArea(ca,cb) <<endl;
  */
  while(1){
    ldouble H,W;
    ldouble A,B,AB;
    cin>>W>>H>>A>>B>>AB;
    if(H==0&&W==0)break;

    bool flg=false;
    if(A<B){
      flg=true;
      swap(A,B);
    }
    
    ldouble ar= sqrt(A/PI);
    ldouble br= sqrt(B/PI);

    if( max(ar,br) * 2 > min(H,W) + eps ){
      cout<<"impossible"<<endl;
      continue;
    }
    
    ldouble L=abs(ar-br),R=ar+br,M;

    assert( eq(0, intersectArea( C(0,0,ar) , C(R,0,br) ) ) );
    assert( eq( br*br*PI , intersectArea( C(0,0,ar) , C(L,0,br) ) ) );
    for(int i=0;i<100;i++){
      M=(L+R)/2.0;
      ldouble val=intersectArea( C(0,0,ar) , C(M,0,br) );
      if(val <= AB+eps )R=M;
      else L=M;
    }


    P pa=P(ar,ar);
    P pb=P(W-br,H-br);
    if( eq(   AB , intersectArea( C(pa,ar) , C(pb,br) ) ) ){
      if(flg){
        swap(pa,pb);
        swap(ar,br);
      }
        
      printf("%.8f %.8f %.8f %.8f %.8f %.8f\n",
             (double)real(pa),(double)imag(pa),(double)ar,
             (double)real(pb),(double)imag(pb),(double)br);

      continue;
    }
    
    P base=pb-pa;
    base/=abs(base);
    base*=L;
    pb=pa+base;

    if( real(pb)+br < W+eps && imag(pb)+br < H+eps &&
        -eps < real(pb)-br  && imag(pb)-br > -eps ){

      if(flg){
        swap(pa,pb);
        swap(ar,br);
      }
        
      printf("%.8f %.8f %.8f %.8f %.8f %.8f\n",
             (double)real(pa),(double)imag(pa),(double)ar,
             (double)real(pb),(double)imag(pb),(double)br);
    }else{
      cout<<"impossible"<<endl;
    }

    
  }
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1308
final_rank: 1

code_snippet: #include<bits/stdc++.h>

#define EQ(a,b) (abs((a)-(b)) < EPS*10)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define sz size()
#define all(a) (a).begin(),(a).end()

using namespace std;
typedef long double D;
typedef complex<D> P;
typedef pair<P,D> C;

const D EPS = 1e-8;
const D PI = acos(-1);
inline D arg(D a,D b,D c){return acos( (b*b+c*c-a*a)/(2*b*c) );}

inline D area_cir(C c){return PI * c.sc * c.sc;}

inline D intersection_area(C a, C b){
  D d = abs(a.fs-b.fs);
  if(a.sc + b.sc < d + EPS)return 0;
  if(a.sc < b.sc)swap(a,b);
  if(b.sc + d  < a.sc + EPS || b.sc < EPS)return area_cir(b);

  D t1 = arg(b.sc,a.sc,d), t2 = arg(a.sc,b.sc,d);
  D tri = ( a.sc*a.sc*sin(t1*2) + b.sc*b.sc*sin(t2*2) )/2.0;
  return a.sc*a.sc*t1 + b.sc*b.sc*t2 - tri;
}

int main(){
  D w,h,A,B,AB;
  cout << fixed << setprecision(9);
  while(cin >> w >> h >> A >> B >> AB, w!=0){

    D ar = sqrt(A/PI), br = sqrt(B/PI);
    bool change = ar<br;
    if(change){
      swap(ar,br);
    }

    C a = C(P(ar,ar),ar), b;
    
    P l = P(br,br), r = P(w-br,h-br);
    for(int azu=0;azu<300;azu++){
      P m = 0.5L*(l+r);
      b = C(m,br);
      if(intersection_area(a,b) < AB - EPS)r = m;
      else l = m;
    }

    b = C(l,br);
    if(w+EPS<ar*2 || h+EPS<ar*2 || l.real()-br<-EPS || l.imag()-br<-EPS || w+EPS<l.real()+br || h+EPS<l.imag()+br){
      cout << "impossible" << endl;
    }else if(!EQ(intersection_area(a,b),AB)){
      cout << "impossible" << endl;
    }else{
      if(change){
	swap(a,b);
      }

      cout << a.fs.real() << " " << a.fs.imag() << " " << a.sc << " "
	   << b.fs.real() << " " << b.fs.imag() << " " << b.sc << endl;
    }
  }
}
accuracy: 1
time_ms: 30
memory_kb: 3512
final_rank: 8

code_snippet: #include<iostream>
#include<cmath>

using namespace std;

double bx,by;
double ra,rb;

double integ(double r,double a){
  return r*r*(acos(0)-asin(a/r)-.5*sin(2*asin(a/r)));
}

double f(double y,double x){
  double X=hypot(y-by,x-bx);
  if(X>ra+rb)return 0;
  if(X+ra<=rb)return ra*ra*acos(0)*2;
  return integ(ra,(X*X+ra*ra-rb*rb)/2/X)+integ(rb,(X*X+rb*rb-ra*ra)/2/X);
}

int main(){
  for(int UW,UH,A,B,ACAPB;cin>>UW>>UH>>A>>B>>ACAPB,UW|UH|A|B|ACAPB;){
    bool rev=false;
    if(A>B){
      rev=true;
      swap(A,B);
    }
    ra=sqrt(A/acos(0)/2),rb=sqrt(B/acos(0)/2);
    if(2*rb>min(UW,UH))goto fail;
    cout.precision(9);
    if(A==ACAPB){
      cout<<fixed<<rb<<' '<<rb<<' '<<(rev?rb:ra)<<' '<<rb<<' '<<rb<<' '<<(rev?ra:rb)<<endl;
    }else{
      bx=UW-rb,by=UH-rb;
      double lax=ra,lay=ra;
      if(f(lay,lax)>ACAPB)goto fail;
      {
	double hax=bx,hay=by;
	for(int i=0;i<10000;i++){
	  double mdax=(lax+hax)/2,mday=(lay+hay)/2;
	  if(f(mday,mdax)>ACAPB){
	    hax=mdax;
	    hay=mday;
	  }else{
	    lax=mdax;
	    lay=mday;
	  }
	}
	if(!rev){
	  cout<<fixed<<lax<<' '<<lay<<' '<<ra<<' '<<bx<<' '<<by<<' '<<rb<<endl;
	}else{
	  cout<<fixed<<bx<<' '<<by<<' '<<rb<<' '<<lax<<' '<<lay<<' '<<ra<<endl;
	}
      }
    }
    continue;
  fail:
    cout<<"impossible"<<endl;
  }
}
accuracy: 1
time_ms: 70
memory_kb: 1328
final_rank: 7

code_snippet: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long double ld;
const ld pi=3.1415926535897932384626, eps=1e-9;
int main(){
	cout << setprecision(9);
	while(true){
		ld w,h,a,b,ab,a_c,b_c;
		cin >> w >> h >> a >> b >> ab;
		if(w<eps) break;
		a_c=a;b_c=b;
		if(a>b) swap(a,b);
		ld ra=sqrt(a/pi);
		ld rb=sqrt(b/pi);
		ld ub=pi,lb=0;
		int cnt=0;
		ld mid,phi;
		while(cnt<80){
			cnt++;
			mid=(ub+lb)/2;
			phi=asin( ra*sin(mid)/rb );
			if(ra*ra*mid-ra*ra*cos(mid)*sin(mid)+rb*rb*phi-rb*rb*cos(phi)*sin(phi)>ab) ub=mid;
			else lb=mid;
		}
		ld dis=ra*cos(mid)+rb*cos(phi);
		if(2*rb>h || 2*rb>w){
			cout << "impossible" << endl;
			continue;
		}
		if(h-ra-rb>=dis){
			if(a_c<b_c) cout << rb << " " << rb+dis << " " << ra << " " << rb << " " << rb << " " << rb << endl;
			else 		cout << rb << " " << rb << " " << rb << " " << rb << " " << rb+dis << " " << ra << endl;
			continue;
		}
		ld theta=asin( (h-ra-rb)/dis );			//(0<=()<=1   0<=theta<=pi/2)
		if(ra+rb+dis*cos(theta)>w){
			cout << "impossible" << endl;
			continue;
		}
		if(a_c<b_c) cout << rb+dis*cos(theta) << " " << h-ra << " " << ra << " " << rb << " " << rb << " " << rb << endl;
		else 		cout << rb << " " << rb << " " << rb << " " << rb+dis*cos(theta) << " " << h-ra << " " << ra << endl;
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1308
final_rank: 1

code_snippet: #include<iostream>
#include<iomanip>
#include<complex>
#include<vector>
#include<algorithm>
#include<cmath>

#define EQ(a,b) (abs((a)-(b)) < EPS)
#define fs first
#define sc second

using namespace std;
typedef long double D;
typedef complex<D> P;
typedef pair<P,P> L;
typedef pair<P,D> C;

const double EPS = 1e-9;
const double PI = acos(-1);

D arg(D a,D b,D c){return acos( (b*b+c*c-a*a)/(2*b*c) );}

D area_cir(C c){return PI * c.sc * c.sc;}

D intersection_area(C a, C b){
  D d = abs(a.fs-b.fs);
  D ar = a.sc, br = b.sc;
  if(a.sc + b.sc < d + EPS)return 0;
  if(a.sc < b.sc)swap(a,b);
  if(b.sc + d  < a.sc + EPS || b.sc < EPS)return area_cir(b);

  D t1 = arg(b.sc,a.sc,d), t2 = arg(a.sc,b.sc,d);
  D tri = ( a.sc*a.sc*sin(t1*2) + b.sc*b.sc*sin(t2*2) )/2.0;
  return a.sc*a.sc*t1 + b.sc*b.sc*t2 - tri;
}

int main(){
  D Uh,Uw,a,b,ab;
 
  while(cin >> Uw >> Uh >> a >> b >> ab, Uh!=0){
    D rA = sqrt(a/PI), rB = sqrt(b/PI);

    D minlen = min(Uh,Uw);
    if(minlen+EPS<2*rA || minlen+EPS<2*rB){
      cout << "impossible" << endl;
      continue;
    }

    P l = P(rA,rA), r = P(Uw-rB,Uh-rB);
    if(rA < rB){
      l = P(rB,rB); r = P(Uw-rA,Uh-rA);
    }

    C A = C(l,max(rA,rB));
    
    for(int i=0;i<10000;i++){
      P mid = l+r; mid/=2;
      if(intersection_area(A,C(mid,min(rA,rB))) < ab)r = mid;
      else l = mid;
    }

    if(!EQ(intersection_area(A,C(l,min(rA,rB))),ab)){
      cout << "impossible" << endl;
      continue;
    }

    D xA = rA, yA = rA, xB = rB, yB = rB;
    if(rA<rB){
      xA = l.real(); yA = l.imag();
    }else{
      xB = l.real(); yB = l.imag();
    }

    cout << fixed << setprecision(9) << xA << " " << yA << " " << rA << " "
	 << xB << " " << yB << " " << rB << endl;
  }
}
accuracy: 1
time_ms: 210
memory_kb: 1312
final_rank: 12

code_snippet: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <climits>
#include <numeric>
#include <cstring>
#include <utility>
#include <bitset>
#include <ctime>
#include <cmath>
#include <complex>
#include <iomanip>
using namespace std;

typedef long long LL;
typedef pair<int,int> pii;
typedef vector<vector<int> > vvint;

typedef long double D;
typedef complex<D> P;
typedef const P &rP;

#define ALL(v) (v).begin(),(v).end()

const D EPS = 1e-9L;


D pi;

D dot(rP a, rP b){
	return real(a) * real(b) + imag(a) * imag(b);
}

D cross(rP a, rP b){
	return real(a) * imag(b) - imag(a) * real(b);
}

D sqtri(rP a, rP b, rP c){
	return cross(b - a, c - a) * 0.5;
}

vector<P> intrccl(rP p1, D r1, rP p2, D r2){
	vector<P> ret;
	D d = abs(p2 - p1);
	if(d < EPS){ return ret; }
	D phi = arg(p2 - p1);
	D ct = (d * d + r1 * r1 - r2 * r2) / (2.0 * d * r1);
	if(abs(ct) > 1.0){ return ret; }
	D theta = acos(ct);
	ret.resize(2);
	ret[0] = p1 + polar(r1, phi - theta);
	ret[1] = p1 + polar(r1, phi + theta);
	return ret;
}

D difangle(D a, D b){
	b = b - a + 4.0 * pi;
	while(b >= 2.0 * pi){ b -= 2.0 * pi; }
	return b;
}

D sqintr(D ra, D rb, D dist){
	P ptd(dist);

	if(ra < rb){ swap(ra, rb); }
	vector<P> intr = intrccl(P(), ra, ptd, rb);
	if(intr.empty()){
		if(dist < ra + rb - EPS){
			return rb * rb * pi;
		}
		return 0.0;
	}

	if(imag(intr[0]) > imag(intr[1])){
		swap(intr[0], intr[1]);
	}


	D da1 = difangle(arg(intr[0]), arg(intr[1]));
	D s1 = ra * ra * 0.5 * da1 - sqtri(P(), intr[0], intr[1]);
	D da2 = difangle(arg(intr[1] - ptd), arg(intr[0] - ptd));
	D s2 = rb * rb * 0.5 * da2 - sqtri(ptd, intr[1], intr[0]);

	return s1 + s2;
}


D w, h, sa, sb, sab;


void solve(){
	bool sw = false;
	if(sa < sb){
		swap(sa, sb);
		sw = true;
	}

	D ra = sqrt(sa / pi), rb = sqrt(sb / pi);

	if(ra * 2.0 > min(w, h)){
		cout << "impossible\n";
		return;
	}

	D left = max(ra - rb - 1e-6L, 0.0L), right = ra + rb + 1e-6L;
	for(int tm = 300; --tm; ){
		D mid = (left + right) * 0.5;
		D sq = sqintr(ra, rb, mid);
		if(sq > sab){
			left = mid;
		}
		else{
			right = mid;
		}
	}

	P pa(ra, ra);
	P u(w - ra - rb, h - ra - rb);
	if(norm(u) > EPS){
		u /= abs(u);
	}
	P pb = pa + u * left;

	if(real(pb) + rb > w || imag(pb) + rb > h){
		cout << "impossible\n";
		return;
	}
	
	if(sw){
		swap(pa, pb);
		swap(ra, rb);
	}
	cout << real(pa) << ' ' << imag(pa) << ' ' << ra << ' ';
	cout << real(pb) << ' ' << imag(pb) << ' ' << rb << endl;
}


int main(){
	pi = acos(-1.0L);
	cout << fixed << setprecision(15);
	cerr << fixed << setprecision(6);
	
	while(cin >> w >> h >> sa >> sb >> sab, w){
		solve();
	}
}
accuracy: 1
time_ms: 20
memory_kb: 1308
final_rank: 3