import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
static double LP(double x, double[] xv, double[] yv){
int size = xv.length;
double sum = 0;
for(int i = 0; i < size; i++){
double mul = 1;
for(int j = 0; j < size; j++){
if(i != j){
mul *= (x-xv[j])/(xv[i]-xv[j]);
}
}
sum += yv[i]*mul;
}
return sum;
}
static Scanner sc
= new Scanner
(System.
in);
{
int counter = 0;
double a = -3;
double b = 3;
int fragments = 101;
ArrayList<Double> xvinp = new ArrayList<Double>();
ArrayList<Double> yvinp = new ArrayList<Double>();
double[] xv;
double[] yv;
while(sc.hasNext()){
double inp = sc.nextDouble();
if(counter%2 == 0){
xvinp.add(inp);
}else{
yvinp.add(inp);
}
counter++;
}
xv = new double[xvinp.size()];
yv = new double[yvinp.size()];
for(int i = 0; i < xvinp.size(); i++){
xv[i] = xvinp.get(i);
yv[i] = yvinp.get(i);
}
for(int i = 0; i < fragments; i++){
double x = a + (b-a)/(fragments-1)*i;
System.
out.
println(x
+ "\t" + LP
(x, xv, yv
)); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCQoJc3RhdGljIGRvdWJsZSBMUChkb3VibGUgeCwgZG91YmxlW10geHYsIGRvdWJsZVtdIHl2KXsKCQlpbnQgc2l6ZSA9IHh2Lmxlbmd0aDsKCQlkb3VibGUgc3VtID0gMDsKCQlmb3IoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKXsKCQkJZG91YmxlIG11bCA9IDE7CgkJCWZvcihpbnQgaiA9IDA7IGogPCBzaXplOyBqKyspewoJCQkJaWYoaSAhPSBqKXsKCQkJCQltdWwgKj0gKHgteHZbal0pLyh4dltpXS14dltqXSk7CgkJCQl9CgkJCX0KCQkJc3VtICs9IHl2W2ldKm11bDsKCQl9CgkJcmV0dXJuIHN1bTsKCX0KCQoJc3RhdGljIFNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5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