Consider the set of all nonnegative integers: {0, 1, 2, ...}. Given two integers a and b (1 ≤ a, b ≤ 10^4). We paint all the numbers in increasing number first we paint 0, then we paint 1, then 2 and so on.

Each number is painted white or black. We paint a number i according to the following rules: 

  * if i = 0, it is colored white; 
  * if i ≥ a and i - a is colored white, i is also colored white; 
  * if i ≥ b and i - b is colored white, i is also colored white; 
  * if i is still not colored white, it is colored black. 



In this way, each nonnegative integer gets one of two colors.

For example, if a=3, b=5, then the colors of the numbers (in the order from 0) are: white (0), black (1), black (2), white (3), black (4), white (5), white (6), black (7), white (8), white (9), ...

Note that: 

  * It is possible that there are infinitely many nonnegative integers colored black. For example, if a = 10 and b = 10, then only 0, 10, 20, 30 and any other nonnegative integers that end in 0 when written in base 10 are white. The other integers are colored black. 
  * It is also possible that there are only finitely many nonnegative integers colored black. For example, when a = 1 and b = 10, then there is no nonnegative integer colored black at all. 



Your task is to determine whether or not the number of nonnegative integers colored black is infinite.

If there are infinitely many nonnegative integers colored black, simply print a line containing "Infinite" (without the quotes). Otherwise, print "Finite" (without the quotes).

Input

The first line of input contains a single integer t (1 ≤ t ≤ 100) — the number of test cases in the input. Then t lines follow, each line contains two space-separated integers a and b (1 ≤ a, b ≤ 10^4).

Output

For each test case, print one line containing either "Infinite" or "Finite" (without the quotes). Output is case-insensitive (i.e. "infinite", "inFiNite" or "finiTE" are all valid answers).

Example

Input


4
10 10
1 10
6 9
7 3


Output


Infinite
Finite
Infinite
Finite
import java.util.*; 

import java.util.Scanner; 

// Working program with FastReader  

import java.io.BufferedReader;  

import java.io.IOException;  

import java.io.InputStreamReader;  

import java.util.Scanner;  

import java.util.StringTokenizer; 

  

public class Solution { 
   
    private static final int INF = (int) 1e9;
    long in= (long)Math.pow(10,9)+7;
      
    public static void main(String[] args) {
               FastReader s=new FastReader();
                 int q=s.nextInt();
                 while(q-->0)
                 {
                     int a=s.nextInt();
                     int b=s.nextInt();
                     int gcd=gcd(a,b);
                     if(gcd==1)
                        System.out.println("Finite");
                     else System.out.println("Infinite");
                 }
         

    } 

 static class T
     {
         int data;
         int count;
          public T(int x,int y) 
           {
               this.data=x;
                this.count=y;
           } 
     }

   static class compare implements Comparator<T>

      {
          public  int compare(T a, T b)
           {
                return a.data-b.data;
               }
        }

//static ArrayList<Integer> primeFactors(int N)		// O(sqrt(N) / ln sqrt(N))
//	{
//		ArrayList<Integer> factors = new ArrayList<Integer>();		//take abs(N) in case of -ve integers
//		int idx = 0, p = primes.get(idx);

//		while(1l*p * p <= N)
//		{
//			while(N % p == 0) { factors.add(p); N /= p; }
//			p = primes.get(++idx);
//		}

//		if(N != 1)						// last prime factor may be > sqrt(N)
//			factors.add(N);				// for integers whose largest prime factor has a power of 1
//		return factors;
//	}

  // public  static long lcm(long a2, long b2) {
//	return (a2*b2)/gcd(a2,b2);
	//}

   
            
         public static  int gcd(int a , int b )
    {
      if(a<b)
      {
        int t =a;
        a=b;
        b=t;
      }
      if(a%b==0)
        return b ;
      return gcd(b,a%b);
    }
    public static  long pow(long n , long p,long m)
    {
         if(p==0)
            return 1;
        long val = pow(n,p/2,m);;
        val= (val*val)%m;
        if(p%2==0)
            return val;
        else
            return (val*n)%m;
    }
    
      
   
    

static class FastReader  

    {  

        BufferedReader br;  

        StringTokenizer st;  

   

        public FastReader()  

        {  

            br = new BufferedReader(new 

                     InputStreamReader(System.in));  

        }  

   

        String next()  

        {  

            while (st == null || !st.hasMoreElements())  

            {  

                try 

                {  

                    st = new StringTokenizer(br.readLine());  

                }  

                catch (IOException  e)  

                {  

                    e.printStackTrace();  

                }  

            }  

            return st.nextToken();  

        }  

   

        int nextInt()  

        {  

            return Integer.parseInt(next());  

        }  

   

        long nextLong()  

        {  

            return Long.parseLong(next());  

        }  

   

        double nextDouble()  

        {  

            return Double.parseDouble(next());  

        }  

   

        String nextLine()  

        {  

            String str = "";  

            try 

            {  

                str = br.readLine();  

            }  

            catch (IOException e)  

            {  

                e.printStackTrace();  

            }  

            return str;  

        }  

    } 

    


  

} 