Harryxun/stf_run huggingface dataset:
from math import *

r = raw_input()
l = math.pi*2*r
s = math.pi*r**2 
print'%f %f' % (l, s) 

### FIXED CODE ###

import math
r = float(raw_input())
l = math.pi*2*r
s = math.pi*r**2
print'%f %f' % (s, l)
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
p = list(a)
s = list(a)
for i in range(1, n):
    p[i] = gcd(p[i - 1], p[i])
for i in range(n - 2, -1, -1):
    s[i] = gcd(s[i], s[i + 1])

ans = max(p[-2], s[1])
ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))
print(ans)


### FIXED CODE ###

from fractions import gcd

n = int(raw_input())
a = list(map(int, raw_input().split()))
p = list(a)
s = list(a)
for i in range(1, n):
    p[i] = gcd(p[i - 1], p[i])
for i in range(n - 2, -1, -1):
    s[i] = gcd(s[i], s[i + 1])

ans = max(p[-2], s[1])
if n > 2:
    ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))

print(ans)
H, W = map(int, input().split())

pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print("".join(pixel[h]))
    print("".join(pixel[h]))

### FIXED CODE ###

H, W = map(int, input().split())

# 絵を入力
C = [input() for _ in range(H)]
 
# 2回出力
for i in range(H):
    for j in range(2):
        print(C[i])
N = int(input())
A = [int(num) for num in input().split()]

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9)+7))
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(num) for num in input().split()]

sumA = sum(A)
ans = 0
for i in range(len(A)):
    sumA = sumA - A[i]
    ans += A[i] * sumA


ans = ans % (10**9+7)
print(ans)
N = int(input())
A = [0] * N
B = [0] * N
C = [0] * N
for i in range(N):
    A[i], B[i], C[i] = map(int, input().split())
dp = [[0] * 3 for _ in range(N)]  # 初期化　[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]] for n = 4
dp[0] = [A[0], B[0], C[0]]

for i in range(N-1):
    dp[i+1][0] = max(dp[i][1]+A[i+1], dp[i][2]+A[i+1])
    dp[i+1][1] = max(dp[i][0]+B[i+1], dp[i][2]+B[i+1])
    dp[i+1][2] = max(dp[i][0]+C[i+1], dp[i][1]+C[i+1])
print(max(dp[N-1]))

### FIXED CODE ###

n = int(input())
H = list(map(int, input().split()))
dp = [float("inf") for _ in range(n)]  # 最小化問題なのでinfで初期化
dp[0] = 0  # 初期条件
dp[1] = dp[0] + abs(H[1]-H[0])  #　初期条件2

for i in range(2, n):
    dp[i] = min(dp[i], dp[i-1] + abs(H[i]-H[i-1]))
    dp[i] = min(dp[i], dp[i-2] + abs(H[i]-H[i-2]))
print(dp[n-1])
from collections import deque

h,w=map(int,input().split())
a = [input() for _ in range(h)]
move=((1,0),(0,1),(-1,0),(0,-1))

que=deque([])
visited=[[0]*h for _ in range(w)]
for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            que.append((i,j,0))
            visited[i][j]=1


while len(que)>0:       
    ci,cj,d=que.popleft()
    for mi,mj in move:
        ni,nj=mi+ci,mj+cj
        if 0<=ni<h and 0<=nj<w and visited[ni][nj]==0:
            if a[ni][nj]==".":
                visited[ni][nj]=1
                que.append((ni,nj,d+1))

print(d)

### FIXED CODE ###

from collections import deque

h,w=map(int,input().split())
a = [input() for _ in range(h)]
move=((1,0),(0,1),(-1,0),(0,-1))

que=deque([])
visited=[[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            que.append((i,j,0))
            visited[i][j]=1


while len(que)>0:       
    ci,cj,d=que.popleft()
    for mi,mj in move:
        ni,nj=mi+ci,mj+cj
        if 0<=ni<h and 0<=nj<w and visited[ni][nj]==0:
            if a[ni][nj]==".":
                visited[ni][nj]=1
                que.append((ni,nj,d+1))

print(d)
a, b = int (input().split())
c = a*b % 2
if c=1 :
 print("Odd")
else:
 print("Even")


### FIXED CODE ###

a, b =map( int, input().split())
c = a*b % 2
if c==0 :
 print("Even")
else :
 print("Odd")
def nibutan(A,B,X,L,H):
	M=(H+L)//2
	tmp=A*M+B*len(str(M))
	if M == 0:
		return 0
	elif tmp==X:
		return M
	elif tmp<X:
		if M==999999999:
			return M
		else:
			return nibutan(A,B,X,M,H)
	elif tmp>X:
		tmp_2=A*(M-1)+B*len(str(M-1))
		if tmp_2<X:
			return M-1
		else:
			return nibutan(A,B,X,L,M)

A,B,X=map(int,input().split())
if X>=A*1000000000+B*10:
	print(1000000000)
else:
	ans=nibutan(A,B,X,0,1000000000)
	print(ans)



### FIXED CODE ###

S = input()

mp = {
    'SUN':7,
    'MON':6,
    'TUE':5,
    'WED':4,
    'THU':3,
    'FRI':2,
    'SAT':1
}

print(mp[S])
import collections
n,s,m = map(int, raw_input().split(' '))
cc = collections.Counter
cumul = 0
for _ in range(m):
	cc[int(raw_input()) - 1] += 1
	cumul += 1
for u in range(n):
	q = 0
	q += cc[u] - cumul
	if q > 0:
		print 'Yes'	
	else:
		print 'No'



### FIXED CODE ###

import collections
n,s,m = map(int, raw_input().split(' '))
cc = collections.Counter()
cumul = 0
for _ in range(m):
	cc[int(raw_input()) - 1] += 1
	cumul += 1
for u in range(n):
	q = s
	q += cc[u] - cumul
	if q > 0:
		print 'Yes'	
	else:
		print 'No'
a.b = map(int.input().split())
c = (a/2/b)
d =count(c)
print(d)

### FIXED CODE ###

a,b = map(int,input().split())
c = b*2+1
if a%c ==0:
    print(int(a//c))
else:
    print(int(a//c)+1)
a,b,x=map(int, input())
n=x*((a+x-1)//x)
cnt=0
while n<=b:
  cnt+=1
  n+=x
print(cnt)

### FIXED CODE ###

a,b,x=map(int, input().split())
max=b//x
min=(a+x-1)//x
print(max-min+1)
x=int
print(x^3)


### FIXED CODE ###

x=int(input())
print(x*x*x)
s = input()
k = int(input())

cnt = 0
t_cnt = 1
tmp = ''
for i in range(len(s)):
    if tmp==s[i]:
        t_cnt += 1
    else:
        cnt += t_cnt//2
        tmp = s[i]
        t_cnt = 1
cnt += t_cnt//2

top_cnt = 0
char = s[0]
for i in range(len(s)):
    if char == s[i]:
        top_cnt += 1
    else:
        break

bottom_cnt = 0
char = s[-1]
for i in range(1, len(s)+1):
    if char == s[-i]:
        bottom_cnt += 1
    else:
        break
        
if set(s)==1:
    print(len(s)*k//2)
else:
    if s[1]!=s[-1]:
        print(cnt*k)
    else:
        print(cnt*k-(top_cnt//2+bottom_cnt//2-(top_cnt+bottom_cnt)//2)*(k-1))

### FIXED CODE ###

s = input()
k = int(input())

tmp = 1
count = 0
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        tmp += 1
    else:
        count += tmp // 2
        tmp = 1
count += tmp//2

if len(set(s))==1:
    print(len(s)*k//2)
else:
    if s[0] != s[-1]:
        print(count*k)
    else:
        h = 0
        for i in s:
            if i != s[0]:
                break
            else:
                h += 1
        t = 0
        for i in s[::-1]:
            if i != s[-1]:
                break
            else:
                t += 1
        print(count*k-(h//2+t//2-(h+t)//2)*(k-1))
from math import gcd
def func(n):
    return n - (n//C + n//D - n//(C*D//gcd(C, D)))
A, B, C, D = map(int, input().split())
print(func(B) - func(A-1))

### FIXED CODE ###

from fractions import gcd
def func(n):
    return n - (n//C + n//D - n//(C*D//gcd(C, D)))
A, B, C, D = map(int, input().split())
print(func(B) - func(A-1))
setting = input().rstrip().split(" ")
N = int(setting[0])
Y = int(setting[1])
otoshidama = [-1,-1,-1]

for x in range(N):
    for y in range(N):
        if 10000*x + 5000*y + 1000*(N-x-y) == Y :
            otoshidama = [x,y,N-x-y]
        else:
            pass

print(otoshidama[0]," ",otoshidama[1]," ",otoshidama[2])   

### FIXED CODE ###

S = input()
S=S.replace("2017","2018")

print(S)
1,A2,A3=map(int,input().split())
A=[A1,A2,A3]
A.append(A1)
def A_(i):
    if A[i]-A[i+1]>=0:
        return A[i]-A[i+1]
    else:
        return A[i+1]-A[i]
B=[A_(i) for i in range(3)]
B.append(A_(0))
B.append(A_(1))
def sum(j):
    return B[j]+B[j+1]
C=[sum(j) for j in range(3)]
print(min(C))


### FIXED CODE ###

A1,A2,A3=map(int,input().split())
A=[A1,A2,A3]
A.append(A1)
def A_(i):
    if A[i]-A[i+1]>=0:
        return A[i]-A[i+1]
    else:
        return A[i+1]-A[i]
B=[A_(i) for i in range(3)]
B.append(A_(0))
B.append(A_(1))
def sum(j):
    return B[j]+B[j+1]
C=[sum(j) for j in range(3)]
print(min(C))
from sys import stdin

N, M, *A = map(int, stdin.read().split())
req = {1: 2,
       2: 5,
       3: 5,
       4: 4,
       5: 5,
       6: 6,
       7: 3,
       8: 7,
       9: 6}

B = sorted([(a, req[a]) for a in A], key=lambda x: x[0], reverse=True)
min_ = min(B, key=lambda x: x[1])


def dp(N, B, min_):
    if N == 0:
        return []
    elif N // min_[1] < 1:
        return None
    elif N % min_[1] == 0:
        return [min_[0]] * (N // min_[1])
    else:
        for a, n in B:
            if (N // min_[1]) - ((N-n) // min_[1]) == 1:
                ret = dp(N-n, B, min_)
                if ret is not None:
                    return [a] + ret


lst = dp(N, B, min_)
print(''.join(map(str, lst)))

### FIXED CODE ###

from sys import stdin

N, M, *A = map(int, stdin.read().split())
req = {1: 2,
       2: 5,
       3: 5,
       4: 4,
       5: 5,
       6: 6,
       7: 3,
       8: 7,
       9: 6}

B = sorted([(a, req[a]) for a in A], key=lambda x: x[0], reverse=True)
a_min, n_min = min(B, key=lambda x: x[1])
g = [(a, n-n_min) for a, n in B if a > a_min and n > n_min]
l = [(a, n-n_min) for a, n in B if a < a_min and n > n_min]
l.sort(key=lambda x: x[1], reverse=True)
C = g + l

def dp(rem, C):
    ret = None
    if rem == 0:
        ret = []
    elif rem > 0:
        for i in range(len(C)):
            a, m = C[i]
            nxt = dp(rem-m, C[i:])
            if nxt is not None:
                ret = [a] + nxt
                break
    return ret


i = 0
while True:
    quo = N // n_min - i
    rem = N % n_min + i * n_min
    lst = dp(rem, C)
    if lst is not None:
        lst = sorted(lst + [a_min] * (quo-len(lst)), reverse=True)
        print(''.join(map(str, lst)))
        break
    i += 1
N = input()

if (N[0]==N[1])and(N[1]==N[2):
    print('Yes')
elif (N[1]==N[2])and(N[2]==N[3):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = input()

if (N[0]==N[1])and(N[1]==N[2]):
    print('Yes')
elif (N[1]==N[2])and(N[2]==N[3]):
    print('Yes')
else:
    print('No')
n, T = map(input.split(), int)
res = 2000
for _ in range(n):
  c, t = map(input.split(), int)
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

### FIXED CODE ###

n = int(input())
if n == 1:
  print('Hello World\n')
else:
  a = int(input())
  b = int(input())
  print(a + b)
A, B, C = map(int, input().split())
if A[-1] == B[0] && B[-1] == C[0]:
  print("YES")
else :
  print("NO")

### FIXED CODE ###

A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else :
  print("NO")
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
n = int(input())
a = map(int,input().split())
ans = min(map(how_many_times_divisible, a))
 
print (ans)

### FIXED CODE ###

s=list(input())
count = 0
for i in range(3):
    if s[i] == '1':
        count = count + 1    
print(count)
h,k=map(int,input().split())
if h==1 or w ==1:
    print(1)
if h*k%2==0:
    print((h*k)/2)
else:
    print((h*k)//2 + 1)


### FIXED CODE ###

h,k=map(int,input().split())
if h==1 or k ==1:
    print(1)
elif h*k%2==0:
    print(int((h*k)/2))
else:
    print(int((h*k)//2 + 1))
S=input()
a=["Sunny", "Cloudy", "Rainy"]
print(a[(a.index(S)+1)])

### FIXED CODE ###

S=input()
a=["Sunny", "Cloudy", "Rainy"]
print(a[((a.index(S)+1))%3])
from fractions import gcd
A, B = [int(x) for x in input().split()]
N = gcd(A, B)
p_list = set({})
for i in range(1, int(math.sqrt(N))+1):
    if (N != (N//i * i)):
        continue
    if (i == 1):
        p_list.add(i)
    else:
        is_prime = True
        for p in p_list:
            if (p != 1 and i == (i//p * p)):
                is_prime = False
        if (is_prime):
            p_list.add(i)
        j = N // i
        is_prime = True
        for p in p_list:
            if (p != 1 and j == (j//p * p)):
                is_prime = False
        if (is_prime):
            p_list.add(j)
print(len(p_list))


### FIXED CODE ###

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

from fractions import gcd
import math
A, B = [int(x) for x in input().split()]
N = gcd(A, B)
a = prime_factorize(N)
print(len(set(a))+1)
# -*- coding: utf-8 -*-
import math
import copy

N = int(input())
A = list(map(int, input().split()))


def calc_gcd(arr):
    if len(arr) <= 0:
        return 0
    arr2 = copy.copy(arr)
    return math.gcd(calc_gcd(arr2[:len(arr)-1]), arr[-1])


gcd_array = []
for i in range(N):
    B = copy.copy(A)
    B.pop(i)
    gcd_array.append(calc_gcd(B))

print(max(gcd_array))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import fractions

N = int(input())
A = list(map(int, input().split()))


gcd = fractions.gcd


left = [0] * N
right = [0] * N
for i in range(N):
    if i == 0:
        left[0] = A[0]
        right[N-1] = A[-1]
        continue

    left[i] = gcd(left[i-1], A[i])
    right[N-i-1] = gcd(right[N-i], A[N-i-1])

max_gcd = right[1]
for i in range(N):
    if i == 0:
        continue
    elif i == N - 1:
        if max_gcd < left[-2]:
            max_gcd = left[-2]
    else:
        target = gcd(left[i-1], right[i+1])
        if max_gcd < target:
            max_gcd = target

print(max_gcd)
lis=map(int,input().split())
print(max(lis)-min(lis))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))
def resolve():
    '''
    code here
    '''
    N = int(input())

    ans_list = [i*(i+1)//2 for i in range(1, N+1)]

    if N > 1:
        for i in range(1, N+1):
            if ans_list[i-1] < N < ans_list[i]:
                delta = ans_list[i] - N
                res = list(range(1, i+2))
                res.remove(delta)
                break
            elif N == ans_list[i]:
                res = range(1, i+2)
    else:
        res = [1]

    for item in res:
        print(item)



if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    '''
    code here
    '''
    N = int(input())

    delta = 0
    if N > 1:
        for i in range(1, N+1):
            if (i-1)*i < 2*N < i*(i+1):
                delta = i*(i+1)//2 - N
                res_list = list(range(1, i+1))
                break
            elif 2*N == i*(i+1):
                res_list = range(1, i+1)
    else:
        res_list = [1]

    if delta > 0:
        while delta > res_list[-1]:
            delta -= res_list[-1]
            del res_list[-1]

        res_list.remove(delta)    
    

    for item in res_list:
        print(item)



if __name__ == "__main__":
    resolve()
h,a = map(int, input().split())
print(int(h/a) if !h%a else int(h/a) + 1)

### FIXED CODE ###

h,a = map(int, input().split())
print(-(-h//a))
import numpy as np
N,M=map(int,input().split())
S=np.zeros((N,N))
H=list(map(int,input().split()))

for j in range(M):
  a,b=map(int,input().split())
  
  if H[a-1]<H[b-1]:
    S[a-1,b-1]=-1
    S[b-1,a-1]=1
  elif H[a-1]>H[b-1]:
    S[a-1,b-1]=1
    S[b-1,a-1]=-1
  else:
    S[a-1,b-1]=-1
    S[b-1,a-1]=-1

s=np.zeros(N)
for k in range(N+10):
  s[k]=np.any(S[k,:]<0)

print(len([i for i,x in enumerate(s) if x==0]))


### FIXED CODE ###

import numpy as np
N,M=map(int,input().split())
S=np.ones(N)
H=list(map(int,input().split()))

for j in range(M):
  a,b=map(int,input().split())
  
  if H[a-1]<H[b-1]:
    S[a-1]=0

  elif H[a-1]>H[b-1]:
    S[b-1]=0

  else:
    S[a-1]=0
    S[b-1]=0

print(int(np.sum(S)))
n = int(input())
a = sorted(list(map(int,input().split())))
b = []
if a[0] != a[1]:
    b += [a[0]]
for i in range(1, n-1):
    if a[i-1] != a[i] and a[i] != a[i+1]:
        b += [a[i]]
if a[-1] != a[-2]:
    b += [a[-1]]

if len(b) == 0:
    print(0)
    exit()
ans = 1
div = [b[0]]
for x in b[1:]:
    f = True
    for d in div:
        if x % d == 0:
            f = False
            break
    if f:
        div += [x]
        ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int,input().split())))
m = a[-1]
b = [True]*(m+1)
for i in range(n):
    if i > 0 and a[i] == a[i-1]:
        continue
    for j in range(2, m//a[i]+1):
        b[j*a[i]] = False
ans = 0
for i in range(n):
    if 0 < i and a[i] == a[i-1]:
        continue
    if i < n-1 and a[i] == a[i+1]:
        continue
    if b[a[i]]:
        ans += 1
print(ans)
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
S=list(S)
for i in range(len(T)):
    S[i+memo]=T[i]

S=''.join(S)

if flag==False:
    print("UNRESTORABLE")
else:
    S=S.replace('?','a')
    print(S)



### FIXED CODE ###

S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
    



if flag==False:
    print("UNRESTORABLE")
else:
    S=list(S)
    for i in range(len(T)):
        S[i+memo]=T[i]
    
    S=''.join(S)    
    S=S.replace('?','a')
    print(S)
import sys

n = list(map(int,input().split()))
r = list(map(int,input().split()))
t = int(input())

A = n[0]
V = n[1]

B = r[0]
W = r[1]

T = t

after_a = A + V * T
after_b = B + W * T

after_a_min = A - V * T
after_a_min = B - V * T
print(after_a)
print(after_b)

if after_a == after_b:
    print('YES')
    sys.exit()

if A < B and after_a > after_b:
    print('YES')
    sys.exit()

if A < B and after_a <= after_b:
    print('NO')
    sys.exit()


if A > B and after_a_min < after_b_min:
    print('YES')
    sys.exit()

if A > B and after_a_min >= after_b_min:
    print('NO')
    sys.exit()

### FIXED CODE ###

import sys

n = list(map(int,input().split()))
r = list(map(int,input().split()))
t = int(input())

A = n[0]
V = n[1]

B = r[0]
W = r[1]

T = t

after_a = A + V * T
after_b = B + W * T

after_a_min = A - V * T
after_b_min = B - W * T

if (after_a == after_b) or (after_a_min == after_b_min):
    print('YES')
    sys.exit()

if A < B and after_a > after_b:
    print('YES')
    sys.exit()

if A < B and after_a < after_b:
    print('NO')
    sys.exit()


if A > B and after_a_min < after_b_min:
    print('YES')
    sys.exit()

if A > B and after_a_min > after_b_min:
    print('NO')
    sys.exit()
#!/use/bin/env python3

import math
from collections import defaultdict

(d, n) = [int(s) for s in input().split()]

ans = []

if d == 0:
    ans = range(1, 101)
elif d == 1:
    ans = range(100, 100 * 100 + 100, 100)
else:
    ans = range(10000, 100 * 100 * 100, 100 * 100)

print(ans[n - 1])

### FIXED CODE ###

#!/use/bin/env python3

import math
from collections import defaultdict

(d, n) = [int(s) for s in input().split()]

ans = 0

if d == 0:
    ans = 1
elif d == 1:
    ans = 100
else:
    ans = 10000

ans = 101 * ans if n == 100 else n * ans

print(ans)
N = int(input())
 
org_sum = 1/2 * N * (N+1)
div3 = N // 3
sum3 = 3/2 * div3 * (div3+1)
div5 = N // 5
sum5 = 5/2 * div5 * (div5+1)
div15 = N // 15
sum15 = 15/2 * div15 * (div15+1)
 
return org_sum - sum3 - sum5 + sum15

### FIXED CODE ###

N = int(input())
 
org_sum = 1 * N * (N+1) // 2
div3 = N // 3
sum3 = 3 * div3 * (div3+1) //2
div5 = N // 5
sum5 = 5 * div5 * (div5+1) // 2
div15 = N // 15
sum15 = 15 * div15 * (div15+1) // 2
 
print(org_sum - sum3 - sum5 + sum15)
import collections
N=int(input())
inarr=[[int(j) for j in input().split()] for i in range(N-1)]
nodes={}
class Node:
    def __init__(self, parent, children, value):
        self.parent = parent
        self.children = children
        self.value = value
    
    def __str__(self):
        return "NODE[v={},par={},chld={}]".format(self.value,self.parent.value if self.parent else "none",list(map(lambda x: x.value, self.children)))

for i,j in inarr:
    if not i in nodes:
        nodes[i] = Node(None, [], i)
        if not j in nodes:
            nodes[j] = Node(nodes[i], [], j)
            nodes[i].children.append(nodes[j])
        else:
            nodes[i].parent = nodes[j]
            nodes[j].children.append(nodes[i])
    else:
        if not j in nodes:
            nodes[j] = Node(nodes[i], [], j)
            nodes[i].children.append(nodes[j])
        else:
            if not nodes[i].parent:
                nodes[i].parent = nodes[j]
                nodes[j].children.append(nodes[i])
            elif not nodes[j].parent:
                nodes[j].parent = nodes[i]
                nodes[i].children.append(nodes[j])
            else:
                print("error")

visited = {1: True}
queue = collections.deque([[1, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i].children:
        if not node.value in visited:
            visited[node.value] = True
            queue += [[node.value, d + 1]]
    if nodes[i].parent and not nodes[i].parent.value in visited:
        visited[nodes[i].parent.value] = True
        queue += [[nodes[i].parent.value, d + 1]]

# print("i: {} d: {}".format(i,d))

visited = {i: True}
queue = collections.deque([[i, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i].children:
        if not node.value in visited:
            visited[node.value] = True
            queue += [[node.value, d + 1]]
    if nodes[i].parent and not nodes[i].parent.value in visited:
        visited[nodes[i].parent.value] = True
        queue += [[nodes[i].parent.value, d + 1]]

# print(list(map(str,nodes.values())))
# print("i: {} d: {}".format(i,d))
print('Second' if (d + 1) % 3 == 2 else 'First')


### FIXED CODE ###

import collections
N=int(input())
inarr=[[int(j) for j in input().split()] for i in range(N-1)]
nodes={}
if N == 1:
    print("First")
    exit()

for i,j in inarr:
    if not i in nodes: nodes[i] = [j]
    else: nodes[i].append(j)
    if not j in nodes: nodes[j] = [i]
    else: nodes[j].append(i)

visited = {1}
queue = collections.deque([[1, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i]:
        if not node in visited:
            visited.add(node)
            queue += [[node, d + 1]]

# print("i: {} d: {}".format(i,d))

visited = {i}
queue = collections.deque([[i, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i]:
        if not node in visited:
            visited.add(node)
            queue += [[node, d + 1]]

# print(list(map(str,nodes.values())))
# print("i: {} d: {}".format(i,d))
print('Second' if (d + 1) % 3 == 2 else 'First')