Problem: Consider the set of all nonnegative integers: . Given two integers and (). We paint all the numbers in increasing number first we paint , then we paint , then and so on.
Each number is painted white or black. We paint a number according to the following rules:
- if , it is colored white;
- if and is colored white, is also colored white;
- if and is colored white, is also colored white;
- if is still not colored white, it is colored black.
In this way, each nonnegative integer gets one of two colors.
For example, if , , then the colors of the numbers (in the order from ) are: white (), black (), black (), white (), black (), white (), white (), black (), white (), white (), ...
Note that:
- It is possible that there are infinitely many nonnegative integers colored black. For example, if and , then only and any other nonnegative integers that end in 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 and , 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 Format: The first line of input contains a single integer () — the number of test cases in the input. Then lines follow, each line contains two space-separated integers and ().
Output Format: 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).