Harryxun/stf_run huggingface dataset:
def dfs(n,c):
    if Ans[n] == -1:
        Ans[n] = c
        for m,w in Data[n]:
            if w % 2 == 0:
                dfs(m,c)
            else:
                dfs(m,1-c)
    elif Ans[n] == c:
        return
    else:
        return

N = int(input())
Data = []
Ans  = [-1] * N
for i in range(N):
    Data.append([])
for i in range(N-1):
    u,v,w = map(int,input().split())
    Data[u-1].append([v-1,w])
    Data[v-1].append([u-1,w])
dfs(0,0)

for a in Ans:
    print(a)

### FIXED CODE ###

import sys
def dfs(n,c):
    if Ans[n] == -1:
        Ans[n] = c
        for m,w in Data[n]:
            if w % 2 == 0:
                dfs(m,c)
            else:
                dfs(m,1-c)
    elif Ans[n] == c:
        return
    else:
        return

sys.setrecursionlimit(100000)
N = int(input())
Data = []
Ans  = [-1] * N
for i in range(N):
    Data.append([])
for i in range(N-1):
    u,v,w = map(int,input().split())
    Data[u-1].append([v-1,w])
    Data[v-1].append([u-1,w])
dfs(0,0)

for a in Ans:
    print(a)
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [W, H, x, y] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2]), long(input_raw[3])]
    if (H /2 == y) and (W/2 == x) and (H % 2 == 0) and (W % 2 == 0):
        ans2 = 1
    else:
        ans2 = 0

    if(W * y == H * x or y * W ==  (-H * x) + W * H):
        print "%20.15f %d" % (float(W)/2.0 * H , ans2)
        return

    ans = max(min(float(H - y), float(y)) * float(W), min(float(W - x), float(x)) * float(H))
    if (H /2 == y) and (W/2 == x) and (H % 2 == 0) and (W % 2 == 0):
        ans2 = 1
    else:
        ans2 = 0
    print "%20.15f %d" % (ans, ans2)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, X] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    L = [int(input_raw[i]) for i in range(N)]
    D = 0
    ans = 1
    for i in range(N):
        D = D + L[i]
        if D <= X:
            ans += 1
    print ans
if __name__ == '__main__':
    main()
k, s = map(int, input().split())
res = 0
for a in range(k + 1):
  for b in range(k + 1):
    for c in range(k + 1):
      if a + b + c == s:
        res += 1
        break:
        
print(res)

### FIXED CODE ###

k, s = map(int, input().split())
res = 0
for a in range(k + 1):
  for b in range(k + 1):
    z = s - a - b
    if z >= 0 and z <= k:
        res += 1
        
print(res)
def readinput():
    n=int(input())
    l=list(map(int,input().split()))
    return n,l

def main(n,a):
    MOD=10**9+7
    hist=[0]*61
    bs=[]
    for i in range(n):
        # s=list(reversed(bin(a[i])[2:]))
        # for j in range(len(s)):
        #     if s[j]=='1':
        #         hist[j]+=1
        # bs.append(s)

        s=bin(a[i])[2:]
        for j in range(len(s)):
            if s[j]=='1':
                hist[len(s)-j-1]+=1
        # j=0
        # ai=a[i]
        # while ai>0:
        #     if ai&1==1:
        #         hist[j]+=1
        #     ai = ai >> 1
        #     j+=1


    #print(bs)
    #print(hist)
    sum=0
    for i in range(n-1):
        s=bs[i]
        b=1
        for j in range(len(s)):
            if s[j]=='0':
                sum=(sum+hist[j]*b)%MOD
            else:
                sum=(sum+( n-i-hist[j] )*b)%MOD
                hist[j]-=1
            b*=2
        for j in range(len(s),61):
            sum=(sum+hist[j]*b)%MOD
            b*=2
    # b=1
    # for j in range(61):
    #     sum=(sum+( hist[j]*(n-hist[j])*b )%MOD )%MOD
    #     b*=2

    return sum

if __name__=='__main__':
    n,l=readinput()
    ans=main(n,l)
    print(ans)


### FIXED CODE ###

def readinput():
    n=int(input())
    l=list(map(int,input().split()))
    return n,l

def main(n,a):
    MOD=10**9+7
    hist=[0]*61
    bs=[]
    for i in range(n):
        # s=list(reversed(bin(a[i])[2:]))
        # for j in range(len(s)):
        #     if s[j]=='1':
        #         hist[j]+=1
        # bs.append(s)
        s=bin(a[i])[2:]
        for j in range(len(s)):
            if s[j]=='1':
                hist[len(s)-j-1]+=1

    #print(bs)
    #print(hist)
    sum=0
    # for i in range(n-1):
    #     s=bs[i]
    #     b=1
    #     for j in range(len(s)):
    #         if s[j]=='0':
    #             sum=(sum+hist[j]*b)%MOD
    #         else:
    #             sum=(sum+( n-i-hist[j] )*b)%MOD
    #             hist[j]-=1
    #         b*=2
    #     for j in range(len(s),61):
    #         sum=(sum+hist[j]*b)%MOD
    #         b*=2
    b=1
    for j in range(61):
        sum=(sum+( hist[j]*(n-hist[j])*b )%MOD )%MOD
        b*=2

    return sum

if __name__=='__main__':
    n,l=readinput()
    ans=main(n,l)
    print(ans)
n=int(input())
a=0
k=n//15
a+=60*k**2
While 0=n%15:
  if not n%3=0 and not n%5=0:
    a+=n
  n-=0
print(a)

### FIXED CODE ###

n=int(input())
a=0
k=n//15
a+=60*k**2
while not 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=1
print(a)
l=(int(input().split()))
b=sorted(l)
print(b[0]+b[1])

### FIXED CODE ###

a, b, c = map(int, input().split())
print(min(a+b,a+c,b+c))
import copy
import sys
from collections import deque
H, W = map(int,input().split())
C_h, C_w = list(map(lambda x: int(x) - 1, input().split()))
D = list(map(lambda x: int(x) - 1, input().split()))
S = [input() for _ in range(H)]
check_visited = [[False] * W for _ in range(H)]
dq = deque([0, C_h, C_w])
while dq:
   d, i, j = dq.popleft()
   if [i, j] == D:
      print(d)
      exit()
   if check_visited[i][j]:
      continue
   check_visited[i][j] = True
   for move_h, move_w in [[-1,0], [1,0], [0,-1], [0,1]]:
      i += move_h
      j += move_c
      if 0 <= i <= H-1 and 0 =< j <= W-1 and S[i][j] == '.' and (not check_visited[i][j]) :
         dq.appendleft([d, i, j])
   for move_h in range(-2, 3):
      for move_c in range(-2, 3):
         if move_h, move_c == 0, 0:
            continue
         i += move_h
         j += move_c
         if 0 <= i <= H-1 and 0 =< j <= W-1 and S[i][j] == '.' and (not check_visited[i][j]) :
            dp.append([d+1, i, j])
print(-1)

### FIXED CODE ###

from collections import deque
import sys
input = sys.stdin.readline

H, W = map(int, input().split())
Ch, Cw = map(lambda x: int(x) - 1, input().split())
Dh, Dw = map(lambda x: int(x) - 1, input().split())
S = [input().rstrip() for _ in range(H)]
visited = [[False] * W for _ in range(H)]
dq = deque([(0, Ch, Cw)])
while dq:
    d, i, j = dq.popleft()
    if (i, j) == (Dh, Dw):
        print(d)
        exit()
    if visited[i][j]:
        continue
    visited[i][j] = True
    for di, dj in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
        ni, nj = i + di, j + dj
        if 0 <= ni < H and 0 <= nj < W and S[ni][nj] == '.':
            dq.appendleft((d, ni, nj))
    for di in range(-2, 3):
        for dj in range(-2, 3):
            if di == dj == 0:
                continue
            ni, nj = i + di, j + dj
            if 0 <= ni < H and 0 <= nj < W and S[ni][nj] == '.' and not visited[ni][nj]:
                dq.append((d + 1, ni, nj))
print(-1)
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think([1, 3, 5, 4, 2]), 2)

    def test_2(self):
        self.assertEqual(think([9, 6, 3, 2, 5, 8, 7, 4, 1]), 5)


def solve():
    p = read()
    result = think(p)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(data):
    n = len(data)
    count = 0
    for i in range(n):
        if i + 2 >= n:
            break
        if data[i] < data[i + 1] < data[i + 2]:
            count += 1
    return count


def write(result):
    print(result)


if __name__ == '__main__':
    unittest.main()
    # solve()

### FIXED CODE ###

import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think([1, 3, 5, 4, 2]), 2)

    def test_2(self):
        self.assertEqual(think([9, 6, 3, 2, 5, 8, 7, 4, 1]), 5)


def solve():
    p = read()
    result = think(p)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(data):
    n = len(data)
    count = 0
    for i in range(n):
        if i + 2 >= n:
            break
        if data[i] < data[i + 1] < data[i + 2] or data[i] > data[i + 1] > data[i + 2]:
            count += 1
    return count


def write(result):
    print(result)


if __name__ == '__main__':
    # unittest.main()
    solve()
from sys import setrecursionlimit
setrecursionlimit(10 ** 9)

n, a, b = [int(i) for i in input().split()]

if (a ^ b) % 2 == 1 and (a ^ b) != 1:
    print('NO')
    exit()

def dfs(i, a):
    if i == 1:
        return [a & 1, ~a & 1]
    res = dfs(i - 1)
    if a & ((1 << i) - 1) != res[0]:
        res.reverse()
    return [(a & (1 << (i - 1))) + r for r in res] + [((~a) & (1 << (i - 1))) + r for r in res[::-1]]

ans = [(1 << (n - 1)) + r for r in dfs(n - 1, b)[::-1]] + [r for r in dfs(n - 1, a)]
index = ans.index(a)
print('YES')
print(*(ans[index:] + ans[:index]))

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10 ** 9)

n, a, b = [int(i) for i in input().split()]

if bin(a ^ b).count('1') % 2 == 0:
    print('NO')
    exit()

def dfs(i, a, b):
    if i == 1:
        return [a, b]
    d = (a ^ b) & -(a ^ b)
    ad = ((a & (~d ^ d - 1)) >> 1) + (a & d - 1)
    bd = ((b & (~d ^ d - 1)) >> 1) + (b & d - 1)
    c = ad ^ 1

    res1 = dfs(i - 1, ad, c)
    res2 = dfs(i - 1, bd, c)
    ans1 = [((r & ~(d - 1)) << 1) + (r & d - 1) + (d & a) for r in res1]
    ans2 = [((r & ~(d - 1)) << 1) + (r & d - 1) + (d & b) for r in res2[::-1]]
    return ans1 + ans2

print('YES')
print(*dfs(n, a, b))
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7

def mapline(t = int):
    return map(t, sysread().split())
def mapread(t = int):
    return map(t, read().split())

def run():
    N, *A = mapread()
    ans = 1
    current = [0,0,0]
    for a in A:
        transition = 0
        cache = None
        for i, c in enumerate(current):
            if c == a:
                transition += 1
                cache = i
        ans *= transition
        ans %= mod
        current[cache] += 1
    print(ans)

if __name__ == "__main__":
    run()


### FIXED CODE ###

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7

def mapline(t = int):
    return map(t, sysread().split())
def mapread(t = int):
    return map(t, read().split())

def run():
    N, *A = mapread()

    dp = [defaultdict(lambda:0) for _ in range(N+1)]
    dp[0][(0,0,0)] = 1
    for i in range(N):
        a = A[i]
        k = i + 1
        for key in dp[k-1].keys():
            for ii, v in enumerate(key):
                if v == a:
                    tmp = list(key)
                    tmp[ii] += 1
                    dp[k][tuple(tmp)] += dp[k-1][key] % mod
    ans = 0
    for key in dp[N].keys():
        ans = (ans + dp[N][key]) % mod
    #print(dp)
    print(ans)


if __name__ == "__main__":
    run()
N,M = map(int,input().split())
tree = list(map(int,input().split())) #比較用
tree_sub = tree #データの削除用
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if (tree[a-1] > tree[b-1]) and (tree[b-1]== tree_sub[b-1]):
        tree_sub[b-1] = 0
    elif (tree[a-1] < tree[b-1]) and (tree[a-1] == tree_sub[a-1]):
        tree_sub[a-1] = 0
for i in range(M):
    if tree_sub[i] !=0:
        count += 1
print(count)

### FIXED CODE ###

N,M = map(int,input().split())
tree = list(map(int,input().split())) #比較用
tree_sub = list(tree) #データの削除用
for i in range(M):
    a,b = map(int,input().split())
    if tree[a-1] > tree[b-1]:
        tree_sub[b-1] = 0
    elif tree[a-1] < tree[b-1]:
        tree_sub[a-1] = 0
    else:
        tree_sub[a-1] = 0
        tree_sub[b-1] = 0
print(len(tree_sub)-tree_sub.count(0))
ame = N * (N + 1) / 2
print(ame)

### FIXED CODE ###

# 入力
n = int(input())
# result初期化
result = 0
# １からNまで繰り返し
for i in range(1,n+1):
    # 等差数列
    count = i
    result = result + count
# 結果を表示
print(result)
N, Q = map(int, input().split())
s = input()
TD = [input().split() for _ in range(Q)]

def check(x):
    #Q回の呪文後の位置をチェック
    #1 <= x <= N
    for t, d in TD:
        if s[x] == t:
            if d == 'L':
                x -= 1
            else:
                x += 1
        else:
            continue

        if x == 0:
            return -1
        if x == N + 1:
            return 1
    return 0

ok = 0
ng = N + 1
while ng - ok > 1:
    mid = (ok + ng) // 2
    if check(mid) == -1:
        ok = mid
    else:
        ng = mid
l = ok


ok = N + 1
ng = 0
while ok - ng > 1:
    mid = (ok + ng) // 2
    if check(mid) == 1:
        ok = mid
    else:
        ng = mid

r = ng

print(r - l)

### FIXED CODE ###

N, Q = map(int, input().split())
s = '.' + input() + '.'
TD = [input().split() for _ in range(Q)]

def check(x):
    #Q回の呪文後の位置をチェック
    #1 <= x <= N
    for t, d in TD:
        if s[x] == t:
            if d == 'L':
                x -= 1
            else:
                x += 1
        if x == 0:
            return -1
        if x == N + 1:
            return 1
    return 0

ok = 0
ng = N + 1
while ng - ok > 1:
    mid = (ok + ng) // 2
    if check(mid) == -1:
        ok = mid
    else:
        ng = mid
l = ok


ok = N + 1
ng = 0
while ok - ng > 1:
    mid = (ok + ng) // 2
    if check(mid) == 1:
        ok = mid
    else:
        ng = mid

r = ng

print(r - l)
A,V = map(int,input().split())
B,W = map(int,input().split())
T
if B-A+(W-V)*T > 0:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if abs(B-A)+(W-V)*T > 0:
  print("NO")
else:
  print("YES")
a, b, c = map(raw_input().split())
temp = 0

if b < c:
  temp = b
  b = c
  c = temp
if a < b:
  temp = a
  a = b
  b = temp

print '{0} {1} {2}'.format(a, b, c)

### FIXED CODE ###

x = map(int, raw_input().split())

x.sort()

print '{0} {1} {2}'.format(x[0], x[1], x[2])
import numpy as np

temp=list(map(int, input().split()))
N=temp[0]
Q=temp[1]

matrix=np.zeros((N, N), dtype=int)
for i in range(N):
  matrix[i, i]=1

for i in range(N-1):
  temp=list(map(int, input().split()))
  matrix[int(temp[0]-0.5), int(temp[1]-0.5)]=1
  
index=int(N-0.5)
while index>0:
  matrix[index, :]+=np.sum(matrix*matrix[index, :].reshape(-1, 1), axis=0)
  index=int(index-0.5)
  
matrix[0, :]+=np.sum(matrix*matrix[0, :].reshape(-1, 1), axis=0)

matrix[matrix>0]=1

counter=np.zeros(N, dtype=int)
for i in range(Q):
  temp=list(map(int, input().split()))
  counter+=matrix[int(temp[0]-0.5), :]*temp[1]
  
print(' '.join(map(str, map(int, counter.tolist()))))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def input():
  return sys.stdin.readline()[:-1]

N, Q=map(int, input().split())

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

px=[list(map(int, input().split())) for i in range(Q)]

counter=[0]*(N+1)
for i in range(Q):
  counter[px[i][0]]+=px[i][1]
  
def f(num, prenum=-1, p=0):
  counter[num]+=p
  for postnum in link[num]:
    if postnum==prenum:
      continue
    f(postnum, num, counter[num])
    
f(1)

print(*counter[1:])
N,X = map(int, input().split())
L = list(map(int, input().split()))
i = 1
D = 0
count = 0

while D < X+1:
  D += L[i-1]
  i += 1
  count += 1

print(count)
  

### FIXED CODE ###

N,X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
D = 0

for i in range(N):
  D += L[i]
  if D <= X:
    count += 1
  else:
    break

print(count)
import math
a,b=map(int,input().split())
gcd = math.gcd(a,b)

#print(gcd)
pnum = set()

if gcd == 1:
    print(1)
elif gcd == 2:
    print(2)
else:
    pnum.add(2)
    for num in range(3,gcd+1):
        if gcd%num ==0:
            ptf = True
            for p in pnum:
                if num%p==0:
                    ptf = False
                    break
            if ptf ==True:
                pnum.add(num)
            
    print(len(pnum)+1)#1の分を足す

### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
      
    divisors.sort()
    return divisors

import fractions
a,b=map(int,input().split())
gcd = fractions.gcd(a,b)

#print(gcd)
pnum = set()

if gcd == 1:
    print(1)
elif gcd == 2:
    print(2)
else:
    devlist = make_divisors(gcd)
    #print(devlist)
    #pnum.add(2)
    
    for num in devlist:
        if (num!=1):
            #print("gg",num)
            ptf = True
            for p in pnum:
                if num%p==0:
                    ptf = False
                    break
            if ptf ==True:
                pnum.add(num)
            
    print(len(pnum)+1)#1の分を足す
import math   
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i+1 == a[i]:
        b = a[i]
        c = a[i+1]
        a[i] = c
        a[i+1] = b
        ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i+1 == a[i] and i != n-1:
        b = a[i]
        c = a[i+1]
        a[i] = c
        a[i+1] = b
        ans += 1
    elif i+1 == a[i]:
        ans += 1
print(ans)
list1 = list(map(int, input().split()))
list1.sort()
print(list[0]+list[1])

### FIXED CODE ###


list1 = list(map(int, input().split()))
list1.sort()
print(list1[0]+list1[1])
mport sys
input=sys.stdin.readline

l=list(map(int,input().split()))
a,b,c=sorted(l)
#print(a,b,c)
if a%2==b%2 and a%2==c%2:
    print((2*c-a-b)//2)
elif a%2==b%2:
    print((2*c-2-a-b)//2+1)
else:
    print((2*c+1-a-b)//2+1)

### FIXED CODE ###

import sys
input=sys.stdin.readline

l=list(map(int,input().split()))
a,b,c=sorted(l)
#print(a,b,c)
if a%2==b%2 and a%2==c%2:
    print((2*c-a-b)//2)
elif a%2==b%2:
    print((2*c-2-a-b)//2+1)
else:
    print((2*c+1-a-b)//2+1)
a=int(input())
b=int(input())
print("GREATER", if a>b else "LESS" if a<b else "EQUAL")

### FIXED CODE ###

a=int(input())
b=int(input())
print("GREATER" if a>b else "LESS" if a<b else "EQUAL")
def print_list_split_whitespace(a):
    for x in a[:-1]:
        print(x, end=' ')
    print(a[-1])


def calc_puddle(map, l, r):
    ans = 0
    top = map[l]
    before = map[l]
    for i in range(l + 1, r + 1):
        be_ans = ans
        if map[i] == before:
           ans += top - map[i]
        elif map[i] < before:
            ans += top - map[i] - 0.5
            before = map[i]
        else:
            ans += top - map[i] + 0.5
            before = map[i]
        #print(ans - be_ans)
    return int(ans)


cross_section = list(input())
map = [0]
y = 0
for c in cross_section:
    if c == "/":
        y += 1
        map.append(y)
    elif c == "\\":
        y += -1
        map.append(y)
    else:
        map.append(y)
max_right = len(map) - 1
#print(map)
#print(len(map))

left = 0
right = 1
ans = []
while left < max_right:
    #print(left, right)
    if map[left] <= map[right]:
        left = right
        right += 1
        if right == max_right:
            left = max_right
    else:
        right += 1
        if map[left] == map[right]:
            ans.append(calc_puddle(map, left, right))
        elif right == max_right:
            left += 1
            right = left + 1
            if right == max_right:
                left = max_right

print(sum(ans))
ans.insert(0, len(ans))
print_list_split_whitespace(ans)


### FIXED CODE ###

def print_list_split_whitespace(a):
    for x in a[:-1]:
        print(x, end=' ')
    print(a[-1])
    
s = list(input())
st1 = []
st2 = []

for index, c in enumerate(s):
    if c == "\\":
        st1.append(index)
    elif c == "/":
        if len(st1) >= 1:
            pop_index = st1.pop()
            area = index - pop_index
            while True:
                if len(st2) >= 1:
                    ind, pop_area = st2.pop()
                else:
                    st2.append((index, area))
                    break
                if ind < pop_index:
                    st2.append((ind, pop_area))
                    st2.append((index, area))
                    break
                else:
                    area += pop_area

a = 0
k = len(st2)
ls = [k]
for _, s in st2:
    a += s
    ls.append(s)

print(a)
print_list_split_whitespace(ls)
import itertools


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

if (N == 1 and A != B) or (B < A):
    print(0)
    exit()

combi = list(itertools.combinations_with_replacement(
    range(A, B + 1, 1), N - (B - A)))


sum_array = []
for x in combi:
    sumX = A + sum(x) + B
    sum_array.append(sumX)
print(len(set(sum_array)))


### FIXED CODE ###

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

if (N == 1 and A != B) or (B < A):
    print(0)
else:
    print((B - A) * (N - 2) + 1)
n=int(input())
paper=[]
for _ in range(n):
    a = input()
    if a in paper:
        paper.remove(a)
    else:
        paper.add(a)
print(len(paper))

### FIXED CODE ###

n=int(input())
s=set()
for _ in range(n):
    a = input()
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))
N, K = map(int, input().split())
tree = []
diff = 10 ** 9
for n in range(N):
    tree.append(int(input()))
tree.sort()
for i in range(N - (K - 1)):
    print(tree[i], tree[i + 1], tree[i + 2])
    if tree[i + K - 1] - tree[i] < diff:
        diff = tree[i + K - 1] - tree[i]
print(diff)

### FIXED CODE ###

N, K = map(int, input().split())
tree = [int(input()) for n in range(N)]
diff = 10 ** 9
tree.sort()
for i in range(N - (K - 1)):
    if tree[i] == tree[i + 1] == tree[i + 2]:
        diff = 0
        break
    elif tree[i + K - 1] - tree[i] < diff:
        diff = tree[i + K - 1] - tree[i]
print(diff)
N , T  = map(int,input().split())
tmp_a = 1001
result = 1001
count = 1
while count < N+1:
 a,b = map(int,input().split())
 if b < T and a < tmp_a:
  result = count
  tmp_a = a
 count = count + 1
if result == 1001:
 print('TLE')
else:
 print(result)

### FIXED CODE ###

N = int(input())
if N==1: 
 print('Hello World')
else:
 A = int(input())
 B = int(input())
 print(A + B)