import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
class Ideone
{
public static double c_price(double p, double p1, double s1, double p2, double s2){
if(p1 == p2){ //if given solutions' concentrations are equal
return p1
== p
? Math.
min(s1, s2
) : 0; }
if(p1 == p || p2 == p){ //if some given concentration equals to needed
return p1 == p ? s1 : s2;
}
double a1 = (p-p1)/(p2-p1);
if(a1 > 1 || a1 < 0) return 0; //inconsistent data
double a2 = 1-a1;
return s1*a1 + s2*a2;
}
{
Scanner in
= new Scanner
(System.
in); double[] p = new double[3];
double[] s = new double[3];
for(int i = 0; i < 3; i++) p[i] = in.nextDouble();
double f_p = in.nextDouble();
for(int i = 0; i < 3; i++) s[i] = in.nextDouble();
double s12 = c_price(f_p, p[0], s[0], p[1], s[1]);
double s13 = c_price(f_p, p[0], s[0], p[2], s[2]);
double s23 = c_price(f_p, p[1], s[1], p[2], s[2]);
if(s[0] == 0 && s[1] == 0 && s[2] == 0)
System.
out.
println("Impossible"); else{
double min_price = s12;
if(s13
!= 0) min_price
= Math.
min(min_price, s13
); if(s23
!= 0) min_price
= Math.
min(min_price, s23
); System.
out.
printf("%.2f", min_price
); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLm1hdGguKjsKCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIGRvdWJsZSBjX3ByaWNlKGRvdWJsZSBwLCBkb3VibGUgcDEsIGRvdWJsZSBzMSwgZG91YmxlIHAyLCBkb3VibGUgczIpewoJCWlmKHAxID09IHAyKXsgLy9pZiBnaXZlbiBzb2x1dGlvbnMnIGNvbmNlbnRyYXRpb25zIGFyZSBlcXVhbAoJCQlyZXR1cm4gcDEgPT0gcCA/IE1hdGgubWluKHMxLCBzMikgOiAwOwoJCX0KCQlpZihwMSA9PSBwIHx8IHAyID09IHApewkvL2lmIHNvbWUgZ2l2ZW4gY29uY2VudHJhdGlvbiBl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