stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define F(i,a,b) for(int i=(a);i<=(b);++i)

#define F2(i,a,b) for(int i=(a);i<(b);++i)

#define dF(i,a,b) for(int i=(a);i>=(b);--i)

#define dF2(i,a,b) for(int i=(a);i>(b);--i)

#define dF3(i,a,b) for(int i=(a)-1;i>=(b);--i)

using namespace std;typedef long long ll;typedef double ld;int INF=0x3f3f3f3f;int INF2=0x7fffffff;ll LNF=0x3f3f3f3f3f3f3f3f;ll LNF2=0x7fffffffffffffff;



int n;

int t[4001],a[4001];

int b[4001];

int f[2001][2001];

int bit[4001];

inline void Add(int p,int x){for(;p<=n+n;p+=p&-p)bit[p]+=x;}

inline int Qur(int p){int A=0;for(;p;p-=p&-p)A+=bit[p];return A;}



int main(){ char s[3];

	scanf("%d",&n);

	F(i,1,n+n) scanf("%s%d",s,a+i), t[i]=*s=='B', b[t[i]*n+a[i]]=i;

	f[0][0]=0;

	F(i,0,n){

		memset(bit,0,sizeof bit);

		F(j,1,n+n) Add(j,1);

		F(j,1,i) Add(b[j],-1);

		F(j,i?0:1,n){

			if(j) Add(b[n+j],-1);

			f[i][j]=INF;

			if(i) f[i][j]=min(f[i][j],f[i-1][j]+Qur(b[i]));

			if(j) f[i][j]=min(f[i][j],f[i][j-1]+Qur(b[n+j]));

		}

	} printf("%d",f[n][n]);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<cctype>

#include<cmath>

#include<algorithm>

#define reg register

#define max(a,b) (a>b?a:b)

#define min(a,b) (a<b?a:b)

typedef long long ll;

template<typename T>inline T read(){

    reg T x=0,f=1;reg char ch=getchar();

    for(;!isdigit(ch);f=ch=='-'?-1:1,ch=getchar());

    for(;isdigit(ch);x=(x*10)+(ch^48),ch=getchar());

    return x*f;

}

char buf[15];

inline void write(int v){

	if(!v){puts("0");return;}

	reg int cnt=0;

	while(v)buf[++cnt]=v%10+'0',v/=10;

	for(reg int i=cnt;i;i--)putchar(buf[i]);

	putchar('\n');

}

const int maxn=2005;

const int inf=0x7fffffff;

int f[maxn][maxn],col[maxn<<1],a[maxn<<1],p[2][maxn],c[2][maxn<<1][maxn];

char ch[10];

int main(){

	reg int n=read<int>();

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

		scanf("%s",ch);a[i]=read<int>();col[i]=ch[0]=='B'?1:0;

		p[col[i]][a[i]]=i;

	}

	for(reg int i=1;i<=n*2;i++)

		for(reg int j=0;j<=n;j++)

			c[0][i][j]=c[0][i-1][j]+(a[i-1]>j&&!col[i-1]),

			c[1][i][j]=c[1][i-1][j]+(a[i-1]>j&&col[i-1]);

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

		for(reg int j=0;j<=n;j++){

			if(!(i|j))continue;

			f[i][j]=inf;

			if(i)f[i][j]=min(f[i][j],f[i-1][j]+c[0][p[0][i]][i-1]+c[1][p[0][i]][j]);

			if(j)f[i][j]=min(f[i][j],f[i][j-1]+c[1][p[1][j]][j-1]+c[0][p[1][j]][i]);

		}

	write(f[n][n]);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include "bits/stdc++.h"

#include <random>



using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)

#define ll long long

#define MOD 1000000007LL

#define llMAX 9223372036854775807LL

#define llMIN -9223372036854775808LL

using vi = vector<ll>; // intの1次元の型に vi という別名をつける

using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける



ll n,k,x,y;



int main(){

  ll ans=0;

  ll D=365;

  cin>>ans;

  vi c(26);

  vi last(26);

  vvi data(D, vi(26));  // N * M の2次元配列

  for(ll i=0;i<26;i++){

    cin>>c[i];

  }

  for(ll i=0;i<D;i++){

    for(ll j=0;j<26;j++){

      cin>>data[i][j];

    }

  }





  ll sc=0;

  ll sct=0;

  ll maxid=-1;

  for(ll i=0;i<D;i++){

    sc=-922337203685477580LL;

    maxid=0;

    for(ll j=0;j<26;j++){

      ll l=i-last[j];

      sct=data[i][j]-(l*l-l)/2*c[j];

      if (sc<sct){

        sc=sct;

        maxid=j;

      }

    }

    last[maxid]=i;

    cout<<(maxid+1)<<endl;

  }









  return 0;

}

// Optimized solution to the same problem (faster):
#include "bits/stdc++.h"

#include <random>



using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)

#define ll long long

#define MOD 1000000007LL

#define llMAX 9223372036854775807LL

#define llMIN -9223372036854775808LL

using vi = vector<ll>; // intの1次元の型に vi という別名をつける

using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける



ll n,k,x,y;



int main(){

  ll ans=0;

  ll D=5;

  cin>>D;

  vi c(26);

  vi last(26,-1);

  vvi data(D, vi(26));  // N * M の2次元配列

  ll factscore=0;





  for(ll i=0;i<26;i++){

    cin>>c[i];

  }

  for(ll i=0;i<D;i++){

    for(ll j=0;j<26;j++){

      cin>>data[i][j];

    }

  }





  ll sc=0;

  ll sct=0;

  ll maxid=-1;

  for(ll i=0;i<D;i++){

    sc=-922337203685477580LL;

    maxid=0;

    

    for(ll j=0;j<26;j++){

      ll l=i-last[j];

      sct=(l*l-l)/2*c[j];

      factscore-=sct;

      sct=data[i][j]+sct;

      if (sc<sct){

        sc=sct;

        maxid=j;

      }

    }

    factscore+=sc;

    last[maxid]=i;

    cout<<(maxid+1)<<endl;

  }



  //cout<<factscore<<endl;





  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cstring>

#include <cstdlib>

#include <algorithm>

#include <set>

#include <map>

#define INF 0x3f3f3f3f

using namespace std;

char ka[734567];

struct node

{

    char a;

    struct node * next;

    struct node * rnext;

};

int main()

{

    scanf("%s", ka);

    struct node *head = (struct node*)malloc(sizeof(struct node));

    head->next = head->rnext = NULL;

    struct node *tail = (struct node*)malloc(sizeof(struct node));

    tail = head;

    for(int i=0; ka[i]; i++)

    {

        struct node *p = (struct node *)malloc(sizeof(struct node));

        p->a = ka[i];

        p->next = NULL;

        p->rnext = tail;

        tail->next = p;

        tail = p;

    }

    int num = 0;

    int f = 0;

    while(1)

    {

        if(head->next == tail)

        {

            f = 1;

            break;

        }

        else

        {

            struct node * p = head->next;

            while(p)

            {

                if(p==head->next)

                    p = p->next;

                if(p->next!=NULL)

                {

                    if(p->rnext->a!=p->next->a)

                    {

                        p->rnext->next = p->next;

                        p->next->rnext = p->rnext;

                        num++;

                        free(p);

                        break;

                    }

                    else

                        p = p->next;

                }

                else

                {

                    f = 1;

                    break;

                }

            }

            if(f)

                break;

        }

    }

    if(num%2)

        printf("First\n");

    else

        printf("Second\n");

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string.h>

#include <stdio.h>

#include <queue>

#include <vector>

#include <algorithm>

using namespace std;

const int Max=3e5+100;

char str[Max];

int main(){

    scanf("%s", str);

    int len=strlen(str);

    if(str[len-1]!=str[0]){

        if(len%2)printf("First\n");

        else printf("Second\n");

    }

    else {

        int num=0, ans=0;

        char pos=str[0];

        for(int a=0; a<len; a++){

            if(str[a]==pos)ans+=max(0, num-1), num=0;

            else num++;

        }

        //printf("%d\n", ans);

        if(ans%2==0)printf("Second\n");

        else printf("First\n");

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

    string s;

    int buc[30] = {};

    cin >> s;

    for (int i = 0; i < s.size(); i++)

        buc[s[i] - '0']++;

    int cnt = 0;

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

        if (buc[i])

            cnt++;

    if (cnt == 2)

        cout << "Second" << endl;

    else

    {

        if (s[0] == s[s.size() - 1])

            cout << (s.size() % 2 ? "Second" : "First") << endl;

        else

            cout << (s.size() % 2 ? "First" : "Second") << endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define N 200010



using namespace std;



char str[N];

bool ok;



int main()

{

    scanf("%s",str);

    int len=strlen(str);

    int i;

    ok=true;

    for(i=0;i<len-2;i++)

    {

        if(str[i]!=str[i+2])ok=false;

    }

    if(!ok)

    {

        if(str[0]==str[len-1])--len;

        if(len%2==1)ok=false;

        else ok=true;

    }

    if(!ok)printf("First\n");

    else printf("Second\n");

}


// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

    char s[100005];

    scanf("%s",s);

    int n=strlen(s);

    if(s[0]==s[n-1])

        n--;

    if(n&1)

        printf("First\n");

    else

        printf("Second\n");

}


// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



using VS = vector<string>;    using LL = long long;

using VI = vector<int>;       using VVI = vector<VI>;

using PII = pair<int, int>;   using PLL = pair<LL, LL>;

using VL = vector<LL>;        using VVL = vector<VL>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define PB push_back

#define EB emplace_back

#define MP make_pair

#define SZ(a) int((a).size())

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

#define debug(x) cerr << #x << ": " << x << endl

const int INF = 1e9;                          const LL LINF = 1e16;

const LL MOD = 1000000007;                    const double PI = acos(-1.0);

int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };



/* -----  2018/02/27  Problem: 064_arc_b / Link: https://abc048.contest.atcoder.jp/tasks/arc064_b?lang=en  ----- */

/* ------問題------



長さ 3 以上の文字列 s があります。 s の中に同一の文字が隣り合う箇所はありません。

高橋君と青木君がゲームで勝負します。 二人は交互に次の操作を行います。 高橋君が先手です。

s から両端以外の文字をひとつ取り除く。 ただし、その文字を取り除くことで、s の中に同一の文字が隣り合う箇所ができる場合、その文字を取り除くことはできない。

先に操作を行えなくなった人が負けです。 二人が最適に行動したとき、どちらが勝つかを判定してください。



-----問題ここまで----- */

/* -----解説等-----



終了条件は端が一緒で文字列が奇数のとき

端が異なって文字列が偶数のとき

手によれず勝てた



----解説ここまで---- */



LL N;



LL ans = 0LL;



int main() {

	cin.tie(0);

	ios_base::sync_with_stdio(false);



	string s;

	cin >> s;

	cout << ((s.front() == s.back())^(SZ(s)%2)?"First":"Second") << "\n";



	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string.h>

#define LL long long

using namespace std;

const int maxn=1e5+10;

int n;

char a[maxn];

int main()

{

    while(scanf("%s",a)!=EOF)

    {

        int ans=0;

        int len=strlen(a);

        for(int i=1; i<len-1; i++)

            if(a[i-1]!=a[i+1])

			 ans++;

        if(ans==0)

        {

            printf("Second\n");

            continue;

        }

        if(a[0]!=a[len-1])

		  {

		    if(len%2==1)

			printf("%s\n","First");

			else

			printf("%s\n","Second");

		  	

		  }

	  else if(len%2==1)

			printf("%s\n","Second");

			else

			printf("%s\n","First");	

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char s[100001],ss[100001];

int main()

{    

	scanf("%s",s+1);

	register int sum=0,ans=0,l=strlen(s+1);

	while(1)

	{

		for(register int i=2;i<l;++i)

		{

			if(s[i]!='\0')

			{

				register int x=i-1;

				while(s[x]=='\0')

					--x;

				if(s[x]!=s[i+1])

					s[i]='\0',++sum;

            }        

		}        

		register int cnt=0;

		for(register int i=1;i<=l;++i)

			if(s[i]!='\0')

				ss[++cnt]=s[i];

		for(register int i=1;i<=l;++i)

			s[i]=ss[i];

		l=cnt;

		if(sum==ans)

			break;

		ans=sum;

	}    

	if(sum%2) return printf("First"),0;

	else return printf("Second"),0;

} 

// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define LL long long

using namespace std;



const int N=1e5+10;

int len,Cnt;

char a[N];



int main ()

{

	scanf ("%s", a+1);

	len=strlen (a+1);

	for (int i=1;i<=len>>1;++i)

		if (a[i]!=a[len-i+1]) Cnt++;

	if (Cnt==0) {

		puts ("Second");

		return 0;

	}	

	a[1]==a[len]? (len & 1?puts ("Second") : puts ("First") ) : (len & 1?puts ("First") : puts ("Second") );

	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

char s[100005];

inline int getstring(char *_s){

	int l=0;

	for(char ch=getchar();ch!='\n';ch=getchar(),l++)

		_s[l]=ch;

	return l;

}

int main(){

	int l=getstring(s);

	printf("%s",(s[0]==s[l-1])^(l%2)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstring>

using namespace std;

int main()

{

   char m[100010];

   int a,b;

   while (cin>>m)

    {

       a=strlen(m);

       if (m[0]==m[a-1])

	   b=a-3;

       else 

	   b=a-2;

       if (b%2==1)

	   cout<<"First"<<endl;

       else 

	   cout<<"Second"<<endl;

    }

   return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm> 

#include<string.h>

using namespace std;

int main()

{

	int b;

	string s;

	while(cin>>s)

	{

	int a=s.length();

	if(s[0]==s[a-1])

	b=a-3;

	else

	b=a-2;

	if(b%2)

	cout<<"First"<<endl;

	else

	cout<<"Second"<<endl;

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


#include<iostream>

#include<string.h>

using namespace std;

int main()

{

	string s;

	int t;

	cin>>s;

	t=s.size();

	if(s[0]==s[t-1])

	{

	if(t%2==0)

	cout<<"First"<<endl;

	if(t%2!=0)

	cout<<"Second"<<endl;

	}

	else 

	{

		if(t%2==0) 

		cout<<"Second"<<endl;

		else

		cout<<"First"<<endl;

		}

		return 0;

	}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstring>

using namespace std;

int main(){

  string s;

  cin>>s;

  if(s[0]==s[s.length()-1]){

    if(s.length()%2==0)

      cout<<"First"<<endl;

    else cout<<"Second"<<endl;

  }

  else {

    if(s.length()%2==0)

      cout<<"Second"<<endl;

    else cout<<"First"<<endl;

  }

  return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstring> 

#include<iostream> 

using namespace std;

int main()

{

	int flag=0,count=0;

	char a[100005];

	cin>>a;

	(a[0]==a[strlen(a)-1])?(flag=1):0;

	count+=flag+strlen(a);

	cout<<((count&1)?"First":"Second");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bits/stdc++.h>



using namespace std;



char c[100005];

int main()

{

    cin>>c;

    int len=strlen(c);

    if(c[0]==c[len-1])

        len++;

    if(len%2==0)

        cout<<"Second"<<endl;

    else

    cout << "First" << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <algorithm>

#include <bitset>

#include <cstdio>

#include <cstring>

#include <iostream>

#include <map>

#include <queue>

#include <set>

#include <vector>

#define MP make_pair

#define ls (o << 1)

#define rs (o << 1 | 1)

#define mid ((L + R) >> 1)

#define eps (1e-5)

using namespace std;

typedef long long LL;

const LL mod = 1e9 + 7;

int n, m;

typedef pair<int, int> PII;

char s[100050];

int main() {

    scanf("%s", s);

    auto len = strlen(s);

    if (s[0] != s[len - 1] && len % 2 == 0) {

        puts("Second");

        return 0;

    }

    if (s[0] != s[len - 1] && len % 2 == 1) {

        puts("First");

        return 0;

    }

    printf("%s\n", len & 1 ? "Second" : "First");

    return 0;

}

//苏子曰：“客亦知夫（fú）水与月乎？逝者如斯[36]，而未尝往也；盈虚者如彼[37]，而卒[38]莫消长(zhǎng)也。盖将自其变者而观之，则天地曾（zēng）不能以一瞬；自其不变者而观之，则物与我皆无尽也，而又何羡乎！且夫（fú）天地之间，物各有主，苟（gǒu）非吾之所有，虽一毫而莫取。惟江上之清风，与山间之明月，耳得之而为声，目遇之而成色，取之无禁，用之不竭，是造物者之无尽藏[39]（zàng）也，而吾与子之所共适[40]。”

//客喜而笑，洗盏(zhǎn)更（gēng）酌[41]（zhuó）。肴（yáo）核既尽[42]，杯盘狼籍。相与枕藉[43]（jiè）乎舟中，不知东方之既白[44]

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    char s[100010];

    int ans,len;

    scanf("%s",s);len=strlen(s);

    if (s[0]==s[len-1])

    {

        if (len & 1) ans=2;

        else ans=1;

    }

    else

    {

        if (len & 1) ans=1;

        else ans=2;

    }

    if (ans==1) cout<<"First"<<endl;

    else cout<<"Second"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstring>

#include <cstdio>

#include <string>

using namespace std;

string s;

int main(){

		//freopen("main.in","r",stdin);

		cin >> s;

		int len;

		if(s[0] == s[s.length()-1]) {

				len = s.length() - 3;

		}

		else{

				len = s.length() - 2;

		}

		if(len % 2){

			   	cout << "First" << endl;



		}else {

				cout << "Second" << endl;

		}

		return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char s[100010];

int main(){

	scanf("%s",s);

	int len=strlen(s);

	int ans=(s[0]==s[len-1])^(len%2);

	if(!ans)cout<<"Second"<<endl;

	else cout<<"First"<<endl;

}




// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

string s;

int main(){

	cin >> s;

	if(s[0] == s[s.length() - 1]){

		if(s.length() % 2)

			cout << "Second" << endl;

		else

			cout << "First" << endl;

	}else{

		if(s.length() % 2)

			cout << "First" << endl;

		else

			cout << "Second" << endl;

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



char st[100010];



int main() {

	scanf("%s", st);

	int l = strlen(st);

	if (st[0] == st[l-1]) {

		if (l % 2 == 1) {

			puts("Second");

		} else {

			puts("First");

		}

	} else {

		if (l % 2 == 1) {

			puts("First");

		} else {

			puts("Second");

		}

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



char s[100010];



int main(){

    scanf("%s",s);

    int len = strlen(s);

    if(s[0] == s[len-1]) len--;

    if(len & 1) printf("First");

    else printf("Second");



    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int n; char s[100010];

int main()

{

	scanf("%s",s); n=strlen(s);

	if(s[0]==s[n-1]) --n;

	puts(n%2 ? "First" : "Second");

	return 0;

}

// Fastest known solution for this problem: