#include <iostream>
using namespace std;
int main()
{
int bcar,bcari,btop,bkon,bof,besh;
cin>>bcar>>bcari>>btop>>bkon>>bof>>besh;

int chcar,chcari,chtop,chkon,chof,chesh;
cin>>chcar>>chcari>>chtop>>chkon>>chof>>chesh;

cout<<1-bcar<<" "<<1-bcari<<" "<<2-btop<<" "<<2-bkon <<" "<<2-bof<<" "<<8-besh<<endl;
cout<<1-chcar<<" "<<1-chcari<<" "<<2-chtop<<" "<<2-chkon <<" "<<2-chof<<" "<<8-chesh<<endl;




return 0;
}
