7
576460752303423487 2
82 9
101 104
10 21
31 10
0 1
10 30
 1
128817972817282999 327672410994637530
 66
7 0
5 7
1 3
3 2
3 5
0 6
1 2
0 7
4 5
4 7
5 1
2 0
4 0
0 5
3 6
7 3
6 0
5 2
6 6
1 7
5 6
2 2
3 4
2 1
5 3
4 6
6 2
3 3
100000000000 1000000000000000000
0 1
4 1
2 6
5 5
4 3
0 3
3 7
3 1
1 0
4 4
1000000000000000000 100000000000
7 6
4 2
7 5
1 6
6 1
2 7
7 7
6 7
2 4
0 2
2 5
7 2
0 0
5 0
5 4
7 4
6 4
0 4
1 1
6 5
1 4
2 3
1 5
7 1
6 3
3 0
 1
100000000000 100000000001
 1
23917 1000000000000000000

First
Second
Second
First
Second
Second
First
 First
 Second
Second
First
Second
First
Second
First
Second
Second
First
First
Second
Second
Second
First
First
Second
First
First
First
Second
First
Second
First
First
Second
First
First
First
Second
First
First
First
Second
Second
First
First
Second
First
First
Second
First
Second
First
First
First
First
Second
First
Second
First
First
Second
Second
Second
First
Second
Second
First
Second
First
Second
First
First
First
Second
 Second
 Second

import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		int T = sc.nextInt();
		for (int t = 0; t < T; ++t)
			solve(sc.nextLong(), sc.nextLong());
		exit("");
	}
	
	public void solve (long A, long B) {
		start();
		print (wins(Math.min(A,B), Math.max(A,B)) ? "First" : "Second");
	}
	
	double INF = 18 * Math.log(10) + 1;
	
	Map<String, Boolean> C = new HashMap<String, Boolean>();
	
	boolean wins(long a, long b) {
		if (a == 0)
			return false;
		
		String key = a + ":" + b;
		
		if (C.containsKey(key))
			return C.get(key);
		
		if (!wins(b%a, a)) {
			C.put(key, true);
			return true;
		}
		
		long p = a; int k = 2;
		double L = Math.log(a);
		while (k * L < INF && p * a <= b) {
			p = p * a;
			++k;
		}

		long x = Math.min(a, b-p);
		long y = Math.max(a, b-p);
		
		if (!wins(x, y)) {
			C.put(key, true);
			return true;
		}
		
		if (b-a > a && !wins(a, b-a))
			return true;
		
		C.put(key, false);
		return false;
	}
	
	////////////////////////////////////////////////////////////////////////////////////
	
	static MyScanner sc;
	static long t;
	
	static void print (Object o) {
		System.out.println(o);
	}
	
	static void exit (Object o) {
		print(o);
		print((millis() - t) / 1000.0);
		System.exit(0);
	}
	
	static void run () throws IOException {
		sc = new MyScanner ();
		new C();
	}
	
	public static void main(String[] args) throws IOException {
		run();
	}
	
	static long millis() {
		return System.currentTimeMillis();
	}
	
	static void start() {
		t = millis();
	}
	
	static class MyScanner {
		String next() throws IOException {
			newLine();
			return line[index++];
		}
		
		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		
		long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		
		String nextLine() throws IOException {
			line = null;
			return r.readLine();
		}

		//////////////////////////////////////////////
		
		private final BufferedReader r;

		MyScanner () throws IOException {
			this(new BufferedReader(new InputStreamReader(System.in)));
		}
		
		MyScanner(BufferedReader r) throws IOException { 
			this.r = r;
			newLine();
		}
		
		private String [] line;
		private int index;

		private void newLine() throws IOException {
			if (line == null || index == line.length) {
				line = r.readLine().split(" ");
				index = 0;
			}
		}		
	}	
}
