stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
/*

    f[x]表示以x为根的子树中，先把x染成白之后对方下一步是否会在x子树中操作 

    g[x]表示以x为根的子树中，先手是否能获得胜利。

    

    当我们枚举致胜节点为root时，先手能赢当且仅当g[root]=1. 

	

	初始化(对于单点)：

	     g[x]=1;

	     f[x]=0;

	

	

	转移：

	    1.f[x]等于所有儿子的g的位或

		 

		 这个不难理解，因为只要有一个儿子的g为1的话，我们先把x染白，

		 对方一定会在g为1的这个子树中操作，不然就输了。

		 

		2.g[x]等于所有儿子的f的位与

		

		 这个也不难理解，因为只有所有儿子的f都为1了，我们才可以依次把每个儿子染白

		 最后依然有先手优势来染x，然后就赢了hhhh

	

	考虑上述算法仅适用于根固定的情况 ，我们可以把它扩展一下，

	第一遍dfs预处理以某个节点为根的函数值，

	第二遍dfs在每个节点O(1)计算出函数值。 

*/

#include<iostream>

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<vector>

#define ll long long

#define maxn 100005

#define pb push_back

using namespace std;

vector<int> son[maxn];

int n,m,g[maxn];

int f[maxn];

bool win=0;



void dfs1(int x,int fa){

	int sz=son[x].size()-1,to;

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

	

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

		to=son[x][i];

		if(to==fa) continue;;

		dfs1(to,x);

		f[x]|=g[to],g[x]&=f[to];

	}

}



void dfs2(int x,int fa,int fa_f,int fa_g){

	int sz=son[x].size()-1,to;

	int hzf[sz+2],hzg[sz+2];

	hzf[sz+1]=1,hzg[sz+1]=0;

	

	if(g[x]&fa_f) win=1;

	

	for(int i=sz;i>=0;i--){

		hzf[i]=hzf[i+1];

		hzg[i]=hzg[i+1];

		to=son[x][i];

		if(to==fa) continue;

		

		hzf[i]&=f[to];

		hzg[i]|=g[to];

	}

	

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

		to=son[x][i];

		if(to==fa) continue;

		

		dfs2(to,x,fa_g|hzg[i+1],fa_f&hzf[i+1]);

		fa_g|=g[to];

		fa_f&=f[to];

	}

}



int main(){

	int uu,vv;

	scanf("%d",&n);

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

		scanf("%d%d",&uu,&vv);

		son[uu].pb(vv);

		son[vv].pb(uu);

	}

	

	dfs1(1,0);

	dfs2(1,0,1,0);

	

	if(win) puts("First");

	else puts("Second");

	

	return 0;

}

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

using namespace std;

struct E{int v,next;}g[200005];

int n,h[100005],t,ans;

void ins(int u,int v){g[++t].v=v,g[t].next=h[u],h[u]=t;}

inline int read(){

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

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

    while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}

    return x*f;

}

int dfs(int now,int last){

	int tot=0;

	for(int i=h[now];i;i=g[i].next) if(g[i].v!=last) tot+=dfs(g[i].v,now);

	if(tot>=2){puts("First");exit(0);}

	if(tot==0) return 1;

	return 0;

}

int main(){

	int u,v;

	n=read();

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

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

		ins(u,v),ins(v,u);

	}

	ans=dfs(1,-1);

	if(ans) puts("First");

	else puts("Second");

}

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

typedef long long int ll;

typedef long double ld;

#define pb push_back

#define pii pair < int , int >

#define F first

#define S second

#define endl '\n'

#define int long long

#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")

#define kill(x) return cout<<x<<'\n', 0;

using namespace std;

const int N=2e5+100;

vector <int> g[N];

ll vis[N];

void dfs(ll v,ll p){

    for (auto u : g[v]){

        if (u==p) continue;

        dfs(u,v);

        if (vis[u]==0 && vis[v]==0){

            vis[u]=1;

            vis[v]=1;

        }

    }

}

int32_t main(){

    sync;

    ll n;

    cin >> n;

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

        ll u,v;

        cin >> u >> v;

        g[u].pb(v);

        g[v].pb(u);

    }

    dfs(1,1);

    for (int i=1;i<=n;i++) if (vis[i]==0) kill("First");

    kill("Second");

}

// Optimized solution to the same problem (faster):
//Sasayego! Sasayego! Shinzou wo Sasageyo!



#include <iostream>

#include <iomanip>

#include <algorithm>

#include <cmath>

#include <ctime>

#include <cstring>

#include <vector>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <deque>

#include <numeric>

#include <bitset>

#include <ctime>

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

#define lid (id << 1)

#define rid (lid ^ 1)

using namespace std;

typedef long long ll;

typedef long double ld;

typedef pair <ll, ll> pll;

typedef pair <int, int> pii;



const int maxN = 1e5 + 5;

const ll INF = 1e18;

const ll MOD = 1e9 + 7;



int arumin[maxN];

vector <int> G[maxN];



int LEVI(int v, int p = -1){

	int cnt[3] = {0, 0, 0};

	for (int u : G[v]){

		if (u == p)

			continue;

		cnt[LEVI(u, v)]++;

	}

	if (cnt[0] > 0 || cnt[2] > 1)

		return arumin[v] = 0;

	return arumin[v] = 2 - cnt[2];

}



int main(){

	time_t START = clock();

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	int n; scanf("%d", &n);

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

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

		G[u].push_back(v);

		G[v].push_back(u);

	}

	printf(LEVI(1) & 1 ? "Second\n" : "First\n");

	time_t FINISH = clock();

	cerr << "Execution time: " << (ld)(FINISH - START) / CLOCKS_PER_SEC * 1000.0 << " milliseconds.\n";

	return 0;

}

 


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

#define N 200010

using namespace std;



int n, q[N], l, r, deg[N];

bool vis[N], inqueue[N];

vector<int> edge[N];

int main() {

	scanf("%d", &n);

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

		int x, y;

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

		edge[x].push_back(y);

		edge[y].push_back(x);

		++deg[x]; ++deg[y];

	}

	

	l = r = 0;

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

		if (deg[i] == 1) {

			q[++r] = i;

			inqueue[i] = 1;

		}

	}



	while (l < r) {

		int nq = -1;

		int u = q[l++];

		for (int j = 0; j < edge[u].size(); ++j) {

			int v = edge[u][j];

			if (!vis[v]) {

				nq = v;

				vis[v] = 1;

				vis[u] = 1;

				break;

			}

		}

		

		if (nq == -1) continue;

		for (int i = 0; i < edge[nq].size(); ++i) {

			int v = edge[nq][i];

			if (!inqueue[v] && --deg[v] == 1) {

				q[++r] = v;

				inqueue[v] = 1;

			}

		}

	}

	

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

		if (!vis[i]) {

			puts("First");

			return 0;

		}

	}

	puts("Second");

}

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

#define MAXN 100006

#include<queue>

#include<vector>

#include<algorithm>

using namespace std;

vector<int> road[MAXN];

int n,u,v,du[MAXN],vis[MAXN];

queue<int> q;

int main()

{

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

	//freopen("blackwhite.out","w",stdout);

	scanf("%d",&n);

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

	{

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

		road[u].push_back(v);

		road[v].push_back(u);

		du[u]++;

		du[v]++;

	}

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

		if(du[i]==1) q.push(i);

	while(!q.empty())

	{

		int now=q.front();

		q.pop();

		if(vis[now]) continue;

		if(du[now]==1)

		{

			for(int i=0;i<(int)road[now].size();i++)

			{

				int nex=road[now][i];

				if(!vis[nex])

				{

					vis[nex]=vis[now]=1;

					for(int j=0;j<(int)road[nex].size();j++)

					{

						int nnex=road[nex][j];

						if(vis[nnex]) continue;

						du[nnex]--;

						if(du[nnex]==1) q.push(nnex);

					}

					break;

				}

			}

		}

	}

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

		if(!vis[i])

		{

			printf("First");

			return 0;

		}

	printf("Second");

}

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

#include <bits/stdc++.h>

using namespace std;

const int Mx = 1 << 17;

vector<int> N[Mx];



bool DFS(int v, int p = -1) {

	int c = 0;

	for(int u : N[v])

		if(u != p)

			c += DFS(u, v);

	if(c == 0) return 1;

	if(c == 1) return 0;

	cout << "First";

	exit(0);

}



int main() {

	int n; cin >> n;

	int m = 0;

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

		int u, v; cin >> u >> v;

		N[v].push_back(u);

		N[u].push_back(v);

		if(N[v].size() > N[m].size()) m = v;

		if(N[u].size() > N[m].size()) m = u;

	}

	cout << (DFS(m) ? "First" : "Second");

}

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

#define maxn 100086



using namespace std;



int n;

vector<int> v[maxn];

int x, y;



int dfs(int i, int fa){

	int cnt = 0;

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

		int to = v[i][j];

		if(to == fa) continue;

		cnt += dfs(to, i);

	}

	if(cnt > 1) printf("First"), exit(0);

	return cnt ^ 1; 

}



int main(){

	scanf("%d", &n);

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

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

		v[x].push_back(y), v[y].push_back(x);

	}

	printf(dfs(1, 0) ? "First" : "Second");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


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

#include<cctype>

#include<cstring>

#include<algorithm>

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

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

#define reg register

typedef long long ll;

template<typename T>inline T read(){

	reg T x=0;reg short f=1;reg char c=getchar();

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

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

	return x*f;

}

const int MN=100005;

struct edge{int t,nxt;}es[MN<<1];

int h[MN],cnt;

inline void ins(int s,int t){

	es[++cnt]=(edge){t,h[s]};h[s]=cnt;es[++cnt]=(edge){s,h[t]};h[t]=cnt;

}

int n,f;

inline int dfs(int st,int fa){

	if(f)return 1;

	reg int son=0;

	for(reg int i=h[st];i;i=es[i].nxt)

		if(es[i].t!=fa)son+=dfs(es[i].t,st);

	if(son>1)return f=1;

	return !son;

}

int main(){

	n=read<int>();

	for(reg int i=1;i<n;i++)ins(read<int>(),read<int>());

	reg int ans=dfs(1,0);puts((ans|f)?"First":"Second");

	return 0;

}

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

#include<iomanip>

#include<stack>

#include<queue>

#include<list>

#include<vector>

#include<set> 

#include<map>

#include<string>

#include<algorithm>

#include<cmath>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<ctime>

#define ll long long

#define db double

#define inf 200001

#define INF (int)1e9

#define mod (int)(1e9+7)

#define pi acos(-1)

#define rd(n) {n=0;char ch;int f=0;do{ch=getchar();if(ch=='-'){f=1;}}while(ch<'0'||ch>'9');while('0'<=ch&&ch<='9'){n=(n<<1)+(n<<3)+ch-48;ch=getchar();}if(f)n=-n;}

using namespace std;

int n;



struct edge{

	int y,nxt;

	edge(){}

	edge(int yy,int nn){

		y=yy,nxt=nn;

	}

}e[inf*2];

int head[inf],ecnt;



void addedge(int x,int y){

	ecnt++;

	e[ecnt]=edge(y,head[x]);

	head[x]=ecnt;

	return;

}



int siz[inf],fa[inf],far[inf],cnts[inf];



void dfs1(int u,int last){

	fa[u]=last;

	siz[u]=1;

	int mx=0;

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

		int v=e[i].y;

		if (v==last){

			continue;

		}

		cnts[u]++;

		dfs1(v,u);

		mx=max(mx,far[v]+1);

		siz[u]+=siz[v];

	}

	if (cnts[u]==1){

		far[u]=mx;

	}

	return;

}



void dfs2(int u){

	int cnt=0;

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

		int v=e[i].y;

		if (v==fa[u]){

			continue;

		}

		dfs2(v);

		if (siz[v]>0){

			cnt++;

		}

	}

	if (cnt>=2){

		puts("First");

		exit(0);

	}

	if (u==1 && cnt==0){

		puts("First");

		exit(0);

	}

	if (u==1 && cnt==1){

		puts("Second");

		exit(0);

	}

	if (cnt==0){

		return;

	}

	if (cnt==1){

		siz[u]=-1;

	}

	return;

}



int main(){

	rd(n)

	if (n==2){

		puts("Second");

		return 0;

	}

	int x,y;

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

		rd(x) rd(y)

		addedge(x,y);

		addedge(y,x);

	}

	dfs1(1,0);

	dfs2(1);

	return 0;

}

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

#include<cctype>

#include<cstring>

#include<algorithm>

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

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

#define reg register

typedef long long ll;

template<typename T>inline T read(){

	reg T x=0;reg short f=1;reg char c=getchar();

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

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

	return x*f;

}

const int MN=100005;

struct edge{int t,nxt;}es[MN<<1];

int h[MN],cnt;

inline void ins(int s,int t){

	es[++cnt]=(edge){t,h[s]};h[s]=cnt;es[++cnt]=(edge){s,h[t]};h[t]=cnt;

}

int n,f;

inline int dfs(int st,int fa){

	if(f)return 1;

	reg int son=0;

	for(reg int i=h[st];i;i=es[i].nxt)

		if(es[i].t!=fa)son+=dfs(es[i].t,st);

	if(son>1)return f=1;

	return !son;

}

int main(){

	n=read<int>();

	for(reg int i=1;i<n;i++)ins(read<int>(),read<int>());

	reg int ans=dfs(1,0);puts((ans|f)?"First":"Second");

	return 0;

}

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

#include<cstdio>

#include<cstdlib>

using namespace std;



int tot=0,h[100005];

int n,x,y,siz[100005],f[100005];

struct Edge{

	int x,next;

}e[200005];



inline void add_edge(int x,int y){

	e[++tot].x=y;

	e[tot].next=h[x],h[x]=tot;

}



bool dfs(int x,int fa){

	siz[x]=1;

	int cnt=0;

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

		if(e[i].x==fa)continue;

		if(dfs(e[i].x,x))return true;

		if(siz[e[i].x]){

			cnt++,siz[x]=0;

			if(cnt==2)return true;

		}

	}

	return false;

}



int main(){

	scanf("%d",&n);

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

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

		add_edge(x,y);

		add_edge(y,x);

	}

	printf(dfs(1,0)||siz[1]?"First":"Second");

}

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

#include<cctype>

#include<cstring>

#include<algorithm>

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

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

#define reg register

typedef long long ll;

template<typename T>inline T read(){

	reg T x=0;reg short f=1;reg char c=getchar();

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

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

	return x*f;

}

const int MN=100005;

struct edge{int t,nxt;}es[MN<<1];

int h[MN],cnt;

inline void ins(int s,int t){

	es[++cnt]=(edge){t,h[s]};h[s]=cnt;es[++cnt]=(edge){s,h[t]};h[t]=cnt;

}

int n,f;

inline int dfs(int st,int fa){

	if(f)return 1;

	reg int son=0;

	for(reg int i=h[st];i;i=es[i].nxt)

		if(es[i].t!=fa)son+=dfs(es[i].t,st);

	if(son>1)return f=1;

	return !son;

}

int main(){

	n=read<int>();

	for(reg int i=1;i<n;i++)ins(read<int>(),read<int>());

	reg int ans=dfs(1,0);puts((ans|f)?"First":"Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");

}

// Optimized solution to the same problem (faster):
#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");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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; 

}

// Optimized solution to the same problem (faster):
#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");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}//

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem: