#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define int long long
#define st first
#define nd second
#define rd third
#define FOR(i, a, b) for(int i =(a); i <=(b); ++i)
#define RE(i, n) FOR(i, 1, n)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define REP(i, n) for(int i = 0;i <(n); ++i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define __builtin_ctz __builtin_ctzll
#define __builtin_clz __builtin_clzll
#define __builtin_popcount __builtin_popcountll
using namespace std;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t) {
while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
#define next ____next
#define prev ____prev
#define left ____left
#define hash ____hash
typedef long long ll;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<pair<int, int> > VPII;
typedef vector<pair<ll, ll> > VPLL;
template<class C> void mini(C&a4, C b4){a4=min(a4, b4); }
template<class C> void maxi(C&a4, C b4){a4=max(a4, b4); }
template<class T1, class T2>
ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";}
template<class A, class B, class C> struct Triple { A first; B second; C third;
bool operator<(const Triple& t) const { if (st != t.st) return st < t.st; if (nd != t.nd) return nd < t.nd; return rd < t.rd; } };
template<class T> void ResizeVec(T&, vector<int>) {}
template<class T> void ResizeVec(vector<T>& vec, vector<int> sz) {
vec.resize(sz[0]); sz.erase(sz.begin()); if (sz.empty()) { return; }
for (T& v : vec) { ResizeVec(v, sz); }
}
typedef Triple<int, int, int> TIII;
template<class A, class B, class C>
ostream& operator<< (ostream &out, Triple<A, B, C> t) { return out << "(" << t.st << ", " << t.nd << ", " << t.rd << ")"; }
template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class T> ostream& operator<<(ostream& out, set<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
const LD kEps = 1e-9;
struct Point3 {
LD x, y, z;
Point3 operator+(Point3 a) { Point3 p{x + a.x, y + a.y, z + a.z}; return p; }
Point3 operator-(Point3 a) { Point3 p{x - a.x, y - a.y, z - a.z}; return p; }
Point3 operator*(LD a) { Point3 p{x * a, y * a, z * a}; return p; }
Point3 operator/(LD a) { assert(abs(a) > kEps); Point3 p{x / a, y / a, z / a}; return p; }
Point3& operator+=(Point3 a) { x += a.x; y += a.y; z += a.z; return *this; }
Point3& operator-=(Point3 a) { x -= a.x; y -= a.y; z -= a.z; return *this; }
Point3& operator*=(LD a) { x *= a; y *= a; z *= a; return *this;}
Point3& operator/=(LD a) { assert(abs(a) > kEps); x /= a; y /= a; z /= a; return *this; }
LD& operator[](int a) {
if (a == 0) { return x; }
if (a == 1) { return y; }
if (a == 2) { return z; }
assert(false);
}
};
LD Det(Point3 a, Point3 b, Point3 d) { // ok
Point3 pts[3] = {a, b, d};
LD res = 0;
for (int sign : {-1, 1}) {
REP (st_col, 3) {
int c = st_col;
LD prod = 1;
REP (r, 3) {
prod *= pts[r][c];
c = (c + sign + 3) % 3;
}
res += sign * prod;
}
}
return res;
}
LD Vol(Point3 A, Point3 B, Point3 C, Point3 D) {
return Det(B - A, C - A, D - A);
}
struct Sol {
void Test() {
VVI c(3, VI(5));
RE (i, 4) {
REP (tr, 3) {
if (!(cin>>c[tr][i])) { exit(0); }
}
}
REP (tr, 3) {
if (c[tr][1] > c[tr][2]) {
RE (i, 4) {
c[tr][i] *= -1;
}
}
if (c[tr][3] > c[tr][4]) { swap(c[tr][3], c[tr][4]); }
}
Point3 B = {c[0][2], c[1][1], c[2][1]};
Point3 C = {c[0][1], c[1][2], c[2][1]};
Point3 D = {c[0][1], c[1][1], c[2][2]};
LD res = 0;
FOR (xi, 3, 4) {
FOR (yi, 3, 4) {
FOR (zi, 3, 4) {
VI inds{xi, yi, zi};
int sign = 1;
REP (tr, 3) {
if (inds[tr] == 4) { sign *= -1; }
}
VI inter;
REP (tr, 3) {
inter.PB(max(c[tr][1], c[tr][inds[tr]]));
}
Point3 S = {inter[0], inter[1], inter[2]};
LD prod = sign;
LD V = Vol(S, B, C, D);
REP (tr, 3) {
S[tr]++;
LD Vs = Vol(S, B, C, D);
S[tr]--;
prod *= max((LD)0, V / (V - Vs));
}
res += prod / 6;
}
}
}
cout<<res<<"\n";
}
};
int32_t main() {
ios_base::sync_with_stdio(0);
cout << fixed << setprecision(10);
cerr << fixed << setprecision(10);
cin.tie(0);
//double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC;
while (1) {
Sol sol;
sol.Test();
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgTVAgbWFrZV9wYWlyCiNkZWZpbmUgUEIgcHVzaF9iYWNrCiNkZWZpbmUgaW50IGxvbmcgbG9uZwojZGVmaW5lIHN0IGZpcnN0CiNkZWZpbmUgbmQgc2Vjb25kCiNkZWZpbmUgcmQgdGhpcmQKI2RlZmluZSBGT1IoaSwgYSwgYikgZm9yKGludCBpID0oYSk7IGkgPD0oYik7ICsraSkKI2RlZmluZSBSRShpLCBuKSBGT1IoaSwgMSwgbikKI2RlZmluZSBGT1JEKGksIGEsIGIpIGZvcihpbnQgaSA9ICh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XR1cm4gKnRoaXM7IH0KICBMRCYgb3BlcmF0b3JbXShpbnQgYSkgewogICAgaWYgKGEgPT0gMCkgeyByZXR1cm4geDsgfQogICAgaWYgKGEgPT0gMSkgeyByZXR1cm4geTsgfQogICAgaWYgKGEgPT0gMikgeyByZXR1cm4gejsgfQogICAgYXNzZXJ0KGZhbHNlKTsKICB9Cn07CgpMRCBEZXQoUG9pbnQzIGEsIFBvaW50MyBiLCBQb2ludDMgZCkgeyAvLyBvawogIFBvaW50MyBwdHNbM10gPSB7YSwgYiwgZH07CiAgTEQgcmVzID0gMDsKICBmb3IgKGludCBzaWduIDogey0xLCAxfSkgewogICAgUkVQIChzdF9jb2wsIDMpIHsKICAgICAgaW50IGMgPSBzdF9jb2w7CiAgICAgIExEIHByb2QgPSAxOwogICAgICBSRVAgKHIsIDMpIHsKICAgICAgICBwcm9kICo9IHB0c1tyXVtjXTsKICAgICAgICBjID0gKGMgKyBzaWduICsgMykgJSAzOwogICAgICB9CiAgICAgIHJlcyArPSBzaWduICogcHJvZDsKICAgIH0KICB9CiAgcmV0dXJuIHJlczsKfQoKTEQgVm9sKFBvaW50MyBBLCBQb2ludDMgQiwgUG9pbnQzIEMsIFBvaW50MyBEKSB7CiAgcmV0dXJuIERldChCIC0gQSwgQyAtIEEsIEQgLSBBKTsKfQoKc3RydWN0IFNvbCB7CiAgdm9pZCBUZXN0KCkgewogICAgVlZJIGMoMywgVkkoNSkpOwogICAgUkUgKGksIDQpIHsKICAgICAgUkVQICh0ciwgMykgewogICAgICAgIGlmICghKGNpbj4+Y1t0cl1baV0pKSB7IGV4aXQoMCk7IH0KICAgICAgfQogICAgfQogICAgUkVQICh0ciwgMykgewogICAgICBpZiAoY1t0cl1bMV0gPiBjW3RyXVsyXSkgewogICAgICAgIFJFIChpLCA0KSB7CiAgICAgICAgICBjW3RyXVtpXSAqPSAtMTsKICAgICAgICB9CiAgICAgIH0KICAgICAgaWYgKGNbdHJdWzNdID4gY1t0cl1bNF0pIHsgc3dhcChjW3RyXVszXSwgY1t0cl1bNF0pOyB9CiAgICB9CiAgICBQb2ludDMgQiA9IHtjWzBdWzJdLCBjWzFdWzFdLCBjWzJdWzFdfTsKICAgIFBvaW50MyBDID0ge2NbMF1bMV0sIGNbMV1bMl0sIGNbMl1bMV19OwogICAgUG9pbnQzIEQgPSB7Y1swXVsxXSwgY1sxXVsxXSwgY1syXVsyXX07CiAgICBMRCByZXMgPSAwOwogICAgRk9SICh4aSwgMywgNCkgewogICAgICBGT1IgKHlpLCAzLCA0KSB7CiAgICAgICAgRk9SICh6aSwgMywgNCkgewogICAgICAgICAgVkkgaW5kc3t4aSwgeWksIHppfTsKICAgICAgICAgIGludCBzaWduID0gMTsKICAgICAgICAgIFJFUCAodHIsIDMpIHsKICAgICAgICAgICAgaWYgKGluZHNbdHJdID09IDQpIHsgc2lnbiAqPSAtMTsgfQogICAgICAgICAgfQogICAgICAgICAgVkkgaW50ZXI7CiAgICAgICAgICBSRVAgKHRyLCAzKSB7CiAgICAgICAgICAgIGludGVyLlBCKG1heChjW3RyXVsxXSwgY1t0cl1baW5kc1t0cl1dKSk7CiAgICAgICAgICB9CiAgICAgICAgICBQb2ludDMgUyA9IHtpbnRlclswXSwgaW50ZXJbMV0sIGludGVyWzJdfTsKICAgICAgICAgIExEIHByb2QgPSBzaWduOwogICAgICAgICAgTEQgViA9IFZvbChTLCBCLCBDLCBEKTsKICAgICAgICAgIFJFUCAodHIsIDMpIHsKICAgICAgICAgICAgU1t0cl0rKzsKICAgICAgICAgICAgTEQgVnMgPSBWb2woUywgQiwgQywgRCk7CiAgICAgICAgICAgIFNbdHJdLS07CiAgICAgICAgICAgIHByb2QgKj0gbWF4KChMRCkwLCBWIC8gKFYgLSBWcykpOwogICAgICAgICAgfQogICAgICAgICAgcmVzICs9IHByb2QgLyA2OwogICAgICAgIH0KICAgICAgfQogICAgfQogICAgY291dDw8cmVzPDwiXG4iOwogICAgICAgICAgCiAgfQp9OwppbnQzMl90IG1haW4oKSB7CgogIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7CiAgY291dCA8PCBmaXhlZCA8PCBzZXRwcmVjaXNpb24oMTApOwogIGNlcnIgPDwgZml4ZWQgPDwgc2V0cHJlY2lzaW9uKDEwKTsKICBjaW4udGllKDApOwogIC8vZG91YmxlIGJlZ19jbG9jayA9IDEuMCAqIGNsb2NrKCkgLyBDTE9DS1NfUEVSX1NFQzsKCiAgd2hpbGUgKDEpIHsKICAgIFNvbCBzb2w7CiAgICBzb2wuVGVzdCgpOwogIH0KCiAgCiAgcmV0dXJuIDA7Cn0K