#include <stdio.h>
int main()
{
double x[500];
double y[500];
double sx, sy, sxx, sxy;
double a, b;
int i, n;
for (i = 0; i < 500; i++) {
scanf("%lf%lf", &x[i], &y[i]);
if (x[i] == 0.0) break;
}
n = i;
sx = sy = sxx = sxy = 0;
for (i = 0; i < n; i++) {
sx += x[i];
sy += y[i];
sxx += x[i] * x[i];
sxy += x[i] * y[i];
}
a = (n * sxy - sx * sy) / (n * sxx - sx * sx);
b = (sxx * sy - sxy * sx) / (n * sxx - sx * sx);
printf("a=%f b=%f\n", a, b);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpCnsKCWRvdWJsZSB4WzUwMF07Cglkb3VibGUgeVs1MDBdOwoJZG91YmxlIHN4LCBzeSwgc3h4LCBzeHk7Cglkb3VibGUgYSwgYjsKCWludCBpLCBuOwoKCWZvciAoaSA9IDA7IGkgPCA1MDA7IGkrKykgewoJCXNjYW5mKCIlbGYlbGYiLCAmeFtpXSwgJnlbaV0pOwoJCWlmICh4W2ldID09IDAuMCkgYnJlYWs7Cgl9CgluID0gaTsKCXN4ID0gc3kgPSBzeHggPSBzeHkgPSAwOwoJZm9yIChpID0gMDsgaSA8IG47IGkrKykgewoJCXN4ICs9IHhbaV07CgkJc3kgKz0geVtpXTsKCQlzeHggKz0geFtpXSAqIHhbaV07CgkJc3h5ICs9IHhbaV0gKiB5W2ldOwoJfQoJYSA9IChuICogc3h5IC0gc3ggKiBzeSkgLyAobiAqIHN4eCAtIHN4ICogc3gpOwoJYiA9IChzeHggKiBzeSAtIHN4eSAqIHN4KSAvIChuICogc3h4IC0gc3ggKiBzeCk7CglwcmludGYoImE9JWYgYj0lZlxuIiwgYSwgYik7CglyZXR1cm4gMDsKfQo=