Harryxun/stf_run huggingface dataset:
x, y = map(int, input().split())

l = []

if x <= y:
  l.appen(y-x)
  
if -x <= y:
  l.append(y + x + 1)
  
if x <= -y:
  l.append(-y-x+1)
  
if -x <= -y:
  l.append(-y+x+2)
  
print(min(l))

### FIXED CODE ###

x, y = map(int, input().split())
l = []
if x <= y:
    l.append(y - x)
if -x <= y: # 最初に1回符号反転
    l.append(y + x + 1)
if x <= -y: # 最後に1回符号反転
    l.append(-y - x + 1)
if -x <= -y: # 両方符号反転
    l.append(-y + x + 2)

ans = min(l)
print(ans)
import numpy as np
h, n = map(int, input().split())
ab = np.array([list(map(int, input().split())) for _ in range(n)])

a = ab[:, 0]
b = ab[:, 1]

dp = np.zeros(10**9, dtype=np.int)

for i in range(1,h+1):
    dp[i] = min(dp[i-a]+b)

print(dp[h])

### FIXED CODE ###

h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
dp = [10**5 for _ in range(h+1)]
dp[0] = 0
for i in range(1,h+1):
    dp[i] = min([dp[max(0, i-pw)]+ma for pw, ma in ab])
print(dp[h])
import sys
for i in sys.stdin.readlines() :
    l = list(int, i.split())
    a = l[0]
    b = l[1]
    if a == 0 and b == 0 :
        break
    else :
        sorted(l)
        print(l[0],l[1])

### FIXED CODE ###

import sys
while True :
    ab = list(map(int,sys.stdin.readline().split()))
    a = ab[0]
    b = ab[1]
    if a == 0 and b == 0 :
        break
    else :
        ab = sorted(ab)
        print(ab[0],ab[1])
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")
N = int(input())
total = 0.0
rate = 380000

for i in range(N):
  a,t = input().split()
  if(t=="BTC"):
    total += float(a) * rate
  else:
    total += float(a)
print(total)

### FIXED CODE ###

list = input().split("/")
y = int(list[0])
m = int(list[1])

if (y>=2019 and m>=5):
    print("TBD")
else:
    print("Heisei")
n=int(input())
x=list(map(int,input().split()))
ans=0
average=sum(x)//n

for i in x:
    ans+=(i=average)**2

print(ans)

### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=10**9

for i in range(x[0],x[-1]+1):
    temp=0
    for j in x:
        temp+=(j-i)**2
    ans=min(ans,temp)

print(ans)
N,A,B=map(int,input().split())
s=N*A
t=B
if s>t:
  print(t)
else:
  prine(s)

### FIXED CODE ###

N,A,B=map(int,input().split())
ans=min(N*A,B)
print(ans)
from scipy.sparse import*
(n,m),*t=[map(int,t.split())for t in open(0)]
*b,a=zip(*[(i,j+n,1)for i,(_,*t)in enumerate(t)for j in t])
print('YNEOS'[1in csgraph.connected_components(csr_matrix((a,b),[m*9]*2))[1][:n]::2])

### FIXED CODE ###

from scipy.sparse import*
(n,m),*p=[map(int,t.split())for t in open(0)]
a,b,c=zip(*[(i,j+n-1,1)for i,q in enumerate(p)for j in list(q)[1:]])
print('YNEOS'[1in csgraph.connected_components(csr_matrix(((c,(a,b))),[n+m]*2))[1][:n]::2])
n = int(input())
for i in range(n // 2):
	for j in range(n // 2):
    	if i*j == n:
        	print('Yes')
            
print('No')

### FIXED CODE ###

N=int(input())
f=0
for i in range(1,10):
    for j in range(1,10):
        if N==i*j:
            f=1
            break
    if f==1:
        break
if f==0:
    print("No")
else:
    print("Yes")
import re
index = re.search(r'.*(hi)+.*, input())
if index:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import re
index = re.fullmatch(r'(hi)+', input())
if index:
    print("Yes")
else:
    print("No")
x,y = map(int, input().split())
if x>0 and x<10 and y>0 and y<10:
	print(x*y)
else:
	print(-1)

### FIXED CODE ###

x,y = map(int, input().split())
if x>0 and x<10 and y>0 and y<10:
	print(x*y)
else:
	print(-1)
text = input()
N, W = text.split("\n")[0], text.split("\n")[1]

#N = int(N[0])
#W = [int(i) for i in W.split(" ")]

ans = 100 * 100

#for T in range(N):
#  ans_tmp = abs(sum(W[:T]) - sum(W[T:]))
#  if ans_tmp < ans:
#    ans = ans_tmp

print(ans)


### FIXED CODE ###

n_text = input()
w_text = input()

N = int(n_text)
W = w_text.split()

W = [int(i) for i in W]

ans = 100 * 100

for T in range(N):
  ans_tmp = abs(sum(W[:T]) - sum(W[T:]))
  if ans_tmp < ans:
    ans = ans_tmp

print(ans)
import math

x1,y1,x2,y2 = map(int, input().split())
dist = math.sqrt( (x2-x1)**2 + (y2-y1)**2 )
print(dist)

### FIXED CODE ###

import math

x1,y1,x2,y2 = map(float, input().split())
dist = math.sqrt( (x2-x1)**2 + (y2-y1)**2 )
print(dist)
ary = list(map(lambda n: int(n), input().split(" "))).sort(reverse=True)

print(ary[0] + ary[1])

### FIXED CODE ###

ary = list(map(lambda n: int(n), input().split(" ")))
ary.sort()

print(ary[0] + ary[1])
import sys

N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))

if N >= M:
    print(0)
    
s= [0]*(M-1)
for i in range(M-1):
    s[i] = X[i+1] - X[i]
s.sort(reverse=True)
res = sum(s)
if M == 1:
    res = 0
else:
    for i in range(N-1):
        res -= s[i]
print(res)

### FIXED CODE ###

import sys

N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))

if N >= M:
    print(0)
    sys.exit()
    
s= [0]*(M-1)
for i in range(M-1):
    s[i] = X[i+1] - X[i]
s.sort(reverse=True)
res = sum(s)
if M == 1:
    res = 0
else:
    for i in range(N-1):
        res -= s[i]
print(res)
while(1):
  count = input()
  if count == 0: break
  original_cube = [1, 2, 3, 4, 5, 6]
  operation{'North':[2, 6, 3, 4, 1, 5], 'East':[4, 2, 1, 6, 5, 3], 'West': [3, 2, 6, 1, 5, 4], 'South':[5, 1, 3, 4, 6, 2], 'Right':[1, 3, 5, 2, 4, 6], 'Left[1, 4, 2, 5, 3, 6]}
  sum = 1
  for i in xrange(count):
    new_cube = []
    new_cube.append(previous_cube[operation[raw_input()][0]])
    sum += new_cube[0]
    previous_cube = new_ccube
  print sum

### FIXED CODE ###

while 1:
  n = input()
  if n == 0:  break
  d = range(1, 7)
  ans = 1
  for i in range(n):
    c = raw_input()[0]
    if c == 'N': S = [1,5,2,3,0,4]
    elif c == "S": S = [4,0,2,3,5,1]
    elif c == "E": S = [3,1,0,5,4,2]
    elif c == "W": S = [2,1,5,0,4,3]
    elif c == "R": S = [0,2,4,1,3,5]
    elif c == "L": S = [0,3,1,4,2,5]
    d = [d[s] for s in S]
    ans += d[0]
  print ans
for i in range(a,b+1):
    if i <= (a+k) or i >= (b-k):
        print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())

res = set()

for i in range(a, a+k):
    if i <= b:
        res.add(i)

for i in range(b-k+1, b+1):
    if a <= i:
        res.add(i)

# print(res)

for i in sorted(list(res)):
    print(i)
print(int(input())*6.28, end="")
for _ in range(5000000):
  print("000000000000000000000000000000000000000000000000000000000000000000", end="")


### FIXED CODE ###

print(int(input())*6.28, end="")
for _ in range(100000):
  print("00000000000", end="")
def snuke_coloring(h, w, poses):
    counts = np.zeros(10, np.int64)
    searched = {}

    for pos in poses:
        for y in range(max(1, pos[0] - 2), min(h - 2, pos[0]) + 1):
            for x in range(max(1, pos[1] - 2), min(w - 2, pos[1]) + 1):
                index = (y - 1) * w + (x - 1)
                if index in searched: continue
                searched[index] = True

                count = 0
                for target in poses:
                    if x <= target[1] and target[1] <= x + 2 and \
                       y <= target[0] and target[0] <= y + 2:
                       count += 1
                counts[count] += 1

    nonzero_count = int(np.sum(counts))
    counts[0] = (h - 2) * (w - 2) - nonzero_count
    print(counts)

h, w, n = map(int, input().split())
poses = [tuple(map(int, input().split())) for _ in range(n)]
snuke_coloring(h, w, poses)

### FIXED CODE ###

import numpy as np

def snuke_coloring(h, w, poses):
    counts = np.zeros(10, np.int64)
    searched = {}

    for pos in poses:
        for y in range(max(1, pos[0] - 2), min(h - 2, pos[0]) + 1):
            for x in range(max(1, pos[1] - 2), min(w - 2, pos[1]) + 1):
                index = y * w + x
                if index in searched:
                    searched[index] = searched[index] + 1
                else:
                    searched[index] = 1

    for v in searched.values():
        counts[v] += 1

    nonzero_count = int(np.sum(counts))
    counts[0] = (h - 2) * (w - 2) - nonzero_count
    for v in counts: print(v)

h, w, n = map(int, input().split())
poses = [tuple(map(int, input().split())) for _ in range(n)]
snuke_coloring(h, w, poses)
n,*a=map(int,open(0).read().split())
for i in range(n):
  s=[0]+a[:i]+a[i+1:]+[0]
  print(sum(abs(s[t]-s[t+1])for t in range(n)))

### FIXED CODE ###

a,b,c,d=map(int,open(0).readlines());print([a,b][a>b]+[c,d][c>d])
#!/usr/bin/env python3

# import sys
# sys.setrecursionlimit(200000)  # ttk

MOD = 1000000007
fact = []

def main():
    n = int(input())
    an = list(map(int, input().split()))
    init_fact(100000)
    c, w = cost_ways(an)
    print(c)

def cost_ways(a):  # ttk: memoization
    l = len(a)
    sum_cost = 0
    sum_ways = 0
    for ip in range(l):
        local_cost = sum(a)  # ttk: ruiseki-wa
        ll = ip
        lr = l - ip - 1
        if ll >= 1:
            cl, wl = cost_ways(a[:ip])
        else:
            cl, wl = 0, 1
        if lr >= 1:
            cr, wr = cost_ways(a[ip + 1:])
        else:
            cr, wr = 0, 1
        co = combi(ll + lr, ll) if ll >= 1 and lr >= 1 else 1
        c = local_cost * co * wl * wr + cl * co * wr + cr * co * wl
        sum_cost = (sum_cost + c) % MOD
        sum_ways = (sum_ways + co * wl * wr) % MOD
    return sum_cost, sum_ways

def combi(n, k):
    numera = fact[n]
    denomi = (fact[n - k] * fact[k]) % MOD
    return (numera * inv(denomi)) % MOD

def init_fact(maxn):
    assert len(fact) == 0
    fact.append(1)
    for i in range(1, maxn + 1):
        fact.append((fact[i - 1] * i) % MOD)

def inv(n):
    return pow(n, MOD - 2)

def pow(n, p):
    if p == 0:
        return 1
    elif p % 2 == 0:
        x = pow(n, p // 2)
        return (x * x) % MOD
    else:
        x = pow(n, p - 1)
        return (x * n) % MOD

main()


### FIXED CODE ###

#!/usr/bin/env python3

# import sys
# sys.setrecursionlimit(200000)  # ttk

MOD = 1000000007
fact = []
q = []

def main():
    n = int(input())
    an = list(map(int, input().split()))
    init_fact(100000)
    init_q(100000, n)
    res = 0
    for j, a in enumerate(an):
        res += a * (q[n - j] + q[j + 1] - q[1])
        res %= MOD
    print(res)

def init_q(maxn, n):
    assert len(q) == 0
    assert len(fact) == maxn + 1
    q.append(0)
    for l in range(1, maxn + 1):
        dq = fact[n] * inv(l)
        q.append((q[-1] + dq) % MOD)

def init_fact(maxn):
    assert len(fact) == 0
    fact.append(1)
    for i in range(1, maxn + 1):
        fact.append((fact[i - 1] * i) % MOD)

def inv(n):
    return pow(n, MOD - 2)

def pow(n, p):
    if p == 0:
        return 1
    elif p % 2 == 0:
        x = pow(n, p // 2)
        return (x * x) % MOD
    else:
        x = pow(n, p - 1)
        return (x * n) % MOD

main()
# -*- coding: utf-8 -*-2 1
import math
    
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2:
    print(int(((math.factorial(k))/2- N * M)))

### FIXED CODE ###

N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2: 
    int((N + M) * (N + M - 1) / 2 - (N * M))
    print(int(k * (k - 1) / 2 - (N * M)))
a, b, c, d = int(map(int, input().split()))
print(max(a*c, max(a*d, max(b*c, b*d))))


### FIXED CODE ###

a, b, c, d = map(int, input().split())
print(max(a*c, max(a*d, max(b*c, b*d))))
N = int(input())
arr = list(map(int, input().split()))
memo = [0]*((max(arr)+N)*2)
ans = 0
for i in range(N):
    if (i+1)-arr[i] >= 0:
        ans += memo[(i+1)-arr[i]]
    if (i+1)+arr[i] > 0:
        memo[(i+1)+arr[i]] += 1
print(ans)

### FIXED CODE ###

from collections import defaultdict
d = defaultdict(int)
N = int(input())
arr = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans += d[(i+1)-arr[i]]
    d[(i+1)+arr[i]] += 1
print(ans)
S = int(input())
T = int(input())

cnt=0
for i in range(len(S)):
    if S[i]==T[i]:
        cnt+=1
print(cnt)

### FIXED CODE ###

S = str(input())
T = str(input())

cnt=0
for i in range(len(S)):
    if S[i]==T[i]:
        cnt+=1
print(cnt)
print((int(input)-1)*(int(input)-1))

### FIXED CODE ###

X, t = map(int, input().split())
print((X-1)*(t-1))
x,y = map(int,input().split())
if x*y　%2==0:
    print("Even")
elif x*y%2==1:
    print("Odd")


### FIXED CODE ###

a,b = map(int,input().split())
if a*b%2==0:
    print('Even')
elif a*b%2==1:
    print('Odd')
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
 
from math import ceil
 
D, G = [int(t) for t in input().split()]
p = []
c = []
for i in range(D):
    p_, c_ = [int(t) for t in input().split()]
    p.append(p_)
    c.append(c_)
 
def minsolve(G, p, c, i):
    """100i点以下の問題だけでGを達成する最小問題数"""
    if i <= 0:
        return float('inf')
    n = min(ceil(G / (100 * i)), p[i-1])
    s = 100 * i * n
    if n == p[i-1]:
        s += c[i-1]
    if s >= G:
        return min(n, minsolve(G, p, c, i-1))
    else:
        return min(n + minsolve(G - s, p, c, i-1), minsolve(G, p, c, i-1))
 
m = min(minsolve(G, p, c, i) for i in range(1, D+1))
print(m)

### FIXED CODE ###

R = int(input())

if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')
import sys
sys.setrecursionlimit(pow(10,9)+7)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

X, Y = map(int,input().split())
a=(-X+2*Y)/3
b=(2*X-Y)/3
if a.is_integer()==False or b.is_integer()==False:
    print(0)
else:
    print(int(cmb(a+b,b)%(pow(10,9)+7)))   

### FIXED CODE ###

p = 1000000007

X, Y = map(int, input().split())

if (X + Y) % 3 != 0:
    print(0)
    exit()

a = (2 * Y - X) // 3
b = (2 * X - Y) // 3

if a < 0 or b < 0:
    print(0)
    exit()

n = a + b
fac = [0] * (n + 1)
fac[0] = 1
for i in range(n):
    fac[i + 1] = fac[i] * (i + 1) % p


def mcomb(n, k):
    if n == 0 and k == 0:
        return 1
    if n < k or k < 0:
        return 0
    return fac[n] * pow(fac[n - k], p - 2, p) * pow(fac[k], p - 2, p) % p


print(mcomb(n, a))
#他者の解答を参考にした
import sys
from collections import Counter
from heapq import heapify, heappop, heappush
read = sys.stdin.read

N, K, *td = map(int, read().split())
dt = sorted(zip(td[1::2], td[::2]), reverse=True)

candidates = []
points = sum([i for i, j in dt[:K]]) + len(set([j for i, j in dt[:K]])) ** 2
neta_group = Counter([j for i, j in dt[:K]])
candidates.append(points)

heap = [(-i, j) for i, j in dt[K:]]
heapify(heap)
manzoku = dt[:K]
heapify(manzoku)

while heap:
    oishisa, neta = heappop(heap)
    oishisa = -oishisa
    if not neta_group.get(neta):
        oishisa2, neta2 = heappop(manzoku)
        if neta_group[neta2] == 1:
            heappush(heap, (-oishisa2, neta2))
        else:
            neta_group[neta2] -= 1
            neta_group[neta] = 1
            heappush(heap, (-oishisa, neta))
            points = points - oishisa2 + oishisa - (len(neta_group.keys()) - 1) ** 2 + len(neta_group.keys()) ** 2
            candidates.append(points)

print(max(candidates))

### FIXED CODE ###

import sys
from operator import itemgetter
read = sys.stdin.read

N, K, *td = map(int, read().split())
td = sorted(zip(*[iter(td)] * 2), key=itemgetter(1), reverse=True)

stack = []
taste = 0
neta_group = set()
for t, d in td[:K]:
    taste += d
    if t in neta_group:
        stack.append(d)
    else:
        neta_group.add(t)

variety = len(neta_group)
candidates = [taste + variety ** 2]

if N == K:
    print(candidates[0])
    exit()

rest = list(reversed(td[K::]))

while rest and stack:
    t1, d1 = rest.pop()
    if t1 not in neta_group:
        neta_group.add(t1)
        d2 = stack.pop()
        variety += 1
        taste = taste - d2 + d1

        candidates.append(taste + variety ** 2)

print(max(candidates))
A=list(map(int,input().split()))
ans = 0
if A[0] >= A[3]:
    ans = A[3]
else:
    A[3] = A[3]-A[0]
    ans = A[0]
    A[3] = A[3] -A[1]
    if A[3] > 0:
        ans = ans - A[3]
print(ans)

### FIXED CODE ###

s=input()
t=input()
if len(s)+1 == len(t) and t.startswith(s):
    print('Yes')
else:
    print('No')
from collections import Counter
from itertools import combinations
from functools import lru_cache
import sys
sys.setrecursionlimit(10**7)
@lru_cache(maxsize=None)

def kaijou(n):
    if n <= 1:
        return 1
    return kaijou(n-1)*n

def comb(n,m):
    return kaijou(n)/kaijou(m)/kaijou(n-m)

n = int(input())
a = list(map(int,input().split()))
A = [0]
for i in a:
    A.append(A[-1]+i)
ans = 0
B = Counter(A)
for i in B.values():
    if i >= 2:
        ans += comb(i,2)
print(int(ans))

### FIXED CODE ###

from collections import Counter
n = int(input())
A = [0]
for i in map(int,input().split()):
    A.append(A[-1]+i)
ans = 0
B = Counter(A)
for i in B.values():
    if i >= 2:
        ans += int(i*(i-1)/2)
print(ans)
import sys
input = sys.stdin.readline

N = int(input())
A = [None]*N
B = [None]*N
K = 0

adj_list=[[] for _ in range(N)]
c_list = [[] for _ in range(N)]

for i in range(N-1):
    A[i],B[i] = map(int,input().split())
    adj_list[A[i]-1].append(B[i]-1)
    adj_list[B[i]-1].append(A[i]-1)
    
#幅優先で着色
def bfs(node_num,p_num,p_col):
    global K
    for i in range(len(adj_list[node_num])):
        to=adj_list[node_num][i]
        #親以外につながる辺を塗る
        if to!=p_num:
            #色をiで振っていくが，もし親の色がiよりも小さい場合，色を１つ進める
            c_to=i
            if i>=p_col:
                c_to+=1
            if c_to>K:
                K=c_to
            c_list[node_num].append(c_to)
            bfs(to,node_num,c_to)
        else:
            #indexを揃えるため-1で埋める？
            c_list[node_num].append(-1)

#計算，出力
bfs(0,-1,-1)
print(K)
for i in range(N-1):
    j=adj_list[A[i]-1].index(B[i]-1)
    print(c_list[A[i]-1][j])

### FIXED CODE ###

#Edgeの組を拾う時に，辞書が良いかも？
import sys
input = sys.stdin.readline

N = int(input())
E=[[] for _ in range(N)]

index ={}

for i in range(N-1):
    a,b = map(int,input().split())
    E[a-1].append(b-1)
    E[b-1].append(a-1)
    index[(a-1,b-1)]=i
    index[(b-1,a-1)]=i

K=0
#ここに答えを入れていく，
ans=[None]*(N-1)

#dfs,root=-1
#Q=[(node,pare)]
Q=[(0,-1)]
while(Q):
    node,p=Q.pop()
    col=1
    #根の時
    if p==-1:
        for to in E[node]:
            #ansの適切な位置に色情報を入れる
            ans[index[(node,to)]]=col
            col +=1
            K=max(col,K)
            Q.append((to,node))
    #根ではない時
    else:
        for to in E[node]:
            if to==p:
                continue
            #親の色と同じなら1を足す．
            col+=(col==ans[index[(node,p)]]) 
            ans[index[(node,to)]]=col
            col+=1
            K=max(col,K)
            Q.append((to,node))

print(K-1)
print(*ans,sep="\n")
print(int(input)()**2)

### FIXED CODE ###

print(int(input())**2)
opperations = list(input())
display_stack = []
for opperation in opperations:
    if opperation == "B":
        if display_stack:
            display_stack.pop()
    else:
        display_stack.append(opperation)
print(''.join(display_stack))
ß


### FIXED CODE ###


opperations = list(input())
display_stack = []
for opperation in opperations:
    if opperation == "B":
        if display_stack:
            display_stack.pop()
    else:
        display_stack.append(opperation)
print(''.join(display_stack))
n = int(input())
n_list =[]
for i in range(n+1):
  n_list.append(int(input()))
print(set(len(n_list)))  

### FIXED CODE ###

n = int(input())
n_list =[]
for i in range(n):
  n_list.append(int(input()))
print(len(set(n_list)))
A=[int(input()) for _ in range(5)]
k=int(input())

if max(A)-min(A)>k:
	print(":(")
else:
	print("Yay!

### FIXED CODE ###

A=[int(input()) for _ in range(5)]
k=int(input())

if (max(A)-min(A))>k:
	print(":(")
else:
	print("Yay!")
S = input()
S = list(S)
count = 0


for j in range(200) :
    if len(S) < 2:
        break
    
    if S[0] != S[1] :
        S.pop(0)
        S.pop(0)
        count+=2
    
    
    for i in range(1,len(S)-2) :
        print(S, i)
        if S[i] != S[i+1] :
            if S[i-1] != S[i+2] :
                S.pop(i)
                S.pop(i)
                count +=2
                break
            
print(count)
        


### FIXED CODE ###

S = input()
C1 = S.count("0")
C2 = S.count("1")

print(min(C1,C2)*2)
D = int(input())
n_eve = 25 - D
text = "Christmas"
for _ in n_eve:
    text += " Eve"
print(text)

### FIXED CODE ###

D = int(input())
n_eve = 25 - D
text = "Christmas"
for _ in range(n_eve):
    text += " Eve"
print(text)
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
g = []
for i in range(n+1): g.append([])

for i in range(n-1):
    a, b, c = na()
    g[a].append((b,c))
    g[b].append((a,c))

q,k = na()

def dfs(cur, pre, g, par, dw, w):
    dw[cur] = w
    par[cur] = pre
    for e in g[cur]:
        if e[0] != pre:
            dfs(e[0], cur, g, par, dw, w + e[1])

par = [-1] * (n+2)
dw = [-1] * (n+2)
dfs(k, -1, g, par, dw, 0)

for z in range(q):
    x, y = na()
    print(dw[x] + dw[y])



### FIXED CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
g = []
for i in range(n+1): g.append([])

for i in range(n-1):
    a, b, c = na()
    g[a].append((b,c))
    g[b].append((a,c))

q,k = na()

def dfs(cur, pre, g, par, dw, w):
    dw[cur] = w
    par[cur] = pre
    for e in g[cur]:
        if e[0] != pre:
            dfs(e[0], cur, g, par, dw, w + e[1])

par = [-1] * (n+2)
dw = [-1] * (n+2)
from queue import Queue
qs = Queue()
qs.put(k)
dw[k] = 0

while not qs.empty():
    cur = qs.get()
    for e in g[cur]:
        if e[0] != par[cur]:
            par[e[0]] = cur
            dw[e[0]] = dw[cur] + e[1]
            qs.put(e[0])


# dfs(k, -1, g, par, dw, 0)

for z in range(q):
    x, y = na()
    print(dw[x] + dw[y])
n,m = map(int,input().split())
edges = []
for _ in range(m):
    edges.append(list(map(int,input().split())))
ans = []
cur = ((n-1)*n)//2
par = {i:i for i in range(1,n+1)}
size = {i:1 for i in range(1,n+1)}
rank = {i:0 for i in range(1,n+1)}
def find(x):
    if x != par[x]:
        par[x] = find(par[x])
    return par[x]

def union(x,y):
    px,py = find(x),find(y)
    res = 0
    if px != py:
        res = size[px] * size[py]
        if rank[x] < rank[y]:
            par[px] = py
            size[py] += size[px]
        else:
            par[py] = px
            size[px] += size[py]
            if rank[x] == rank[y]:
                rank[x] += 1
    return res

for i in range(m-1,-1,-1):
    ans.append(cur)
    x,y = edges[i]
    cur -= union(x,y)
for i in range(m-1,-1,-1):
    print(ans[i])

### FIXED CODE ###

n,m = map(int,input().split())
edges = []
for _ in range(m):
    edges.append(list(map(int,input().split())))
ans = []
cur = ((n-1)*n)//2
par = {i:i for i in range(1,n+1)}
size = {i:1 for i in range(1,n+1)}
rank = {i:0 for i in range(1,n+1)}
def find(x):
    if x != par[x]:
        par[x] = find(par[x])
    return par[x]

def union(x,y):
    px,py = find(x),find(y)
    res = 0
    if px != py:
        res = size[px] * size[py]
        if rank[px] < rank[py]:
            par[px] = py
            size[py] += size[px]
        else:
            par[py] = px
            size[px] += size[py]
            if rank[px] == rank[py]:
                rank[px] += 1
    return res

for i in range(m-1,-1,-1):
    ans.append(cur)
    x,y = edges[i]
    cur -= union(x,y)
for i in range(m-1,-1,-1):
    print(ans[i])
n,y = map(int,input().split())
ans_a = -1
ans_b = -1
ans_c = -1

for i in range(n+1):
  for j in range(n+1):
    x = y - 10000*i - 5000*j
    if x % 1000 == 0:
      k = x / 10000
      ans_a = i
      ans_b = j
      ans_c = k
print(ans_a,ans_b,ans_c)

### FIXED CODE ###

S = input().split('/')
S[0] = "2018"
ans = '/'.join(S)
print(ans)
N = int(input())
p = list(map(int, input().split()))

count = 0
for i in range(N):
  if p[i] == i+1:
    p[i], p[i+1] = p[i+1], p[i]
    count += 1
if p[N-1] == N:
  p[N-2], p[N-1] = p[N-1], p[N-2]
  count += 1
  
print(count)

### FIXED CODE ###

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

count = 0
for i in range(N-1):
  if p[i] == i+1:
    p[i], p[i+1] = p[i+1], p[i]
    count += 1
if p[N-1] == N:
  p[N-2], p[N-1] = p[N-1], p[N-2]
  count += 1
  
print(count)