stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 1.8151243869208258x):
//Nipah!~☆

#include<bits/stdc++.h>

using namespace std;



const int maxn = 1e5 + 10;



int n;

string ans;

bool mark[maxn];

int kid[maxn];

vector<int> adj[maxn];



void in();

void solve();

void dfs(int, int);

void out();



int main(){

	ios::sync_with_stdio(false);

	cout.tie(0);

	cin.tie(0);

	in();

	solve();

	out();

}



void in(){

	cin >> n;

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

		int u, v;

		cin >> u >> v;

		u--;

		v--;

		adj[u].push_back(v);

		adj[v].push_back(u);

	}

}



void solve(){

	ans = "Second";

	dfs(0, -1);

}



void dfs(int u, int par){

	mark[u] = 1;

	kid[u] = -1;

	for(auto v: adj[u])

		if(!mark[v])

			dfs(v, u);

	if(kid[u] == -1){

		if(par == -1 || kid[par] != -1)

			ans = "First";

		else

			kid[par] = u;

	}

}



void out(){

	cout << ans;

}
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 1.4873807143557227x):
//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");

}
// Slower C++ solution:
#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");

}

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

#include <vector>

using namespace std;



const int N = 100 * 1000 + 5;





bool dp1[N], dp0[N], mark[N];

vector <int> adj[N];



void dfs(int v) {

	mark[v] = true;

	bool b = false;

	int c = 0, cl = 0;

	for (auto u : adj[v]) {

		if (!mark[u]) {

			dfs(u);

			cl++;

			if (dp0[u]) {

				c++;

			}

			if (dp1[u]) {

				b = true;

			}

		}

	}

	if (c == cl) {

		dp1[v] = true;

	}

	if (c + 1 == cl && b) {

		dp0[v] = true;

	}



}



int main() {

	int n;

	cin >> n;

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

		int u, v;

		cin >> u >> v;

		adj[u].push_back(v);

		adj[v].push_back(u);

	}

	dfs(1);

	if (dp0[1]) {

		cout << "Second";

	}

	else {

		cout << "First";

	}

	return 0;

}
// Slower C++ solution:
//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");

}

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

#include <vector>

using namespace std;



const int N = 100 * 1000 + 5;





bool dp1[N], dp0[N], mark[N];

vector <int> adj[N];



void dfs(int v) {

	mark[v] = true;

	bool b = false;

	int c = 0, cl = 0;

	for (auto u : adj[v]) {

		if (!mark[u]) {

			dfs(u);

			cl++;

			if (dp0[u]) {

				c++;

			}

			if (dp1[u]) {

				b = true;

			}

		}

	}

	if (c == cl) {

		dp1[v] = true;

	}

	if (c + 1 == cl && b) {

		dp0[v] = true;

	}



}



int main() {

	int n;

	cin >> n;

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

		int u, v;

		cin >> u >> v;

		adj[u].push_back(v);

		adj[v].push_back(u);

	}

	dfs(1);

	if (dp0[1]) {

		cout << "Second";

	}

	else {

		cout << "First";

	}

	return 0;

}
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 1.8146505345509836x):
/* be name khoda */

#include <bits/stdc++.h>

using namespace std;



typedef int ll;



#define forifrom(i, s, n) for (ll i = s; i < n; ++i)

#define fori(i, n) forifrom(i, 0, n)



// ------------------------------------------------------------------



const ll maxn = 100010;



ll n, notsat[maxn];

vector<ll> g[maxn];



void dfs(ll x, ll par) {

    notsat[x] = 1;

    for (auto y : g[x]) if (y != par) {

        dfs(y, x);

        if (notsat[y]) {

            if (notsat[x]) notsat[x] = 0;

            else {

                cout << "First\n";

                exit(0);

            }

        }

    }

}



int main() {

    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);



    cin >> n;

    fori (i, n - 1) {

        ll a, b; cin >> a >> b; --a, --b;

        g[a].emplace_back(b), g[b].emplace_back(a);

    }

    dfs(0, 0);

    if (notsat[0]) cout << "First\n";

    else cout << "Second\n";



}
// Slower C++ solution:
//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");

}

// Faster C++ solution for the same problem (measured speedup: 1.2201300350661564x):
/* be name khoda */

#include <bits/stdc++.h>

using namespace std;



typedef int ll;



#define forifrom(i, s, n) for (ll i = s; i < n; ++i)

#define fori(i, n) forifrom(i, 0, n)



// ------------------------------------------------------------------



const ll maxn = 100010;



ll n, notsat[maxn];

vector<ll> g[maxn];



void dfs(ll x, ll par) {

    notsat[x] = 1;

    for (auto y : g[x]) if (y != par) {

        dfs(y, x);

        if (notsat[y]) {

            if (notsat[x]) notsat[x] = 0;

            else {

                cout << "First\n";

                exit(0);

            }

        }

    }

}



int main() {

    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);



    cin >> n;

    fori (i, n - 1) {

        ll a, b; cin >> a >> b; --a, --b;

        g[a].emplace_back(b), g[b].emplace_back(a);

    }

    dfs(0, 0);

    if (notsat[0]) cout << "First\n";

    else cout << "Second\n";



}
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 1.8328019505525486x):
#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");

}
// Slower C++ solution:
//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");

}

// Faster C++ solution for the same problem (measured speedup: 1.2322345804694996x):
#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");

}
// 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.3948609741677631x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.290929741967188x):
#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;

}
// 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: 7.465932680092425x):
#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;

}
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 5.352456494488231x):
#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;

}