module m1
  implicit none

  type :: edge
     integer ix
     integer,allocatable :: v(:)
  end type edge

  type :: res
     integer d, v
  end type res

  logical,allocatable :: visited(:)
end module m1

program agc033c
  use m1
  implicit none
  integer a, b, i, n
  integer,allocatable :: v1(:), v2(:), cnt(:)
  type(edge),allocatable :: e(:)
  type(res) r

  read *, n
  allocate(v1(n-1),v2(n-1),cnt(n),e(n),visited(n))

  v1 = 0
  v2 = 0
  cnt = 0
  visited = .false.

  do i = 1,n-1
     read *, a,b
     v1(i) = a
     v2(i) = b
     cnt(a) = cnt(a) + 1
     cnt(b) = cnt(b) + 1
  end do

  do i = 1,n
     e(i)%ix = 1
     allocate(e(i)%v(cnt(i)))
  end do

  do i = 1,n-1
     e(v1(i))%v(e(v1(i))%ix) = v2(i)
     e(v2(i))%v(e(v2(i))%ix) = v1(i)
     e(v1(i))%ix = e(v1(i))%ix + 1
     e(v2(i))%ix = e(v2(i))%ix + 1
  end do

  r = visit(1)
  r = visit(r%v)

  if (mod(r%d,3) == 1) then
     print *, 'Second'
  else
     print *, 'First'
  end if

contains

  recursive function visit(vertex) result(r)
    integer,intent(in) :: vertex
    type(res) r, t
    integer i

    r%d = 0
    r%v = vertex

    visited(vertex) = .true.

    do i = 1,size(e(vertex)%v)
       if (.not.visited(e(vertex)%v(i))) then
          t = visit(e(vertex)%v(i))
          if (r%d <= t%d) then
             r%d = t%d + 1
             r%v = t%v
          end if
       end if
    end do

    visited(vertex) = .false.
  end function visit

end program agc033c
