// G. Hagopian solving Kattis "Bijele" problem

#include <iostream>
using namespace std;

int main() {
	int k{}, q{}, r{}, h{}, b{}, p{};
	cin >> k >> q >> r >> h >> b >> p;
	cout << 1 - k << ' ' << 1 - q << ' ' << 2 - r << ' ' 
		 << 2 - h << ' ' << 2 - b << ' ' << 8 - p;
}