#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repd(i,a,b) for (int i = (a); i < (b); i++)
#define INF LLONG_MAX
typedef long long ll;

double naiseki(double x1, double y1, double x2, double y2)
{
	return x1*x2 + y1*y2;
}

double gaiseki(double x1, double y1, double x2, double y2)
{
	return x1*y2 - x2*y1;
}

int main(void)
{
	int q;
	cin >> q;
	int xp0, yp0, xp1, yp1, xp2, yp2, xp3, yp3;
	int p0p1_x, p0p1_y, p2p3_x, p2p3_y, nai, gai;
	rep(i, q)
	{
		cin >> xp0 >> yp0 >> xp1 >> yp1 >> xp2 >> yp2 >> xp3 >> yp3;
		p0p1_x = xp1 - xp0;
		p0p1_y = yp1 - yp0;
		p2p3_x = xp3 - xp2;
		p2p3_y = yp3 - yp2;
		nai = naiseki(p0p1_x, p0p1_y, p2p3_x, p2p3_y);
		gai = gaiseki(p0p1_x, p0p1_y, p2p3_x, p2p3_y);
		if(gai == 0) cout << 2 << endl;
		else if(nai == 0) cout << 1 << endl;
		else cout << 0 << endl;
	}
}


### Prompt

Develop a solution in CPP to the problem described below:

For given two lines s1 and s2, print "2" if they are parallel, "1" if they are orthogonal, or "0" otherwise.

s1 crosses points p0 and p1, and s2 crosses points p2 and p3.

Constraints

* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.

Input

The entire input looks like:


q (the number of queries)
1st query
2nd query
...
qth query


Each query consists of integer coordinates of the points p0, p1, p2, p3 in the following format:


xp0 yp0 xp1 yp1 xp2 yp2 xp3 yp3


Output

For each query, print "2", "1" or "0".

Example

Input

3
0 0 3 0 0 2 3 2
0 0 3 0 1 1 1 4
0 0 3 0 1 1 2 2


Output

2
1
0

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repd(i,a,b) for (int i = (a); i < (b); i++)
#define INF LLONG_MAX
typedef long long ll;

double naiseki(double x1, double y1, double x2, double y2)
{
	return x1*x2 + y1*y2;
}

double gaiseki(double x1, double y1, double x2, double y2)
{
	return x1*y2 - x2*y1;
}

int main(void)
{
	int q;
	cin >> q;
	int xp0, yp0, xp1, yp1, xp2, yp2, xp3, yp3;
	int p0p1_x, p0p1_y, p2p3_x, p2p3_y, nai, gai;
	rep(i, q)
	{
		cin >> xp0 >> yp0 >> xp1 >> yp1 >> xp2 >> yp2 >> xp3 >> yp3;
		p0p1_x = xp1 - xp0;
		p0p1_y = yp1 - yp0;
		p2p3_x = xp3 - xp2;
		p2p3_y = yp3 - yp2;
		nai = naiseki(p0p1_x, p0p1_y, p2p3_x, p2p3_y);
		gai = gaiseki(p0p1_x, p0p1_y, p2p3_x, p2p3_y);
		if(gai == 0) cout << 2 << endl;
		else if(nai == 0) cout << 1 << endl;
		else cout << 0 << endl;
	}
}


```