#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int parent1[2], parent2[2], offspring[2];
// Input sifat dari kedua orang tua dan keturunan
for (int i = 0; i < 2; i++) {
cin >> parent1[i];
}
for (int i = 0; i < 2; i++) {
cin >> parent2[i];
}
for (int i = 0; i < 2; i++) {
cin >> offspring[i];
}
// Hitung kemungkinan fenotipe untuk tinggi dan jumlah anakan
int tall_count = 0; // Tinggi
int many_count = 0; // Jumlah anakan
// Menghitung rasio F1 untuk tinggi tanaman
if (parent1[0] == 2 && parent2[0] == 2) tall_count = 4; // TT x TT
else if (parent1[0] == 2 && parent2[0] == 1) tall_count = 3; // TT x Tt
else if (parent1[0] == 2 && parent2[0] == 0) tall_count = 2; // TT x tt
else if (parent1[0] == 1 && parent2[0] == 1) tall_count = 2; // Tt x Tt
else if (parent1[0] == 1 && parent2[0] == 0) tall_count = 1; // Tt x tt
else if (parent1[0] == 0 && parent2[0] == 0) tall_count = 0; // tt x tt
else if (parent1[0] == 0 && parent2[0] == 1) tall_count = 1; // tt x Tt
else if (parent1[0] == 0 && parent2[0] == 2) tall_count = 2; // tt x TT
// Menghitung rasio F1 untuk jumlah anakan
if (parent1[1] == 2 && parent2[1] == 2) many_count = 4; // BB x BB
else if (parent1[1] == 2 && parent2[1] == 1) many_count = 3; // BB x Bb
else if (parent1[1] == 2 && parent2[1] == 0) many_count = 2; // BB x bb
else if (parent1[1] == 1 && parent2[1] == 1) many_count = 2; // Bb x Bb
else if (parent1[1] == 1 && parent2[1] == 0) many_count = 1; // Bb x bb
else if (parent1[1] == 0 && parent2[1] == 0) many_count = 0; // bb x bb
else if (parent1[1] == 0 && parent2[1] == 1) many_count = 1; // bb x Bb
else if (parent1[1] == 0 && parent2[1] == 2) many_count = 2; // bb x BB
// Total kemungkinan genotipe
int total_combinations = 16; // 4 (tinggi) * 4 (anakan)
// Menghitung kombinasi yang diinginkan
int successful_combinations = 0;
if ((offspring[0] == 0 && tall_count == 0) || (offspring[0] == 1 && tall_count > 0) || (offspring[0] == 2 && tall_count > 0)) {
successful_combinations += tall_count;
}
if ((offspring[1] == 0 && many_count == 0) || (offspring[1] == 1 && many_count > 0) || (offspring[1] == 2 && many_count > 0)) {
successful_combinations += many_count;
}
// Hitung persentase
double percentage = (double)successful_combinations / total_combinations * 100;
// Output persentase
cout << fixed << setprecision(2) << percentage << "%" << endl;
return 0;
}