#include<iostream>
using namespace std;
int main(){
    long long bcar,bcarica,btopowe,bkone,buficeri,bpeshki,chcar,chcarica,chtopowe,chkone,chuficeri,chpeshki;
    cin>>bcar>>bcarica>>btopowe>>bkone>>buficeri>>bpeshki;
    cin>>chcar>>chcarica>>chtopowe>>chkone>>chuficeri>>chpeshki;
    cout<<1-bcar<<" "<<1-bcarica<<" "<<2-btopowe<<" "<<2-bkone<<" "<<2-buficeri<<" "<<8-bpeshki<<endl;
    cout<<1-chcar<<" "<<1-chcarica<<" "<<2-chtopowe<<" "<<2-chkone<<" "<<2-chuficeri<<" "<<8-chpeshki<<endl;
    return 0;
}
