#include <iostream>
using namespace std;
struct okay {
double a,b;
};
int main() {
int numb;
cin>>numb;
okay x[numb];
for(int i=0;i<numb;i++){
cin>>x[i].a;
}
for(int i=0;i<numb;i++){
cin>>x[i].b;
}
for(int i=0;i<numb;i++){
if(x[i].a<0 && x[i].b<0){
x[i].a=x[i].a+0.5;
x[i].b=x[i].b+0.5;
}
else if(x[i].a<0 && x[i].b>=0){
x[i].a=x[i].a*x[i].a;
}
else if(x[i].a>=0 && x[i].b<0){
x[i].b=x[i].b*x[i].b;
}
else {
x[i].a=(x[i].a+x[i].b)/2;
x[i].b=x[i].a;
}
}
for(int i=0;i<numb;i++){
cout<<x[i].a<<" ";
}
cout<<endl;
for(int i=0;i<numb;i++){
cout<<x[i].b<<" ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpzdHJ1Y3Qgb2theSB7Cglkb3VibGUgYSxiOwp9OwppbnQgbWFpbigpIHsKCWludCBudW1iOwoJY2luPj5udW1iOwoJb2theSB4W251bWJdOwoJZm9yKGludCBpPTA7aTxudW1iO2krKyl7CgkJY2luPj54W2ldLmE7Cgl9Cglmb3IoaW50IGk9MDtpPG51bWI7aSsrKXsKCQljaW4+PnhbaV0uYjsKCX0KCWZvcihpbnQgaT0wO2k8bnVtYjtpKyspewoJCWlmKHhbaV0uYTwwICYmIHhbaV0uYjwwKXsKCQkJeFtpXS5hPXhbaV0uYSswLjU7CgkJCXhbaV0uYj14W2ldLmIrMC41OwoJCX0KCQllbHNlIGlmKHhbaV0uYTwwICYmIHhbaV0uYj49MCl7CgkJCXhbaV0uYT14W2ldLmEqeFtpXS5hOwoJCX0KCQllbHNlIGlmKHhbaV0uYT49MCAmJiB4W2ldLmI8MCl7CgkJCXhbaV0uYj14W2ldLmIqeFtpXS5iOwoJCX0KCQllbHNlIHsKCQkJeFtpXS5hPSh4W2ldLmEreFtpXS5iKS8yOwoJCQl4W2ldLmI9eFtpXS5hOwoJCX0KCX0KCWZvcihpbnQgaT0wO2k8bnVtYjtpKyspewoJCWNvdXQ8PHhbaV0uYTw8IiAiOwoJfQoJY291dDw8ZW5kbDsKCWZvcihpbnQgaT0wO2k8bnVtYjtpKyspewoJCWNvdXQ8PHhbaV0uYjw8IiAiOwoJfQoJcmV0dXJuIDA7Cn0=