#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

typedef complex<double> P;
typedef vector<P> G;
#define here(g, i) g[i]
#define next(g, i) g[(i + 1) % g.size()]
#define prev(g, i) g[(i - 1 + g.size()) % g.size()]
const double EPS = 1e-10;
const double INF = 1e12;

struct L {
    P a, b, v;
    L(){}
    // L(P _a, P _b) {a = _a, b = _b, v = b - a;}
    L(P _a, P _b) : a(_a), b(_b), v(b - a) {}
    L(double _ax, double _ay, double _bx, double _by)
        : a(_ax, _ay), b(P(_bx, _by)), v(b - a) {}
};

double cross(P a, P b) {
    return imag(conj(a) * b);
}

double dot(P a, P b) {
    return real(conj(a) * b);
}

// 2: parallel
// 1: orthogonal
// 0: otherwise
int relationLL(L l1, L l2) {
    if (cross(l1.v, l2.v) == 0) return 2;
    if (dot(l1.v, l2.v) == 0) return 1;
    return 0;
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int q;
    cin >> q;
    while (q--) {
        double v[4][2];
        rep(i, 4) rep(j, 2) cin >> v[i][j];
        L l1(v[0][0], v[0][1], v[1][0], v[1][1]);
        L l2(v[2][0], v[2][1], v[3][0], v[3][1]);
        cout << relationLL(l1, l2) << 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 int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

typedef complex<double> P;
typedef vector<P> G;
#define here(g, i) g[i]
#define next(g, i) g[(i + 1) % g.size()]
#define prev(g, i) g[(i - 1 + g.size()) % g.size()]
const double EPS = 1e-10;
const double INF = 1e12;

struct L {
    P a, b, v;
    L(){}
    // L(P _a, P _b) {a = _a, b = _b, v = b - a;}
    L(P _a, P _b) : a(_a), b(_b), v(b - a) {}
    L(double _ax, double _ay, double _bx, double _by)
        : a(_ax, _ay), b(P(_bx, _by)), v(b - a) {}
};

double cross(P a, P b) {
    return imag(conj(a) * b);
}

double dot(P a, P b) {
    return real(conj(a) * b);
}

// 2: parallel
// 1: orthogonal
// 0: otherwise
int relationLL(L l1, L l2) {
    if (cross(l1.v, l2.v) == 0) return 2;
    if (dot(l1.v, l2.v) == 0) return 1;
    return 0;
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int q;
    cin >> q;
    while (q--) {
        double v[4][2];
        rep(i, 4) rep(j, 2) cin >> v[i][j];
        L l1(v[0][0], v[0][1], v[1][0], v[1][1]);
        L l2(v[2][0], v[2][1], v[3][0], v[3][1]);
        cout << relationLL(l1, l2) << endl;
    }

}
```