#include<iostream>
using namespace std;
int main()
{
    int bcar, bcarica, btop, bkon, bofficer, bpeshka, chcar, chcarica, chtop, chkon, chofficer, chpeshka;
    cin>>bcar>>bcarica>>btop>>bkon>>bofficer>>bpeshka;
    cin>>chcar>>chcarica>>chtop>>chkon>>chofficer>>chpeshka;
    int counter_car_carica = 0;
    if(bcar == 1)
    {
        cout<<"0"<<" ";
    }
    else if(bcar < 1)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(bcar - 1)<<" ";
    }
    if(bcarica == 1)
    {
        cout<<"0"<<" ";
    }
    else if(bcarica < 1)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(bcarica - 1)<<" ";
    }
     if(btop == 2)
    {
        cout<<"0"<<" ";
    }
    else if(btop < 2)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(btop - 2)<<" ";
    }
     if(bkon == 2)
    {
        cout<<"0"<<" ";
    }
    else if(bkon < 2)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(bkon - 2)<<" ";
    }
     if(bofficer == 2)
    {
        cout<<"0"<<" ";
    }
    else if(bofficer < 2)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(bofficer -2)<<" ";
    } if(bpeshka == 8)
    {
        cout<<"0"<<"\n";
    }
    else if(bpeshka < 8)
    {
        cout<<"1"<<"\n";
    }
    else
    {
        cout<<"-"<<(bpeshka - 8)<<"\n";
    }
    if(chcar == 1)
    {
        cout<<"0"<<" ";
    }
    else if(chcar < 1)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(chcar - 1)<<" ";
    }
    if(chcarica == 1)
    {
        cout<<"0"<<" ";
    }
    else if(chcarica < 1)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(chcarica - 1)<<" ";
    }
     if(chtop == 2)
    {
        cout<<"0"<<" ";
    }
    else if(chtop < 2)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(chtop - 2)<<" ";
    }
     if(chkon == 2)
    {
        cout<<"0"<<" ";
    }
    else if(chkon < 2)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(chkon - 2)<<" ";
    }
     if(chofficer == 2)
    {
        cout<<"0"<<" ";
    }
    else if(chofficer < 2)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(chofficer -2)<<" ";
    } if(chpeshka == 8)
    {
        cout<<"0"<<" ";
    }
    else if(chpeshka < 8)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<"-"<<(chpeshka - 8);
    }
    return 0;
}
