#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
vector <long double> v;
long double a, average=0;
while(cin>>a){
average+=a;
v.push_back(a);
}
average/=v.size();
cout<<average<<'\n';
for(int i=0; i<v.size(); i++)cout<<abs(v[i]-average)<<' ';
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXZlY3RvciA8bG9uZyBkb3VibGU+IHY7Cglsb25nIGRvdWJsZSBhLCBhdmVyYWdlPTA7Cgl3aGlsZShjaW4+PmEpewoJCWF2ZXJhZ2UrPWE7CgkJdi5wdXNoX2JhY2soYSk7Cgl9CglhdmVyYWdlLz12LnNpemUoKTsKCWNvdXQ8PGF2ZXJhZ2U8PCdcbic7Cglmb3IoaW50IGk9MDsgaTx2LnNpemUoKTsgaSsrKWNvdXQ8PGFicyh2W2ldLWF2ZXJhZ2UpPDwnICc7CglyZXR1cm4gMDsKfQ==