#include <iostream>
using namespace std;

int main()
{
    int bCar,bDama,bTop,bOfic,bKon,bPesh,chCar,chDama,chTop,chOfic,chKon,chPesh,istCar=1,istDama=1,istTop=2,istOfic=2,istKon=2,istPesh=8;
    cin>>bCar>>bDama>>bTop>>bKon>>bOfic>>bPesh>>chCar>>chDama>>chTop>>chKon>>chOfic>>chPesh;
    if(bCar<istCar)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<bCar-istCar<<" ";
    }
    if(bDama<istDama)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<bDama-istDama<<" ";
    }
    if(bTop<istTop)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<bTop-istTop<<" ";
    }
    if(bKon<istKon)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<bKon-istKon<<" ";
    }
    if(bOfic<istOfic)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<bOfic-istOfic<<" ";
    }
    if(bPesh<istPesh)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<bPesh-istPesh<<" ";
    }
    cout<<endl;
    if(chCar<istCar)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<chCar-istCar<<" ";
    }
    if(chDama<istDama)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<chDama-istDama<<" ";
    }
    if(chTop<istTop)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<chTop-istTop<<" ";
    }
    if(chKon<istKon)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<chKon-istKon<<" ";
    }
    if(chOfic<istOfic)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<chOfic-istOfic<<" ";
    }
    if(chPesh<istPesh)
    {
        cout<<"1"<<" ";
    }
    else
    {
        cout<<chPesh-istPesh<<" ";
    }
    return 0;
}