Problem

In this problem, a straight line passing through a certain point X and a certain point Y in the three-dimensional space is written as a straight line XY.

A cone and a point P inside the cone are given in three-dimensional space. Let point Q be the intersection of a straight line passing through point P and perpendicular to the bottom of the cone and the bottom of the cone. At this time, the center of the bottom surface of the cone is O, and the intersection of the straight line OQ and the circumference of the bottom surface of the cone is point A and point B from the side closer to point Q (however, point O and point Q are the same point). In the case of, let points A and B be the intersections of any straight line passing through point O and the circumference of the bottom of the cone.) Also, in a plane that includes the bottom surface of the cone, let points C and D be the intersections of the straight line that passes through point O and intersects the straight line AB perpendicularly with the circumference of the bottom surface of the cone (however, points C and D). Can be replaced).


The figure below is a view of the bottom surface of the cone as seen from the direction of the apex of the cone.

View of the bottom of the cone as seen from the apex of the cone


Let the intersection of the straight line AP and the cone of the straight line BP (in the case of the straight line AP, the intersection that is not the point A. The same applies to the straight line BP) be the point A'and the point B', and pass through the points A'and B'. Cut the cone at the plane S parallel to the straight line CD. At this time, output the volume of the figure including the vertices after cutting and the volume of the other figure separated by blanks.

Input

X coordinate y coordinate z coordinate of the apex of the cone
X coordinate y coordinate z coordinate of the center of the base of the cone Radius of the base of the cone
X coordinate y coordinate z coordinate of point P

Each value on each row is given separated by spaces.

Constraint

All input values ​​are integers, the absolute value of which is less than or equal to 1000.
The height of the cone and the radius of its base are greater than or equal to 1, and the distance between point P and the cone is greater than or equal to 10-5.

Output

Output the volume of the figure including the vertices after cutting and the volume of the other figure separated by blanks.
However, it must not contain an error greater than 10-5.

Sample Input 1


0 0 10
0 0 0 4
0 0 1


Sample Output 1


91.769438 75.782170


Sample Input 2


0 0 10
0 0 0 4
1 1 1


Sample Output 2


84.050413 83.501195


Sample Input 3


0 0 0
8 9 10 5
1 1 1


Sample Output 3


0.071663 409.709196






Example

Input

0 0 10
0 0 0 4
0 0 1


Output

91.769438 75.782170
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& p) {
  o << "(" << p.first << "," << p.second << ")";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (T t : v) {
    o << t << ",";
  }
  o << "]";
  return o;
}
const long double PI = acos(-1);
const long double EPS = 1e-5;
const long double INF = 1e9;
long double dot(complex<long double> a, complex<long double> b) {
  return a.real() * b.real() + a.imag() * b.imag();
}
long double cross(complex<long double> a, complex<long double> b) {
  return a.real() * b.imag() - a.imag() * b.real();
}
int ccw(complex<long double> a, complex<long double> b,
        complex<long double> c) {
  b -= a;
  c -= a;
  if (cross(b, c) > EPS) return +1;
  if (cross(b, c) < -EPS) return -1;
  if (dot(b, c) < -EPS) return +2;
  if (norm(b) < norm(c)) return -2;
  return 0;
}
complex<long double> proj(complex<long double> a1, complex<long double> a2,
                          complex<long double> p) {
  return a1 + dot(a2 - a1, p - a1) / norm(a2 - a1) * (a2 - a1);
}
long double distLP(complex<long double> a1, complex<long double> a2,
                   complex<long double> p) {
  return abs(proj(a1, a2, p) - p);
}
complex<long double> crosspointLL(complex<long double> a1,
                                  complex<long double> a2,
                                  complex<long double> b1,
                                  complex<long double> b2) {
  long double d1 = cross(b2 - b1, b1 - a1);
  long double d2 = cross(b2 - b1, a2 - a1);
  if ((abs((d1) - (0)) < EPS) && (abs((d2) - (0)) < EPS)) return a1;
  assert(!(abs((d2) - (0)) < EPS));
  return a1 + d1 / d2 * (a2 - a1);
}
struct P {
  long double x, y, z;
  P() {}
  P(long double _x, long double _y, long double _z) {
    x = _x;
    y = _y;
    z = _z;
  }
};
P READ() {
  int x, y, z;
  cin >> x >> y >> z;
  return P(x, y, z);
}
int main() {
  P top, c, p;
  int r;
  top = READ();
  c = READ();
  cin >> r;
  p = READ();
  top.x -= c.x;
  top.y -= c.y;
  top.z -= c.z;
  p.x -= c.x;
  p.y -= c.y;
  p.z -= c.z;
  c.x -= c.x;
  c.y -= c.y;
  c.z -= c.z;
  if (!(abs((abs(complex<long double>(top.x, top.y) -
                 complex<long double>(0, 0))) -
            (0)) < EPS)) {
    long double theta = acos(top.x / hypot(top.x, top.y));
    if (top.y < 0) theta = theta + 2 * (PI - theta);
    complex<long double> tmp =
        complex<long double>(p.x, p.y) * polar((long double)1.0, -theta);
    p.x = tmp.real();
    p.y = tmp.imag();
    tmp = complex<long double>(top.x, top.y) * polar((long double)1.0, -theta);
    top.x = tmp.real();
    top.y = tmp.imag();
  }
  if (top.z < 0) {
    top.z = -top.z;
    p.z = -p.z;
  }
  if (!(abs((top.x) - (0)) < EPS)) {
    long double tz = PI / 2 - acos(top.x / hypot(top.x, top.z));
    complex<long double> tmp =
        complex<long double>(p.x, p.z) * polar((long double)1.0, tz);
    p.x = tmp.real();
    p.z = tmp.imag();
    tmp = complex<long double>(top.x, top.z) * polar((long double)1.0, tz);
    top.x = tmp.real();
    top.z = tmp.imag();
  }
  if (!(abs((p.y) - (0)) < EPS)) {
    long double theta = acos(p.x / hypot(p.x, p.y));
    if (top.y < 0) theta = theta + 2 * (PI - theta);
    complex<long double> tmp =
        complex<long double>(p.x, p.y) * polar((long double)1.0, -theta);
    p.x = tmp.real();
    p.y = tmp.imag();
  }
  long double V = PI * r * r * top.z / 3;
  complex<long double> O(0, 0), A(r, 0), B(-r, 0), T(0, top.z), P(p.x, p.z);
  complex<long double> AA = crosspointLL(A, P, B, T);
  complex<long double> BB = crosspointLL(B, P, A, T);
  complex<long double> M = (AA + BB) * (long double)0.5;
  long double h = distLP(AA, BB, T);
  long double a = abs(AA - M);
  long double xx = r * (T.imag() - M.imag()) / T.imag();
  long double b = sqrt(xx * xx - M.real() * M.real());
  long double U = PI * a * b * h / 3;
  printf("%.10Lf %.10Lf\n", U, V - U);
  return 0;
}
