stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <list>

#include <cstdio>

#include <string>

#include <iostream>



#pragma warning(disable: 4996)



using namespace std;



int main()

{

	int n, v;



	string c;



	list<int> l;



	scanf("%d", &n);



	for (int i = 0; i < n;)

	{

		cin >> c;



		if (c[0] == 'i')

		{

			scanf("%d", &v);



			l.push_front(v);

		}

		else if (c.size() == 11)

		{

			l.pop_front();

		}

		else if (c.size() == 10)

		{

			l.pop_back();

		}

		else

		{

			scanf("%d", &v);



			list<int>::iterator it = l.begin();



			while (it != l.end())

			{

				if (*it == v)

				{

					l.erase(it); break;

				}



				it++;

			}

		}



		i++;

	}



	list<int>::iterator it = l.begin();



	while (it != l.end())

	{

		if (it == l.begin())

		{

			printf("%d", *it);

		}

		else

		{

			printf(" %d", *it);

		}



		it++;

	}



	printf("\n");



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.177653623692869x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <list>

#include <cstdio>



#pragma warning(disable: 4996)



using namespace std;



int main()

{

	int n, v;



	char c[12];



	list<int> l;



	scanf("%d", &n);



	for (int i = 0; i < n; i++)

	{

		scanf("%s", c);



		if (c[0] == 'i')

		{

			scanf("%d", &v);



			l.push_front(v);

		}

		else if (c[6] == 'F')

		{

			l.pop_front();

		}

		else if (c[6] == 'L')

		{

			l.pop_back();

		}

		else

		{

			scanf("%d", &v);



			list<int>::iterator it = l.begin();



			while (it != l.end())

			{

				if (*it == v)

				{

					l.erase(it); break;

				}



				it++;

			}

		}

	}



	list<int>::iterator it = l.begin();



	while (it != l.end())

	{

		if (it == l.begin())

		{

			printf("%d", *it);

		}

		else

		{

			printf(" %d", *it);

		}



		it++;

	}



	printf("\n");



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.787884261941256x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <list>

#include <cstdio>



using namespace std;



int main()

{

	int n, v;



	char c[12];



	list<int> l;



	scanf("%d", &n);



	for (int i = 0; i < n; i++)

	{

		scanf("%s", c);



		if (c[0] == 'i')

		{

			scanf("%d", &v);



			l.push_front(v);

		}

		else if (c[6] == 'F')

		{

			l.pop_front();

		}

		else if (c[6] == 'L')

		{

			l.pop_back();

		}

		else

		{

			scanf("%d", &v);



			list<int>::iterator it = l.begin();



			while (it != l.end())

			{

				if (*it == v)

				{

					l.erase(it); break;

				}



				it++;

			}

		}

	}



	list<int>::iterator it = l.begin();



	while (it != l.end())

	{

		if (it == l.begin())

		{

			printf("%d", *it);

		}

		else

		{

			printf(" %d", *it);

		}



		it++;

	}



	printf("\n");



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.788026352753105x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <list>

#include <cstdio>



int main()

{

	int n, v, i;



	char c[12];



	std::list<int> l;



	scanf("%d", &n);



	for (i = 0; i < n; i++)

	{

		scanf("%s", c);



		if (c[0] == 'i')

		{

			scanf("%d", &v);



			l.push_front(v);

		}

		else if (c[6] == 'F')

		{

			l.pop_front();

		}

		else if (c[6] == 'L')

		{

			l.pop_back();

		}

		else

		{

			scanf("%d", &v);



			std::list<int>::iterator it = l.begin();



			while (it != l.end())

			{

				if (*it == v)

				{

					l.erase(it); break;

				}



				it++;

			}

		}

	}



	std::list<int>::iterator it = l.begin();



	while (it != l.end())

	{

		if (it == l.begin())

		{

			printf("%d", *it);

		}

		else

		{

			printf(" %d", *it);

		}



		it++;

	}



	printf("\n");



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.787884261941256x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <list>

#include <cstdio>



int main()

{

	int n, v;



	char c[12];



	std::list<int> l;



	scanf("%d", &n);



	for (int i = 0; i < n; i++)

	{

		scanf("%s", c);



		if (c[0] == 'i')

		{

			scanf("%d", &v);



			l.push_front(v);

		}

		else if (c[6] == 'F')

		{

			l.pop_front();

		}

		else if (c[6] == 'L')

		{

			l.pop_back();

		}

		else

		{

			scanf("%d", &v);



			std::list<int>::iterator it = l.begin();



			std::list<int>::iterator end_it = l.end();



			while (it != end_it)

			{

				if (*it == v)

				{

					l.erase(it); break;

				}



				it++;

			}

		}

	}



	std::list<int>::iterator it = l.begin();



	while (it != l.end())

	{

		if (it == l.begin())

		{

			printf("%d", *it);

		}

		else

		{

			printf(" %d", *it);

		}



		it++;

	}



	printf("\n");



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.787884261941256x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <list>

#include <cstdio>



int main()

{

	int n, v;



	char c[12];



	std::list<int> l;



	scanf("%d", &n);



	for (int i = 0; i < n; i++)

	{

		scanf("%s", c);



		if (c[0] == 'i')

		{

			scanf("%d", &v);



			l.push_front(v);

		}

		else if (c[6] == 'F')

		{

			l.pop_front();

		}

		else if (c[6] == 'L')

		{

			l.pop_back();

		}

		else

		{

			scanf("%d", &v);



			std::list<int>::iterator it = l.begin();



			std::list<int>::iterator end_it = l.end();



			while (it != end_it)

			{

				if (*it == v)

				{

					l.erase(it); break;

				}



				it++;

			}

		}

	}



	std::list<int>::iterator it = l.begin();



	std::list<int>::iterator end_it = l.end();



	printf("%d", *it);



	while (++it != end_it)

	{

		printf(" %d", *it);

	}



	printf("\n");



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.788051903269882x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <list>

#include <cstdio>

using namespace std;

int Q, a, e; char c[14]; list<int> l;

int main() {

	scanf("%d", &Q);

	for(int i = 0; i < Q; i++) {

		scanf("%s", c);

		switch(c[0] + c[6]) {

		case 105: scanf("%d", &a), l.push_front(a); break;

		case 170: l.pop_front(); break;

		case 176: l.pop_back(); break;

		default:

			scanf("%d", &a);

			for(list<int>::iterator it = l.begin(); it != l.end(); it++) {

				if(*it == a) {

					l.erase(it); break;

				}

			}

		}

	}

	for(list<int>::iterator it = l.begin(); it != l.end(); it++) printf(e++ ? " %d" : "%d", *it);

	printf("\n");

}

// Faster C++ solution for the same problem (measured speedup: 4.787467822272073x):
#include <cstdio>

#pragma warning(disable : 4996)

const int inf = 1234567890;

int Q, x, a[2000009]; char c[15];

int main() {

	scanf("%d", &Q);

	int l = Q, r = Q;

	while (Q--) {

		scanf("%s", c);

		if (c[0] == 'i') {

			scanf("%d", &x);

			a[--l] = x;

		}

		else if (c[6] == 'F') {

			while (a[l] == inf) l++;

			a[l++] = 0;

		}

		else if (c[6] == 'L') {

			while (a[r - 1] == inf) r--;

			a[--r] = 0;

		}

		else {

			scanf("%d", &x);

			for (int i = l; i < r; i++) {

				if (a[i] == x) {

					a[i] = inf;

					break;

				}

			}

		}

	}

	for (int i = l, cnt = 0; i < r; i++) {

		if (a[i] != inf) {

			printf(cnt++ ? " %d" : "%d", a[i]);

		}

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <list>

#include <stdio.h>

#include <ctype.h>

#include <string.h>



#define APPTXT_BUFSZ	128



using namespace std;



static void deleteX(list<int> &list, int x) {

    for(auto itr=list.begin(); itr!=list.end(); itr++ ) {

        if(*itr==x) {

            list.erase(itr);

            break;

        }

    }

}



int main(void) {

    list<int> list;

    int n;

    int x;

    string str;



	getline(cin,str);

	n = atoi(&(str[0]));



	while( n-- > 0 && getline(cin, str) ) {

		if (str[0] == 'i') {		// ("insert"?¢????)

			x = atoi(&(str[sizeof("insert") - 1]));

            list.push_front(x);

        } else {

			int c = str[sizeof("delete") - 1];

			if (isalpha(c)) {

				if (c == 'F') {		// ("deleteFirst"?¢????)

		            list.pop_front();

				} else {			// ("deleteLast"?¢????)

		            list.pop_back();

				}

			} else {				// ("delete"?¢????)

				x = atoi(&(str[sizeof("delete") - 1]));

				deleteX(list, x);

			}

		}

    }



	//display list

    for(auto itr=list.begin(); itr!=list.end(); itr++ ) {

        if(itr==list.begin()) {

			printf("%d", *itr);

        } else {

			printf(" %d", *itr);

        }

    }

	fputc('\n', stdout);



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.271680138213028x):
#include <stdio.h>

#include <stdlib.h>

#include <ctype.h>

#include <string.h>

#include <assert.h>



using namespace std;



#define MAXDATA			2000000

#define APPTXT_BUFSZ	128



#define countof(arr)		(sizeof(arr) / sizeof(arr[0]))



static int g_anDataBuf[MAXDATA];

static bool g_abInvalid[MAXDATA];



int main(void) {

	char str[APPTXT_BUFSZ];

	int bgn, end;

    int n;

    int x;



	fgets(str, APPTXT_BUFSZ, stdin);

	n = atoi(&(str[0]));



	bgn = end = countof(g_anDataBuf);

	while( n-- > 0 && fgets(str, APPTXT_BUFSZ, stdin) != NULL ) {

		if (str[0] == 'i') {		// ("insert"?¢????)

			x = atoi(&(str[sizeof("insert") - 1]));

			g_anDataBuf[--bgn] = x;

			g_abInvalid[bgn] = false;

        } else {

			int c = str[sizeof("delete") - 1];

			if (isalpha(c)) {

				if (c == 'F') {		// ("deleteFirst"?¢????)

					while (bgn < end && g_abInvalid[bgn++]) { }

					assert(bgn <= end);

				} else {			// ("deleteLast"?¢????)

					while (bgn < end && g_abInvalid[--end]);

					assert(bgn <= end);

				}

			} else {				// ("delete"?¢????)

				x = atoi(&(str[sizeof("delete") - 1]));

				for (int i = bgn; i < end; i++) {

					if (g_abInvalid[i]) {

						continue;

					}

					if (g_anDataBuf[i] == x) {

						g_abInvalid[i] = true;

						break;

					}

				}

			}

		}

    }



	//display list

	bool bFirst = true;

	for (int i = bgn; i < end; i++) {

		if (g_abInvalid[i]) {

			continue;

		}

		const int x = g_anDataBuf[i];

		if (bFirst) {

			printf("%d", x);

			bFirst = false;

		} else {

			printf(" %d", x);

		}

	}

	fputc('\n', stdout);



	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

#include <numeric>

#define repeat(i,n) for (int i = 0; (i) < int(n); ++(i))

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

using ll = long long;

using namespace std;

int gcd(int a, int b) { while (a) { b %= a; swap(a, b); } return b; }

bool solve(int n, vector<int> & a) {

    ll sum = whole(accumulate, a, 0ll);

    bool is_first = (sum - n) % 2;

    int even = whole(count_if, a, [&](int ai) { return ai % 2 == 0; });

    auto odd = whole(find_if,  a, [&](int ai) { return ai % 2 == 1; });

    if (not is_first and even == n-1 and *odd != 1) {

        -- (*odd);

        int d = a[0]; repeat (i,n) d = gcd(d, a[i]);

        repeat (i,n) a[i] /= d;

        return not solve(n, a);

    } else {

        return is_first;

    }

}

int main() {

    int n; cin >> n;

    vector<int> a(n); repeat (i,n) cin >> a[i];

    cout << (solve(n, a) ? "First" : "Second") << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.357317345971333x):
#include<cstdio>

#define sev en

using namespace std;

#define N 100010



int a[N],cnt[2],n;



int gcd(int a,int b){

	if(b == 0)

		return a;

	return gcd(b,a % b);

}



int dg(){

	for(int i = 1;i <= n;i++)

		if(a[i] & 1)

			a[i]--;

	cnt[0] = cnt[1] = 0;

	int w = a[1];

	for(int i = 2;i <= n;i++)

		w = gcd(w,a[i]);

	for(int i = 1;i <= n;i++)

		cnt[(a[i] /= w) & 1]++;

	if(cnt[0] & 1)

	return 1;

	else if(cnt[1] > 1)

	return 0;

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1)

		return cnt[0] & 1 ? 1 : 0;

		return dg() ^ 1;

	}

}



int main(){

	scanf("%d",&n);

	for(int i = 1;i <= n;i++){ 

		scanf("%d",&a[i]);

		cnt[a[i] & 1]++;

	}

	if(cnt[0] & 1)

	printf("First");

	else if(cnt[1] > 1)

	printf("Second");

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1){

			printf(cnt[0] & 1 ? "First" : "Second");

			return 0;

		}

		if(dg() ^ 1)

		printf("First");

		else

		printf("Second");

	}

	return 0;

}
// Slower C++ solution:
//by yjz

#include<bits/stdc++.h>

using namespace std;

#define FF first

#define SS second

#define PB push_back

#define MP make_pair

#define bged(v) (v).begin(),(v).end()

#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)

typedef long long ll;

const int Imx=2147483647;

const ll Lbig=2e18;

const int mod=1e9+7;

//My i/o stream

struct fastio

{

	char s[100000];

	int it,len;

	fastio(){it=len=0;}

	inline char get()

	{

		if(it<len)return s[it++];it=0;

		len=fread(s,1,100000,stdin);

		if(len==0)return EOF;else return s[it++];

	}

	bool notend()

	{

		char c=get();

		while(c==' '||c=='\n')c=get();

		if(it>0)it--;

		return c!=EOF;

	}

}_buff;

#define geti(x) x=getnum()

#define getii(x,y) geti(x),geti(y)

#define getiii(x,y,z) getii(x,y),geti(z)

#define puti(x) putnum(x),putchar(' ')

#define putii(x,y) puti(x),puti(y)

#define putiii(x,y,z) putii(x,y),puti(z)

#define putsi(x) putnum(x),putchar('\n')

#define putsii(x,y) puti(x),putsi(y)

#define putsiii(x,y,z) putii(x,y),putsi(z)

inline ll getnum()

{

	ll r=0;bool ng=0;char c;c=_buff.get();

	while(c!='-'&&(c<'0'||c>'9'))c=_buff.get();

	if(c=='-')ng=1,c=_buff.get();

	while(c>='0'&&c<='9')r=r*10+c-'0',c=_buff.get();

	return ng?-r:r;

}

template<class T> inline void putnum(T x)

{

	if(x<0)putchar('-'),x=-x;

	register short a[20]={},sz=0;

	while(x)a[sz++]=x%10,x/=10;

	if(sz==0)putchar('0');

	for(int i=sz-1;i>=0;i--)putchar('0'+a[i]);

}

inline char getreal(){char c=_buff.get();while(c==' '||c=='\n')c=_buff.get();return c;}

int n,a[100111];

bool solve()

{

	ll sum=0;

	bool has1=0;

	int cnt1=0;

	for(int i=1;i<=n;i++)

	{

		sum+=a[i]-1;

		if(a[i]==1)has1=1;

		if(a[i]&1)cnt1++;

	}

	if(has1)return sum%2;

	if((n-cnt1)%2==1)return 1;

	if(cnt1==1)

	{

		int g=0;

		for(int i=1;i<=n;i++)

		{

			if(a[i]&1)a[i]--;

			g=__gcd(g,a[i]);

		}

		for(int i=1;i<=n;i++)a[i]/=g;

		return solve()^1;

	}

	return 0;

}

int main()

{

	geti(n);

	for(int i=1;i<=n;i++)

	{

		geti(a[i]);

	}

	if(solve())puts("First");else puts("Second");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.211061216045061x):
#include<cstdio>

#define sev en

using namespace std;

#define N 100010



int a[N],cnt[2],n;



int gcd(int a,int b){

	if(b == 0)

		return a;

	return gcd(b,a % b);

}



int dg(){

	for(int i = 1;i <= n;i++)

		if(a[i] & 1)

			a[i]--;

	cnt[0] = cnt[1] = 0;

	int w = a[1];

	for(int i = 2;i <= n;i++)

		w = gcd(w,a[i]);

	for(int i = 1;i <= n;i++)

		cnt[(a[i] /= w) & 1]++;

	if(cnt[0] & 1)

	return 1;

	else if(cnt[1] > 1)

	return 0;

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1)

		return cnt[0] & 1 ? 1 : 0;

		return dg() ^ 1;

	}

}



int main(){

	scanf("%d",&n);

	for(int i = 1;i <= n;i++){ 

		scanf("%d",&a[i]);

		cnt[a[i] & 1]++;

	}

	if(cnt[0] & 1)

	printf("First");

	else if(cnt[1] > 1)

	printf("Second");

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1){

			printf(cnt[0] & 1 ? "First" : "Second");

			return 0;

		}

		if(dg() ^ 1)

		printf("First");

		else

		printf("Second");

	}

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

using namespace std;

int a[100010];

int n;

int gcd(int a,int b)

{

	return b==0?a:gcd(b,a%b);

}

bool dg()

{

	long long sum=0;

	bool ex=0;

	int num=0;

	for (int i=1;i<=n;i++)

	{

		sum+=a[i]-1;

		if (a[i]==1) ex=1;

		if (a[i]&1) num++;

	}

	if (ex) return sum%2;

	if ((n-num)%2) return 1;

	if (num==1)

	{

		int g=0;

		for (int i=1;i<=n;i++)

			if (a[i]&1) a[i]--;

		for (int i=1;i<=n;i++)

			g=gcd(g,a[i]);

		for (int i=1;i<=n;i++)

			a[i]/=g;

		return dg()^1;

	}

	return 0;

		

}

int main()

{

	scanf("%d",&n);

	for (int i=1;i<=n;i++)

		scanf("%d",&a[i]);

	if (dg()) printf("First");

		else printf("Second");

}

// Faster C++ solution for the same problem (measured speedup: 5.225591314762765x):
#include<cstdio>

#define sev en

using namespace std;

#define N 100010



int a[N],cnt[2],n;



int gcd(int a,int b){

	if(b == 0)

		return a;

	return gcd(b,a % b);

}



int dg(){

	for(int i = 1;i <= n;i++)

		if(a[i] & 1)

			a[i]--;

	cnt[0] = cnt[1] = 0;

	int w = a[1];

	for(int i = 2;i <= n;i++)

		w = gcd(w,a[i]);

	for(int i = 1;i <= n;i++)

		cnt[(a[i] /= w) & 1]++;

	if(cnt[0] & 1)

	return 1;

	else if(cnt[1] > 1)

	return 0;

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1)

		return cnt[0] & 1 ? 1 : 0;

		return dg() ^ 1;

	}

}



int main(){

	scanf("%d",&n);

	for(int i = 1;i <= n;i++){ 

		scanf("%d",&a[i]);

		cnt[a[i] & 1]++;

	}

	if(cnt[0] & 1)

	printf("First");

	else if(cnt[1] > 1)

	printf("Second");

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1){

			printf(cnt[0] & 1 ? "First" : "Second");

			return 0;

		}

		if(dg() ^ 1)

		printf("First");

		else

		printf("Second");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

int n,a[100001],odd,sum;

int gcd(int x,int y){

	if (!y) return x;

	return gcd(y,x%y);

}

int f(){

	int o=0,e=0,i,g;

	for (i=1;i<=n;++i)

		if (a[i]&1){

			++o;

			odd=i;

		}else ++e;

	if (o==1&&a[odd]!=1){

		--a[odd];

		g=a[1];

		for (i=2;i<=n;++i) g=gcd(g,a[i]);

		for (i=1;i<=n;++i) a[i]/=g;

		return 1-f();

	}else{

		for (i=1;i<=n;++i) sum+=a[i];

		if ((sum+n)&1) return 1;

		else return 0;;

	}

}

void read(int& x){

    x=0;

    int y=1;

    char ch=getchar();

    while (ch<'0'||ch>'9'){

        if (ch=='-') y=-1;

        ch=getchar();

    }

    while (ch>='0'&&ch<='9'){

        x=x*10+ch-'0';

        ch=getchar();

    }

    x=x*y;

}

int main(){

	int i;

	read(n);

	for (i=1;i<=n;++i) read(a[i]);

	if (f()) printf("First\n");

	else printf("Second\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.210818117602153x):
#include<cstdio>

#define sev en

using namespace std;

#define N 100010



int a[N],cnt[2],n;



int gcd(int a,int b){

	if(b == 0)

		return a;

	return gcd(b,a % b);

}



int dg(){

	for(int i = 1;i <= n;i++)

		if(a[i] & 1)

			a[i]--;

	cnt[0] = cnt[1] = 0;

	int w = a[1];

	for(int i = 2;i <= n;i++)

		w = gcd(w,a[i]);

	for(int i = 1;i <= n;i++)

		cnt[(a[i] /= w) & 1]++;

	if(cnt[0] & 1)

	return 1;

	else if(cnt[1] > 1)

	return 0;

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1)

		return cnt[0] & 1 ? 1 : 0;

		return dg() ^ 1;

	}

}



int main(){

	scanf("%d",&n);

	for(int i = 1;i <= n;i++){ 

		scanf("%d",&a[i]);

		cnt[a[i] & 1]++;

	}

	if(cnt[0] & 1)

	printf("First");

	else if(cnt[1] > 1)

	printf("Second");

	else{

		for(int i = 1;i <= n;i++)

		if(a[i] == 1){

			printf(cnt[0] & 1 ? "First" : "Second");

			return 0;

		}

		if(dg() ^ 1)

		printf("First");

		else

		printf("Second");

	}

	return 0;

}