An extension of a complex number is called a quaternion. It is a convenient number that can be used to control the arm of a robot because it is convenient for expressing the rotation of an object. Quaternions are $ using four real numbers $ x $, $ y $, $ z $, $ w $ and special numbers (extended imaginary numbers) $ i $, $ j $, $ k $. It is expressed as x + yi + zj + wk $. The sum of such quaternions is defined as:

$ (x_1 + y_1 i + z_1 j + w_1 k) + (x_2 + y_2 i + z_2 j + w_2 k) = (x_1 + x_2) + (y_1 + y_2) i + (z_1 + z_2) j + (w_1 + w_2) k $

On the other hand, the product between 1, $ i $, $ j $, and $ k $ is given as follows.

<image>


This table represents the product $ AB $ of two special numbers $ A $ and $ B $. For example, the product $ ij $ of $ i $ and $ j $ is $ k $, and the product $ ji $ of $ j $ and $ i $ is $ -k $.

The product of common quaternions is calculated to satisfy this relationship. For example, the product of two quaternions, $ 1 + 2i + 3j + 4k $ and $ 7 + 6i + 7j + 8k $, is calculated as follows:

$ (1 + 2i + 3j + 4k) \ times (7 + 6i + 7j + 8k) = $
$ 7 + 6i + 7j + 8k $
$ + 14i + 12i ^ 2 + 14ij + 16ik $
$ + 21j + 18ji + 21j ^ 2 + 24jk $
$ + 28k + 24ki + 28kj + 32k ^ 2 $

By applying the table above

$ = -58 + 16i + 36j + 32k $

It will be.

Two quaternions ($ x_1 + y_1 i + z_1 j + w_1 k $) and ($) where the four coefficients $ x $, $ y $, $ z $, $ w $ are integers and not all zeros x_2 + y_2 i + z_2 j + w_2 k $), and the product is ($ x_3 + y_3 i + z_3 j + w_3 k $), $ x_3 $, $ y_3 $, $ z_3 $, $ Create a program that outputs w_3 $.



input

Given multiple datasets. The end of the input is indicated by a single line of zeros. Each dataset is given in the following format:

$ n $
$ data_1 $
$ data_2 $
::
$ data_n $


The first line gives the number of pairs of quaternions to process $ n $ ($ n \ leq 10 $). The following $ n $ line is given the $ i $ th quaternion pair of information $ data_i $ in the following format:

$ x_1 $ $ y_1 $ $ z_1 $ $ w_1 $ $ x_2 $ $ y_2 $ $ z_2 $ $ w_2 $

All coefficients given should be -1000 or more and 1000 or less. The number of datasets does not exceed 50.

output

Prints the product of a given set of quaternions for each dataset.

Example

Input

2
1 2 3 4 7 6 7 8
5 6 7 8 3 2 3 4
0


Output

-58 16 36 32
-50 32 28 48
import java.util.*;


public class Main {

	/**
	 * @param args
	 */

	Scanner sc = new Scanner(System.in);
	int moto,z=1,sua[]=new int[4],sub[]=new int[4],total[]=new int[16],out[]=new int[4],tc=0,count=0;
	String info[] = {"1","i","j","k"},tinfo[] = new String[16];

	void in(){

		moto = sc.nextInt();

		while(0 != moto){
			if(count >= moto){
				moto = sc.nextInt();
				count = 0;
			}else{
				for(int t=0;t<moto;t++){
					for(int i=0;i<4;i++){
						sua[i] = sc.nextInt();
					}
					for(int i=0;i<4;i++){
						sub[i] = sc.nextInt();
					}
					count++;
					syori();

					Arrays.fill(out, 0);
					tc = 0;
				}
			}
		}
	}

	void syori(){
		for(int l=0;l<4;l++){
			for(int y=0;y<4;y++){
				total[tc] = sua[l] * sub[y];
				tinfo[tc] = info[l] + info[y];
				tc++;
			}
		}
		for(int n=0;n<16;n++){
			if("11".equals(tinfo[n])){
				out[0] += total[n];
			}else{
				if("ii".equals(tinfo[n])|| "kk".equals(tinfo[n])|| "jj".equals(tinfo[n])){
					out[0] -= total[n];
				}else{
					if("1i".equals(tinfo[n])|| "i1".equals(tinfo[n])|| "jk".equals(tinfo[n])){
						out[1] += total[n];
					}else{
						if("1j".equals(tinfo[n]) || "j1".equals(tinfo[n]) || "ki".equals(tinfo[n])){
							out[2] += total[n];
						}else{
							if("1k".equals(tinfo[n]) || "k1".equals(tinfo[n]) || "ij".equals(tinfo[n])){
								out[3] += total[n];
							}else{
								if("ji".equals(tinfo[n])){
									out[3] -= total[n];
								}else{
									if("ik".equals(tinfo[n])){
										out[2] -= total[n];
									}else{
										if("kj".equals(tinfo[n])){
											out[1] -= total[n];
										}
									}
								}
							}
						}
					}
				}
			}
		}
		for(int u=0;u<4;u++){
			System.out.print(out[u]);
			if(u < 3){
				System.out.print(" ");
			}else{
			}
		}
		System.out.println();
	}



	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Main q = new Main();
		q.in();
	}

}