#include <vector>
#include <string>
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>

using namespace std;


int main()
{
    random_device rd;
    mt19937 g(rd());
    vector<int> v { 0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,100,100,100};
    unsigned long long total = 0, ok = 0;
    for(; total < 10000000;)
    {
        shuffle(v.begin(),v.end(),g);
        total++;
        int sum = v[0]+v[1]+v[2]+v[3]+v[4]+v[5];
        if (sum == 106)
        {
            sum = v[6]+v[7]+v[8]+v[9]+v[10]+v[11];
            if (sum == 106)
            {
                ok++;
            }
        }
    }
    cout << double(ok)/total << "\n";
}
