#include <iostream>
using namespace std;
int main ()
{
long long beli[6], cherni[6], Proba;
for (Proba=0;Proba<6;Proba++) {
    cin>>beli[Proba];
}
for (Proba=0;Proba<6;Proba++) {
    cin>>cherni[Proba];
}
for (Proba=0;Proba<2;Proba++) {
if (beli[Proba]>1) {
    cout<<"-"<<beli[Proba]-1<<" ";
}
else {
    cout<<1-beli[Proba]<<" ";
}
}
for (Proba=2;Proba<5;Proba++) {
    if (beli[Proba]>2) {
        cout<<"-"<<beli[Proba]-2<<" ";
    }
    else {
        cout<<2-beli[Proba]<<" ";
    }
}
for (Proba=5;Proba<6;Proba++) {
    if (beli[Proba]>8) {
        cout<<"-"<<beli[Proba]-8<<" "<<endl;
    }
    else {
        cout<<8-beli[Proba]<<" "<<endl;
    }
}

for (Proba=0;Proba<2;Proba++) {
if (cherni[Proba]>1) {
    cout<<"-"<<cherni[Proba]-1<<" ";
}
else {
    cout<<1-cherni[Proba]<<" ";
}
}
for (Proba=2;Proba<5;Proba++) {
    if (cherni[Proba]>2) {
        cout<<"-"<<cherni[Proba]-2<<" ";
    }
    else {
        cout<<2-cherni[Proba]<<" ";
    }
}
for (Proba=5;Proba<6;Proba++) {
    if (cherni[Proba]>8) {
        cout<<"-"<<cherni[Proba]-8<<" "<<endl;
    }
    else {
        cout<<8-cherni[Proba]<<" "<<endl;
    }
}



return 0;
}
