#include<iostream>
using namespace std;
int main(){
int wk,wq,wt,wko,wo,wp,bk,bq,bt,bko,bo,bp;
cin>>wk>>wq>>wt>>wk>>wo>>wp>>bk>>bq>>bt>>bk>>bo>>bp;
if (wk < 1 ){
    wk = 1;
}else if (wk = 1 ){
    wk = 0;
}else if (wk > 1 ){
    wk = wk - 1;
}
if (bk < 1 ){
    bk = 1;
}else if (bk = 1 ){
    bk = 0;
}else if (bk > 1 ){
    bk = bk - 1;
}
if (wq < 1 ){
    wq = 1;
}else if (wq = 1 ){
    wq = 0;
}else if (wq > 1 ){
    wq = wq - 1;
}
if (bq < 1 ){
    bq = 1;
}else if (bq = 1 ){
    bq = 0;
}else if (bq > 1 ){
    bq = bq - 1;
}
if (wt < 2){
    wt = 2 - wt;
}else if (wt = 2 ){
    wt = 0;
}else if (wt > 2 ){
    wt = wt - 2;
}
if (bt < 2 ){
    bt = 2 - bt;
}else if (bt = 2 ){
    bt = 0;
}else if (bt > 2 ){
    bt = bt - 2;
}
if (wko < 2){
    wko = 2 - wko;
}else if (wko = 2 ){
    wko = 0;
}else if (wko > 2 ){
    wko = wko - 2;
}
if (bko < 2 ){
    bko = 2 - bko;
}else if (bko = 2 ){
    bko = 0;
}else if (bko > 2 ){
    bko = bko - 2;
}
if (wo < 2){
    wo = 2 - wo;
}else if (wo = 2 ){
    wo = 0;
}else if (wo > 2 ){
    wo = wo - 2;
}
if (bo < 2 ){
    bo = 2 - bo;
}else if (bo = 2 ){
    bo = 0;
}else if (bo > 2 ){
    bo = bo - 2;
}
if (wp < 8){
    wp = 8 - wp;
}else if (wp = 8 ){
    wp = 0;
}else if (wp > 8 ){
    wp = wp - 8;
}
if (bp < 8 ){
    bp = 8 - bp;
}else if (bp = 8 ){
    bp = 0;
}else if (bp > 8 ){
    bp = bp - 8;
}

    return 0;
}
