Problem:
Score : 1000 points

Problem Statement

There are N integers written on a blackboard. The i-th integer is A_i, and the greatest common divisor of these integers is 1.

Takahashi and Aoki will play a game using these integers. In this game, starting from Takahashi the two player alternately perform the following operation:

Select one integer on the blackboard that is not less than 2, and subtract 1 from the integer.

Then, divide all the integers on the black board by g, where g is the greatest common divisor of the integers written on the blackboard.

The player who is left with only 1s on the blackboard and thus cannot perform the operation, loses the game.
Assuming that both players play optimally, determine the winner of the game.

Constraints

1 ≦ N ≦ 10^5

1 ≦ A_i ≦ 10^9

The greatest common divisor of the integers from A_1 through A_N is 1.

Input

The input is given from Standard Input in the following format:

N
A_1 A_2 … A_N

Output

If Takahashi will win, print First. If Aoki will win, print Second.

Sample Input 1

3
3 6 7

Sample Output 1

First

Takahashi, the first player, can win as follows:

Takahashi subtracts 1 from 7. Then, the integers become: (1,2,2).

Aoki subtracts 1 from 2. Then, the integers become: (1,1,2).

Takahashi subtracts 1 from 2. Then, the integers become: (1,1,1).

Sample Input 2

4
1 2 4 8

Sample Output 2

First

Sample Input 3

5
7 8 8 8 8

Sample Output 3

Second

Solution in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace __gnu_pbds;
using namespace std;
 
const int MAXN = 1000 + 20, MAXM = 20, MOD = 1000 * 1000 * 1000 + 7;
const long long INF = 1e9 + 10;
char c[MAXN][MAXN];
int a[MAXN];
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
int n, m;
map <int, int> m1;

bool ok(int x, int y) {
	return (x >= 0 && x < n && y >= 0 && y < m);
}

void solve() {
	int n;
	cin >> n;
	
	for (int i = 0; i < n; i++)
		cin >> a[i];
		
	bool nob = 0;
	while (1) {
		int mn = INF, sum = 0, od = 0, ev = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];	
			mn = min(a[i], mn);
			od += a[i] % 2;
			ev += (a[i] - 1) % 2;
		}
		
		if (mn == 1) {
			if (nob == 0) {
				if ((sum - n) % 2 == 1) 
					cout << "First" << endl;
				else
					cout << "Second" << endl;
			}
			else {
				if ((sum - n) % 2 == 0) 
					cout << "First" << endl;
				else
					cout << "Second" << endl;
			}
			return;
		}
		else {
			int cnt = 0;
			int g = 0;
			if (ev % 2 == 1) {
				if (nob == 0)
					cout << "First" << endl;
				else
					cout << "Second" << endl;
				return;
			}
			if (od > 1) {
				if (nob == 1)
					cout << "First" << endl;
				else
					cout << "Second" << endl;
				return;
			}
			
			for (int i = 0; i < n; i++) {
				if (a[i] % 2 == 1) {
					cnt++;
					a[i]--;
				}
				g = __gcd(g, a[i]);
			}
			for (int i = 0; i < n; i++)	
				a[i] /= g;
			
			nob ^= 1;
		}
	}
}
 
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	solve();
}