#include<iostream>
using namespace std;
int main()
{
    int broyBeliCare;
    cin>>broyBeliCare;
    int broyBeliCarici;
    cin>>broyBeliCarici;
    int broyBeliTopove;
    cin>>broyBeliTopove;
    int broyBeliKone;
    cin>>broyBeliKone;
    int broyBeliOficeri;
    cin>>broyBeliOficeri;
    int broyBeliPeshki;
    cin>>broyBeliPeshki;

    int broyCherniCare;
    cin>>broyCherniCare;
    int broyCherniCarici;
    cin>>broyCherniCarici;
    int broyCherniTopove;
    cin>>broyCherniTopove;
    int broyCherniKone;
    cin>>broyCherniKone;
    int broyCherniOficeri;
    cin>>broyCherniOficeri;
    int broyCherniPeshki;
    cin>>broyCherniPeshki;

    if ( broyBeliCare > 1 ) {
        cout<<" -"<<broyBeliCare - 1<<" ";
    }

    if ( broyBeliCare == 1 ) {
        cout<<"0 ";
    }

    if ( broyBeliCarici > 1 ) {
        cout<<" -"<<broyBeliCarici - 1<<" ";
    }

    if ( broyBeliCarici == 1 ) {
        cout<<"0 ";
    }

    if ( broyBeliTopove > 2 ) {
        cout<<" -"<<broyBeliTopove - 2<<" ";
    }

    if ( broyBeliTopove == 2 ) {
        cout<<"0 ";
    }

    if ( broyBeliKone > 2 ) {
        cout<<" -"<<broyBeliKone - 2<<" ";
    }

    if ( broyBeliKone == 2 ) {
        cout<<"0 ";
    }

    if ( broyBeliOficeri > 2 ) {
        cout<<" -"<<broyBeliOficeri - 2<<" ";
    }

    if ( broyBeliOficeri == 2 ) {
        cout<<"0 ";
    }

    if ( broyBeliPeshki > 8 ) {
        cout<<" -"<<broyBeliPeshki - 8<<" ";
    }

    if ( broyBeliPeshki == 8 ) {
        cout<<"0 ";
    }

    if ( broyBeliCare < 1 ) {
        cout<<1 - broyBeliCare<<" ";
    }

    if ( broyBeliCarici < 1 ) {
        cout<<1 - broyBeliCarici<<" ";
    }

     if ( broyBeliTopove < 2 ) {
        cout<<2 - broyBeliTopove<<" ";
    }

    if ( broyBeliKone < 2 ) {
        cout<<2 - broyBeliKone<<" ";
    }

    if ( broyBeliOficeri < 2 ) {
        cout<<2 - broyBeliOficeri<<" ";
    }

    if ( broyBeliPeshki < 8 ) {
        cout<< 8 - broyBeliPeshki<<endl;
    }

    if ( broyCherniCare > 1 ) {
        cout<<" -"<<broyCherniCare - 1<<" ";
    }

    if ( broyCherniCare == 1 ) {
        cout<<"0 ";
    }

    if ( broyCherniCarici > 1 ) {
        cout<<" -"<<broyCherniCarici - 1<<" ";
    }

    if ( broyCherniCarici == 1 ) {
        cout<<"0 ";
    }

    if ( broyCherniTopove > 2 ) {
        cout<<" -"<<broyCherniTopove - 2<<" ";
    }

    if ( broyCherniTopove == 2 ) {
        cout<<"0 ";
    }

    if ( broyCherniKone > 2 ) {
        cout<<" -"<<broyCherniKone - 2<<" ";
    }

    if ( broyCherniKone == 2 ) {
        cout<<"0 ";
    }

    if ( broyCherniOficeri > 2 ) {
        cout<<" -"<<broyCherniOficeri - 2<<" ";
    }

    if ( broyCherniOficeri == 2 ) {
        cout<<"0 ";
    }

    if ( broyCherniPeshki > 8 ) {
        cout<<" -"<<broyCherniPeshki - 8<<" ";
    }

    if ( broyCherniPeshki == 8 ) {
        cout<<"0 ";
    }

    if ( broyCherniCare < 1 ) {
        cout<<1 - broyCherniCare<<" ";
    }

    if ( broyCherniCarici < 1 ) {
        cout<<1 - broyCherniCarici<<" ";
    }

    if ( broyCherniTopove < 2 ) {
        cout<<2 - broyCherniTopove<<" ";
    }

    if ( broyCherniKone < 2 ) {
        cout<<2 - broyCherniKone<<" ";
    }

    if ( broyCherniOficeri < 2 ) {
        cout<<2 - broyCherniOficeri<<" ";
    }

    if ( broyCherniPeshki < 8 ) {
        cout<<8 - broyCherniPeshki<<" ";
    }

    return 0;
}


