Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>

typedef long long ll;
#define fi first
#define se second

using namespace std;

///////////////////////////////////////
//
//
///////////////////////////////////////
//

int N;
int jd = 0;
int A;
int B;
int a[112345];
int b[112345];
int cnt[112345];
int jdg[112345];
ll idx[112345];
int next;
int bef;
int j;

int main(){
  
  cin>>N;
  
  fill( cnt, cnt+N+1, 0 );
  fill( jdg, jdg+N+1, 0 );
  
  int i;
  
  for( i = 1; i < N; i++ ){
    scanf("%d %d", &A, &B);
    cnt[A]++;
    cnt[B]++;
    if( cnt[A] == 1 ) idx[A] = B*100000;
    if( cnt[B] == 1 ) idx[B] = A*100000;
    if( cnt[A] == 2 ) idx[A] += B%100000;
    if( cnt[B] == 2 ) idx[B] += A%100000;
    if( cnt[A] > 2 ) idx[A] = 0;
    if( cnt[B] > 2 ) idx[B] = 0;
  }
  
  for( i = 1; i <= N; i++ ){
    if( cnt[i] == 1 ){
      j = 1;
      bef = i;
      next = idx[i]/100000;
      while( next ){
        if ( j%2 ) jdg[next]++;
        A = idx[next]/100000;
        B = idx[next]%100000;
        if( B = 0 ) B = 100000;
        bef = next;
        if( A != bef ) next = A;
        if( B != bef ) next = B;
        j++;
      }
    }
  }
  
  for( i = 1; i <= N; i++ ){
    if( jdg[i] > 1 ) jd = 1;
  }
  
  if( jd ) puts("First");
  else{    puts("Second");}
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:7: error: reference to 'next' is ambiguous
   58 |       next = idx[i]/100000;
      |       ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:59:14: error: reference to 'next' is ambiguous
   59 |       while( next ){
      |              ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:60:24: error: reference to 'next' is ambiguous
   60 |         if ( j%2 ) jdg[next]++;
      |                        ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:61:17: error: reference to 'next' is ambiguous
   61 |         A = idx[next]/100000;
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:62:17: error: reference to 'next' is ambiguous
   62 |         B = idx[next]%100000;
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:64:15: error: reference to 'next' is ambiguous
   64 |         bef = next;
      |               ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:65:24: error: reference to 'next' is ambiguous
   65 |         if( A != bef ) next = A;
      |                        ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~
a.cc:66:24: error: reference to 'next' is ambiguous
   66 |         if( B != bef ) next = B;
      |                        ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:29:5: note:                 'int next'
   29 | int next;
      |     ^~~~