#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 50005;
const int mod = 192600817;
ll f[N];
int main()
{
    f[1] = f[2] = 1;
    for (int i = 3; i < N; i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
    for (int i = 1; i < N; i++) f[i] = f[i] * f[i] % mod;
    for (int i = 1; i < N; i++) f[i] = (f[i] + f[i - 1]) % mod;
    for (int Q, a, b, c, d; ~scanf("%d", &Q);)
        while (Q--)
        {
            scanf("%d%d%d%d", &a, &b, &c, &d);
            b += a << 2;
            d += c << 2;
            if (b > d) swap(b, d);
            printf("%lld\n", (f[d+1] - f[b] + mod) % mod);
        }
    return 0;
}
