#include<cstdio>
int main(){
	int a[12];
	for (int i = 0; i < 12; i++){
		scanf("%d", &a[i]);
	}
	int b1, b2, b3, b4;
	b1 = a[0] * a[6] + a[1] * a[8] + a[2] * a[10];
	b2 = a[0] * a[7] + a[1] * a[9] + a[2] * a[11];
	b3 = a[3] * a[6] + a[4] * a[8] + a[5] * a[10];
	b4 = a[3] * a[7] + a[4] * a[9] + a[5] * a[11];
	printf("%d %d \n", b1, b2);
	printf("%d %d \n", b3, b4);
}