#include<bits/stdc++.h>
#define  ll long long
typedef unsigned long long ull;
using namespace std;
const int Max=1e6+20;
const int Maxn=1e7+20;
const int mod=1e9+7;
const int c=231;
inline int read()
{
    int f=1,x=0;char ch;
    do{ch=getchar();if(ch=='-')f=-1;}
    while(ch<'0'||ch>'9');
    do{x=x*10+ch-'0';ch=getchar();}
    while(ch>='0'&&ch<='9');return x*f;
}

int main()
{
   int t=read();
   ll n;
   while(t--)
   {
       cin>>n;
       if(n%4==0) cout<<"Even"<<endl;
       else if(n%2==0) cout<<"Same"<<endl;
       else cout<<"Odd"<<endl;
   }
   return 0;

}


#include <stdio.h>
#include <vector>

long long int MAX = 21;
std::pair<long long int, long long int> func(long long int k, long long int s, long long int t)
{
	if(s<t)
	{
		if(s==0)
		{
			if(k%t==0) return std::make_pair(0,-(k/t));
			else return std::make_pair(0,0);
		}
		
		long long int a = t/s;
		std::pair<long long int, long long int> P = func(k,s,t%s);
		std::pair<long long int, long long int> ans = std::make_pair(P.first+a*P.second,P.second);
		ans.first += t, ans.second += s;
		long long int n1 = ans.first/t;
		long long int n2 = ans.second/s;
		long long int m = n1<n2?n1:n2;
		ans.first -= m*t, ans.second -= m*s;
		return ans;
	}
	else
	{
		if(t==0)
		{
			if(k%s==0) return std::make_pair((k/s),0);
			else return std::make_pair(0,0);
		}
		
		long long int a = s/t;
		std::pair<long long int, long long int> P = func(k,s%t,t);
		std::pair<long long int, long long int> ans = std::make_pair(P.first,P.second+a*P.first);
		ans.first += t, ans.second += s;
		long long int n1 = ans.first/t;
		long long int n2 = ans.second/s;
		long long int m = n1<n2?n1:n2;
		ans.first -= m*t, ans.second -= m*s;
		return ans;
	}
}

long long int gcd(long long int a, long long int b)
{
	return a?gcd(b%a,a):b;
}
long long int lcm(long long int a, long long int b)
{
	return (a/gcd(a,b))*b;
}

int main()
{
	for(int i=1;i<=17;i++) MAX *= 10;
	int T;
	scanf("%d",&T);
	while(T--)
	{
		long long int a,b,c,d;
		scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
		long long int ans = MAX;
		for(long long int i = c-a-b+1;i<=c+d-a-1;i++)
		{
			long long int t;
			if(i==0)
			{
				long long int s1 = a;
				long long int s2 = c;
				t = s1>s2?s1:s2;
			}
			else
			{
				std::pair<long long int, long long int> P = func(i,2*a+2*b,c+d);
				if(P.first==0&&P.second==0) continue;
				
				long long int s1 = P.first * (2*a+2*b) + a;
				long long int s2 = P.second * (c+d) + c;
				t = s1>s2?s1:s2;
			}
			t %= lcm(2*a+2*b,c+d);
			ans = ans<t?ans:t;
		}
		if(ans==MAX) printf("infinity\n");
		else printf("%lld\n",ans);
	}
}