#include <iostream>
using namespace std;

int main () {
int ach, bch, cch, dch, ech, fch;
int abh, bbh, cbh, dbh, ebh, fbh;
cin >> ach >> bch >> cch >> dch >> ech >> fch;
cout << endl;
cin >> abh >> bbh >> cbh >> dbh >> ebh >> fbh;
if (ach==0)
{
cout << "1" << endl;
}
if (ach>0)
{
cout << "-" << ach-1 << endl;
}
if (bch==0)
{
cout << "1" << endl;
}
if (bch>0)
{
cout << "-" << bch-1 << endl;
}
if (cch==0)
{
cout << "2" << endl;
}
if (cch>0)
{
cout << "-" << cch-2 << endl;
}
if (dch==0)
{
cout << "2" << endl;
}
if (dch>0)
{
cout << "-" << dch-2 << endl;
}
if (ech==0)
{
cout << "2" << endl;
}
if (ech>0)
{
cout << "-" << ech-2 << endl;
}
if (fch==0)
{
cout << "8" << endl;
}
if (fch>0)
{
cout << "-" << fch-8 << endl;
}
return 0;
}