#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
    {
        if(bCar-istCar==0)
        {
            cout<<bCar-istCar<<" ";
        }
        else
        {
            cout<<"-"<<bCar-istCar<<" ";
        }
    }
    if(bDama<istDama)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(bDama-istDama==0)
        {
            cout<<bDama-istDama<<" ";
        }
        else
        {
            cout<<"-"<<bDama-istDama<<" ";
        }
    }
    if(bTop<istTop)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(bTop-istTop==0){
                cout<<bTop-istTop<<" ";
        }else{
            cout<<"-"<<bTop-istTop<<" ";
        }
    }
    if(bKon<istKon)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(bKon-istKon==0){
            cout<<bKon-istKon<<" ";
        }else{
            cout<<"-"<<bKon-istKon<<" ";
        }
    }
    if(bOfic<istOfic)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(bOfic-istOfic==0){
            cout<<bOfic-istOfic<<" ";
        }else{
            cout<<"-"<<bOfic-istOfic<<" ";
        }
    }
    if(bPesh<istPesh)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(bPesh-istPesh==0){
            cout<<bPesh-istPesh<<" ";
        }else{
            cout<<"-"<<bPesh-istPesh<<" ";
        }
    }
    cout<<endl;
    if(chCar<istCar)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(chCar-istCar==0)
        {
            cout<<chCar-istCar<<" ";
        }
        else
        {
            cout<<"-"<<chCar-istCar<<" ";
        }
    }
    if(chDama<istDama)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(chDama-istDama==0)
        {
            cout<<chDama-istDama<<" ";
        }
        else
        {
            cout<<"-"<<chDama-istDama<<" ";
        }
    }
    if(chTop<istTop)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(chTop-istTop==0){
                cout<<chTop-istTop<<" ";
        }else{
            cout<<"-"<<chTop-istTop<<" ";
        }
    }
    if(chKon<istKon)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(chKon-istKon==0){
            cout<<chKon-istKon<<" ";
        }else{
            cout<<"-"<<chKon-istKon<<" ";
        }
    }
    if(chOfic<istOfic)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(chOfic-istOfic==0){
            cout<<chOfic-istOfic<<" ";
        }else{
            cout<<"-"<<chOfic-istOfic<<" ";
        }
    }
    if(chPesh<istPesh)
    {
        cout<<"1"<<" ";
    }
    else
    {
        if(chPesh-istPesh==0){
            cout<<chPesh-istPesh<<" ";
        }else{
            cout<<"-"<<chPesh-istPesh<<" ";
        }
    }
    return 0;
}