#include <iostream>
#include <vector>
using namespace std;
int main() {
double a,b;
vector<double> c;
vector<double> d;
while(cin>>a && cin>>b){
c.push_back(a);
d.push_back(b);
}
for(int i=0;i<c.size();i++){
if(c[i]<0 && d[i]<0){
c[i]=c[i]+0.5;
d[i]=d[i]+0.5;
}
else if(c[i]<0 && d[i]>=0){
c[i]=c[i]*c[i];
}
else if(c[i]>=0 && d[i]<0){
d[i]=d[i]*d[i];
}
else {
c[i]=(c[i]+d[i])/2;
d[i]=c[i];
}
}
for(int i=0;i<c.size();i++){
cout<<c[i]<<" ";
}
cout<<endl;
for(int i=0;i<d.size();i++){
cout<<d[i]<<" ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cglkb3VibGUgYSxiOwoJdmVjdG9yPGRvdWJsZT4gYzsKCXZlY3Rvcjxkb3VibGU+IGQ7Cgl3aGlsZShjaW4+PmEgJiYgY2luPj5iKXsKCQljLnB1c2hfYmFjayhhKTsKCQlkLnB1c2hfYmFjayhiKTsKCX0KCWZvcihpbnQgaT0wO2k8Yy5zaXplKCk7aSsrKXsKCQlpZihjW2ldPDAgJiYgZFtpXTwwKXsKCQkJY1tpXT1jW2ldKzAuNTsKCQkJZFtpXT1kW2ldKzAuNTsKCQl9CgkJZWxzZSBpZihjW2ldPDAgJiYgZFtpXT49MCl7CgkJCWNbaV09Y1tpXSpjW2ldOwoJCX0KCQllbHNlIGlmKGNbaV0+PTAgJiYgZFtpXTwwKXsKCQkJZFtpXT1kW2ldKmRbaV07CgkJfQoJCWVsc2UgewoJCQljW2ldPShjW2ldK2RbaV0pLzI7CgkJCWRbaV09Y1tpXTsKCQl9Cgl9Cglmb3IoaW50IGk9MDtpPGMuc2l6ZSgpO2krKyl7CgkJY291dDw8Y1tpXTw8IiAiOwkKCX0KCWNvdXQ8PGVuZGw7Cglmb3IoaW50IGk9MDtpPGQuc2l6ZSgpO2krKyl7CgkJY291dDw8ZFtpXTw8IiAiOwoJfQoJcmV0dXJuIDA7Cn0=