stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=100010;

inline char nc(){

    static char buf[100000],*p1=buf,*p2=buf;

    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;

}

inline int read(){

    char ch=nc();int sum=0;

    while(!(ch>='0'&&ch<='9'))ch=nc();

    while(ch>='0'&&ch<='9')sum=sum*10+ch-48,ch=nc();

    return sum;

}

struct E{

	int t,xt;

}e[N<<1];



int h[N],cnt;



void adge(int f,int t){

	e[++cnt]=(E){t,h[f]};h[f]=cnt;

}



int dp[N][2],dan[N];



void dfs1(int u,int fa){	

	for(int i=h[u];~i;i=e[i].xt) if(e[i].t!=fa){

		dfs1(e[i].t,u);

		if(dan[e[i].t]) dp[u][1]++;

		else dp[u][0]++;

	}

	if(dp[u][1]+dp[u][0]==0){

		dan[u]=1;

	}

	else if(dp[u][1]>1){

			puts("First");

			exit(0);

	}

	else if(dp[u][1]==1){

		dan[u]=0;

	}

	else if(dp[u][1]==0){

		dan[u]=1;

	}

}

			

void dfs2(int u,int fa){

	if(dp[u][1]!=1){

		puts("First");

		exit(0);

	}

	for(int i=h[u];~i;i=e[i].xt) if(e[i].t!=fa){

		int t[2];

		t[0]=dp[u][0]-(!dan[e[i].t]);

		t[1]=dp[u][1]-dan[e[i].t];

		if(t[1]+t[0]==0){

			dp[e[i].t][1]++;

		}

		else if(t[1]==1){

			dp[e[i].t][0]++;

		}

		else if(t[1]==0){

			dp[e[i].t][1]++;

		}

		dfs2(e[i].t,u);	

	}

}

		

int main(){

	memset(h,cnt=-1,sizeof(h));

	int n;

	n=read();

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

		int a,b;

		a=read();

		b=read();

		adge(a,b);

		adge(b,a);

	}

	dfs1(1,1);

	dfs2(1,1);

	puts("Second");

	return 0;

}


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

using namespace std;

int sum,h[100009];

int n,x,y,s[100009],f[100009];

struct tt{

    int to;

    int next;

    double w;

};

tt r[200009];

inline void add(int a,int b)

{

    r[++sum].to=b;

    r[sum].next=h[a];

    h[a]=sum;

    r[++sum].to=a;

    r[sum].next=h[b];

    h[b]=sum;

}

inline int boo(int x,int fa)

{

    s[x]=1;

    int ans=0;

    for(int i=h[x];i;i=r[i].next)

    {

        if(r[i].to==fa)

          continue;

        if(boo(r[i].to,x))

          return 1;

        if(s[r[i].to])

        {

            ans++;

            s[x]=0;

            if(ans==2)

              return 1;

        }

    }

    return 0;

}

int main(){

    scanf("%d",&n);

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

    {

        scanf("%d%d",&x,&y);

        add(x,y);

    }

    if(boo(1,0)||s[1])

      printf("First");

    else 

      printf("Second");

      return 0;

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

#include<cstdio>

#include<vector>

using namespace std;

vector<int> m[100005];

int n,u,v;

int dfs(int pos,int pre){

    int len=m[pos].size(),ans=0;

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

        if(m[pos][i]!=pre) ans+=dfs(m[pos][i],pos);

	if(ans>=2){

        printf("First\n");

        exit(0);

    }

    else if(ans==0) return 1;

    else return 0;

}

int main(){

    scanf("%d",&n);

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

        scanf("%d%d",&u,&v);

        m[u].push_back(v);

        m[v].push_back(u);

    }

    if(dfs(1,-1)) printf("First\n");

    else printf("Second\n");

    return 0;

}

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

using namespace std;

const int maxn=1e5+10;

struct edge{int v,nxt;}e[maxn<<1];

int head[maxn],ecnt=0;

void add(int u,int v)

{

	e[++ecnt]=(edge){v,head[u]},head[u]=ecnt;

	e[++ecnt]=(edge){u,head[v]},head[v]=ecnt;

}

int fa[maxn],n;

bool vis[maxn];

bool ans=1;

void dfs(int u,int pre)

{

	fa[u]=pre;

	for(int i=head[u];~i;i=e[i].nxt)

	{

		int v=e[i].v;

		if(v==pre)continue;

		dfs(v,u);

	}

	if(u==1)

	{

		if(vis[u]==0)ans=0;

	}

	else 

	{

		if(!vis[u])

		{

			if(!vis[fa[u]])vis[fa[u]]=1,vis[u]=1;

			else ans=0;

		}	

	}

	

}

int main()

{

	memset(head,-1,sizeof(head));

	scanf("%d",&n);

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

	{

		int u,v;

		scanf("%d%d",&u,&v);

		add(u,v);

	}

	dfs(1,0);

	printf("%s\n",!ans?"First":"Second");

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

#include<cstring>

#include<cstdio>

#include<algorithm>

#include<vector>

#define gc getchar()

#define N 100010

#define pb push_back

#define debug(x) cerr<<#x<<"="<<x

#define sp <<" "

#define ln <<endl

using namespace std;

inline int inn()

{

	int x,ch;while((ch=gc)<'0'||ch>'9');

	x=ch^'0';while((ch=gc)>='0'&&ch<='9')

		x=(x<<1)+(x<<3)+(ch^'0');return x;

}

int no_ans,f[N],g[N];vector<int> t[N];

int dfs(int x,int fa=0)

{

	if(no_ans) return 0;int n=(int)t[x].size();

	if(fa&&n==1) return f[x]=1,g[x]=0;int c=0,fc=0;

	for(int i=0,y;i<n;i++) if((y=t[x][i])^fa)

		dfs(y,x),c+=(g[y]==0),fc|=f[y];

	if(c==0) f[x]=1,g[x]=fc;

	else if(c==1) f[x]=0,g[x]=1;

	else f[x]=g[x]=0,no_ans=1;

	return 0;

}

int main()

{

	int n=inn();if(n&1) return !printf("First\n");

	for(int i=1,u,v;i<n;i++) u=inn(),v=inn(),t[u].pb(v),t[v].pb(u);

	return dfs(1),!printf("%s\n",(no_ans||!g[1])?"First":"Second");

}

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

using namespace std;

const int maxn=1e5+10;

struct edge{int v,nxt;}e[maxn<<1];

int head[maxn],ecnt=0;

void add(int u,int v)

{

	e[++ecnt]=(edge){v,head[u]},head[u]=ecnt;

	e[++ecnt]=(edge){u,head[v]},head[v]=ecnt;

}

int fa[maxn],n;

bool vis[maxn];

bool ans=1;

void dfs(int u,int pre)

{

	fa[u]=pre;

	for(int i=head[u];~i;i=e[i].nxt)

	{

		int v=e[i].v;

		if(v==pre)continue;

		dfs(v,u);

	}

	if(u==1)

	{

		if(vis[u]==0)ans=0;

	}

	else 

	{

		if(!vis[u])

		{

			if(!vis[fa[u]])vis[fa[u]]=1,vis[u]=1;

			else ans=0;

		}	

	}

	

}

int main()

{

	memset(head,-1,sizeof(head));

	scanf("%d",&n);

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

	{

		int u,v;

		scanf("%d%d",&u,&v);

		add(u,v);

	}

	dfs(1,0);

	printf("%s\n",!ans?"First":"Second");

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

#include<vector>

using namespace std;

const int INF=1e9+7;

const int N=100005;

int n;

vector<int>G[N];

int Dfs(int u,int fa) {

	int ret=1;

	for(int i=0;i<G[u].size();i++) {

		int v=G[u][i];

		if(v==fa) continue;

		ret+=Dfs(v,u);

	}

	if(ret<1||ret>=3) return -INF;

	return ret%2;

}

int main() {

	scanf("%d",&n);

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

		scanf("%d %d",&u,&v);

		G[u].push_back(v);

		G[v].push_back(u);

	}

	if(Dfs(1,1)!=0)

		printf("First\n");

	else printf("Second\n");

	return 0; 

}

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

using namespace std;

const int maxn=1e5+10;

struct edge{int v,nxt;}e[maxn<<1];

int head[maxn],ecnt=0;

void add(int u,int v)

{

	e[++ecnt]=(edge){v,head[u]},head[u]=ecnt;

	e[++ecnt]=(edge){u,head[v]},head[v]=ecnt;

}

int fa[maxn],n;

bool vis[maxn];

bool ans=1;

void dfs(int u,int pre)

{

	fa[u]=pre;

	for(int i=head[u];~i;i=e[i].nxt)

	{

		int v=e[i].v;

		if(v==pre)continue;

		dfs(v,u);

	}

	if(u==1)

	{

		if(vis[u]==0)ans=0;

	}

	else 

	{

		if(!vis[u])

		{

			if(!vis[fa[u]])vis[fa[u]]=1,vis[u]=1;

			else ans=0;

		}	

	}

	

}

int main()

{

	memset(head,-1,sizeof(head));

	scanf("%d",&n);

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

	{

		int u,v;

		scanf("%d%d",&u,&v);

		add(u,v);

	}

	dfs(1,0);

	printf("%s\n",!ans?"First":"Second");

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	if(int(G[u].size())==1)

		f[u]=1;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}

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

#include<vector>

#include<algorithm>

using namespace std;



#define MAXN 100000

int N,Root;

vector<int> G[MAXN+5];



int dfs(int u,int fa){//0黑 1百 -1必胜

	if(u!=Root&&G[u].size()==1)

		return 0;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v!=fa){

			int tmp=dfs(v,u);

			if(tmp==-1)

				return -1;

			cnt+=tmp==0;

		}

	}

	if(cnt>=2)

		return -1;

	if(u==Root)

		return cnt!=1;

	return cnt==1;

}



int main(){

	scanf("%d",&N);

	for(int i=1;i<=N-1;i++){

		int u,v;

		scanf("%d%d",&u,&v);

		G[u].push_back(v);

		G[v].push_back(u);

	}

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

		if(G[i].size()==1){

			Root=i;

			break;

		}

	}

	puts(dfs(Root,-1)?"First":"Second");

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}//

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

#include<vector>

#include<algorithm>

using namespace std;



#define MAXN 100000

int N,Root;

vector<int> G[MAXN+5];



int dfs(int u,int fa){//0黑 1百 -1必胜

	if(u!=Root&&G[u].size()==1)

		return 0;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v!=fa){

			int tmp=dfs(v,u);

			if(tmp==-1)

				return -1;

			cnt+=tmp==0;

		}

	}

	if(cnt>=2)

		return -1;

	if(u==Root)

		return cnt!=1;

	return cnt==1;

}



int main(){

	scanf("%d",&N);

	for(int i=1;i<=N-1;i++){

		int u,v;

		scanf("%d%d",&u,&v);

		G[u].push_back(v);

		G[v].push_back(u);

	}

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

		if(G[i].size()==1){

			Root=i;

			break;

		}

	}

	puts(dfs(Root,-1)?"First":"Second");

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	if(int(G[u].size())==1)

		f[u]=1;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}

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

#include<vector>

#include<algorithm>

using namespace std;



#define MAXN 100000

int N,Root;

vector<int> G[MAXN+5];



int dfs(int u,int fa){//0黑 1百 -1必胜

	if(u!=Root&&G[u].size()==1)

		return 0;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v!=fa){

			int tmp=dfs(v,u);

			if(tmp==-1)

				return -1;

			cnt+=tmp==0;

		}

	}

	if(cnt>=2)

		return -1;

	if(u==Root)

		return cnt!=1;

	return cnt==1;

}



int main(){

	scanf("%d",&N);

	for(int i=1;i<=N-1;i++){

		int u,v;

		scanf("%d%d",&u,&v);

		G[u].push_back(v);

		G[v].push_back(u);

	}

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

		if(G[i].size()==1){

			Root=i;

			break;

		}

	}

	puts(dfs(Root,-1)?"First":"Second");

    return 0;

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}//

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

#include<vector>

#include<algorithm>

using namespace std;



#define MAXN 100000

int N,Root;

vector<int> G[MAXN+5];



int dfs(int u,int fa){//0黑 1百 -1必胜

	if(u!=Root&&G[u].size()==1)

		return 0;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v!=fa){

			int tmp=dfs(v,u);

			if(tmp==-1)

				return -1;

			cnt+=tmp==0;

		}

	}

	if(cnt>=2)

		return -1;

	if(u==Root)

		return cnt!=1;

	return cnt==1;

}



int main(){

	scanf("%d",&N);

	for(int i=1;i<=N-1;i++){

		int u,v;

		scanf("%d%d",&u,&v);

		G[u].push_back(v);

		G[v].push_back(u);

	}

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

		if(G[i].size()==1){

			Root=i;

			break;

		}

	}

	puts(dfs(Root,-1)?"First":"Second");

    return 0;

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	if(int(G[u].size())==1)

		f[u]=1;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}

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

#include<vector>

#include<cstring>

#include<cmath>

#include<iostream>

#include<algorithm>

using namespace std;

const int MAXN=100000;

vector<int> d[MAXN+5];

int n;

int dfs(int u,int fa)

{

	int res=0,v;

	for(int i=0;i<d[u].size();i++)

	{

		v=d[u][i];

		if(v!=fa)

			res+=dfs(v,u);

	}

	if(res>=2)

	{

		printf("First");

		exit(0);

	}

	else if(res==0)

		return 1;

	return 0;

}

int main()

{

	scanf("%d",&n);

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

	{

		int u,v;

		scanf("%d%d",&u,&v);

		d[u].push_back(v);

		d[v].push_back(u);

	}

	if(dfs(1,0))

		printf("First");

	else

		printf("Second");

	return 0;

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}//

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

#include<vector>

#include<cstring>

#include<cmath>

#include<iostream>

#include<algorithm>

using namespace std;

const int MAXN=100000;

vector<int> d[MAXN+5];

int n;

int dfs(int u,int fa)

{

	int res=0,v;

	for(int i=0;i<d[u].size();i++)

	{

		v=d[u][i];

		if(v!=fa)

			res+=dfs(v,u);

	}

	if(res>=2)

	{

		printf("First");

		exit(0);

	}

	else if(res==0)

		return 1;

	return 0;

}

int main()

{

	scanf("%d",&n);

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

	{

		int u,v;

		scanf("%d%d",&u,&v);

		d[u].push_back(v);

		d[v].push_back(u);

	}

	if(dfs(1,0))

		printf("First");

	else

		printf("Second");

	return 0;

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

#include <vector>

using namespace std;

const int MAXn = 1e5 + 10;

vector<int> g[MAXn];

int n, odd[MAXn], even[MAXn];



int dfs(int v, int par) {

	if (g[v].size() == 1 && par != 0)

		return 1;

	int cnt = 0;

	for (int i = 0; i < g[v].size(); i++)

		if (g[v][i] != par) {

			cnt += dfs(g[v][i], v);

			

		}

	if (cnt > 1) {

		cout << "First";

		exit(0);

	}

	if (cnt == 1) 

		return 0;

	if (par == 0) {

		cout << "First";

		exit(0);

	}

		

	return 1;

}





int main() {

	cin >> n;

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

		int u, v;

		cin >> u>> v;

		g[u].push_back(v);

		g[v].push_back(u);

	}

	dfs(1, 0);

	

	cout << "Second";

	

}

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

using namespace std;

int n,head[100005],cnt,in[100005],flag,vis[100005];

struct edge{int to,next;

}e[200005];

void add(int x,int y)

{

	e[cnt].to=y;

	e[cnt].next=head[x];

	head[x]=cnt++;

}

void dfs(int u,int pre)

{

	int tot=0;

	for(int i=head[u];i;i=e[i].next)

	{

		if(e[i].to==pre)continue;

		dfs(e[i].to,u);

	}

	if(u==1&&!vis[u])flag=1;

	if(!vis[u])

	{

		vis[u]++;vis[pre]++;

	}

	if(vis[u]!=1)flag=1;

}

int main()

{

	flag=0;cnt=1;

	scanf("%d",&n);

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

	{

		int x,y;scanf("%d%d",&x,&y);add(x,y);add(y,x);

	}

	dfs(1,0);



	if(flag)puts("First");

	else puts("Second");

  return 0;

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

#include<cstdio>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<vector>

using namespace std;

#define MAXN 100000

int n,u,v,F;

vector<int> G[MAXN+5];

int dfs(int x,int fa){

	int p=0;

	for(int i=0;i<G[x].size();i++){

		int nxt=G[x][i];

		if(nxt==fa)continue;

		p+=dfs(nxt,x);

	}

	if(p>=2)F=1;

	return p^1;

}

int main()

{

	scanf("%d",&n);

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

		scanf("%d%d",&u,&v);

		G[u].push_back(v);

		G[v].push_back(u);

	}

	if(dfs(1,0)==0&&!F)printf("Second\n");

	else printf("First");

}

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

using namespace std;

int n,head[100005],cnt,in[100005],flag,vis[100005];

struct edge{int to,next;

}e[200005];

void add(int x,int y)

{

	e[cnt].to=y;

	e[cnt].next=head[x];

	head[x]=cnt++;

}

void dfs(int u,int pre)

{

	int tot=0;

	for(int i=head[u];i;i=e[i].next)

	{

		if(e[i].to==pre)continue;

		dfs(e[i].to,u);

	}

	if(u==1&&!vis[u])flag=1;

	if(!vis[u])

	{

		vis[u]++;vis[pre]++;

	}

	if(vis[u]!=1)flag=1;

}

int main()

{

	flag=0;cnt=1;

	scanf("%d",&n);

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

	{

		int x,y;scanf("%d%d",&x,&y);add(x,y);add(y,x);

	}

	dfs(1,0);



	if(flag)puts("First");

	else puts("Second");

  return 0;

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	if(int(G[u].size())==1)

		f[u]=1;

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}

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

using namespace std;

int n,head[100005],cnt,in[100005],flag,vis[100005];

struct edge{int to,next;

}e[200005];

void add(int x,int y)

{

	e[cnt].to=y;

	e[cnt].next=head[x];

	head[x]=cnt++;

}

void dfs(int u,int pre)

{

	int tot=0;

	for(int i=head[u];i;i=e[i].next)

	{

		if(e[i].to==pre)continue;

		dfs(e[i].to,u);

	}

	if(u==1&&!vis[u])flag=1;

	if(!vis[u])

	{

		vis[u]++;vis[pre]++;

	}

	if(vis[u]!=1)flag=1;

}

int main()

{

	flag=0;cnt=1;

	scanf("%d",&n);

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

	{

		int x,y;scanf("%d%d",&x,&y);add(x,y);add(y,x);

	}

	dfs(1,0);



	if(flag)puts("First");

	else puts("Second");

  return 0;

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

#include<map>

#include<stack>

#include<cmath>

#include<queue>

#include<cstdio>

#include<cstring>

#include<climits>

#include<cstdlib>

#include<vector>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

#define ULL unsigned long long

int read(){

	int f=1,x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return f*x;

}

#define MAXN 200005

#define INF 0x3f3f3f3f

bool f[MAXN+5],pan;

vector<int> G[MAXN+5];

void DFS(int u,int fa){

	int cnt=0;

	for(int i=0;i<int(G[u].size());i++){

		int v=G[u][i];

		if(v==fa) continue;

		DFS(v,u);

		if(f[v]==1)

			cnt++;

	}

	if(cnt>=2){

		puts("First");

		exit(0);

	}

	f[u]=cnt^1;

	return ;

}

int main(){

	int n=read();

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

		int u=read(),v=read();

		G[u].push_back(v);

		G[v].push_back(u);

	}

	DFS(1,0);

	puts(f[1]?"First":"Second");

	return 0;

}//

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

using namespace std;

int n,head[100005],cnt,in[100005],flag,vis[100005];

struct edge{int to,next;

}e[200005];

void add(int x,int y)

{

	e[cnt].to=y;

	e[cnt].next=head[x];

	head[x]=cnt++;

}

void dfs(int u,int pre)

{

	int tot=0;

	for(int i=head[u];i;i=e[i].next)

	{

		if(e[i].to==pre)continue;

		dfs(e[i].to,u);

	}

	if(u==1&&!vis[u])flag=1;

	if(!vis[u])

	{

		vis[u]++;vis[pre]++;

	}

	if(vis[u]!=1)flag=1;

}

int main()

{

	flag=0;cnt=1;

	scanf("%d",&n);

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

	{

		int x,y;scanf("%d%d",&x,&y);add(x,y);add(y,x);

	}

	dfs(1,0);



	if(flag)puts("First");

	else puts("Second");

  return 0;

}