Harryxun/stf_run huggingface dataset:
N=int(input())
data=[input().split() for i in range(N)]
data_name=[]
for i in range(N):
    if data[i][0] in data_name:
        continue
    else:
        data_name.append(data[i][0])
data_name_sort=sorted(data_name)
#print(data_name_sort)
data_point=[]
for i in range(N):
    num=0
    for j in range(len(data_name_sort)):
        if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
    data_point.append(num)
#print(data_point)
data_sort=[i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1]
#print(data_sort)
for i in range(N):
    ans=int(data_sort(i))+1
    print(ans)

### FIXED CODE ###

N=int(input())
data=[input().split() for i in range(N)]
data_name=[]
for i in range(N):
    if data[i][0] in data_name:
        continue
    else:
        data_name.append(data[i][0])
data_name_sort=sorted(data_name)
#print(data_name_sort)
data_point=[]
for i in range(N):
    num=0
    for j in range(len(data_name_sort)):
        if data[i][0]==data_name_sort[j]:
            num+=(len(data_name)-j)*200+int(data[i][1])
        else:
            continue
    data_point.append(num)
#print(data_point)
data_sort=[i for i, _ in sorted(enumerate(data_point), key=lambda x:x[1])][::-1]
#print(data_sort)
for i in range(N):
    ans=int(data_sort[i])+1
    print(ans)
inputs=[int(i) for i in input().split()]
k=inputs[-1]
for i in range(5):
  for j in range(5-i):
    if abs(j-i)>k
    print(":(")
 		return

print("Yay!")
return
    




### FIXED CODE ###

inputs=[int(input()) for i in range(6)]
k=inputs[-1]
T=False
for i in range(5):
  for j in range(5-i):
    if abs(inputs[5-j]-inputs[i-1])>k:
      print(":(")
      quit()

print("Yay!")
import math
n,a,b=map(int,input().split())
h=[int(input()) for i in range(n)]

def explode(x):
    global n
    c=0
    for i in range(n):
        if h[i]-x*b>0:
            c+=math.ceil((h[i]-x*b)/(a-b))
    return c<=x

#二分探索用のコード

#(1)l,rは両端点でl<=r
l,r=1,10**9
#(2)l=rもしくはl=r-1のときにbreak
while l+1<r:
    #(3)その閉区間の中点(の小数部分を切り捨てたもの)
    #オーバーフローを考慮すると以下の書き方になる
    k=l+math.round((r-l)/2)
    #ここでは境目以上のxで真になるので、
    #x=kで真の場合は大きい方の端点をkにし、x=kで偽の場合は小さい方の端点をkにする
    if explode(k):
        r=k
    else:
        l=k

print(l if explode(l) else r)

### FIXED CODE ###

import math
n,a,b=map(int,input().split())
h=[int(input()) for i in range(n)]


def explode(x):
    global n
    c=0
    for i in range(n):
        if h[i]-x*b>0:
            c+=math.ceil((h[i]-x*b)/(a-b))
    return c<=x

l,r=1,10**9
while l+1<r:
    k=(l+r)//2
    if explode(k):
        r=k
    else:
        l=k

print(l if explode(l) else r)
import numpy as np
from collections import defaultdict
from functools import reduce

import numpy as np
MOD = 1000000007

def mod_add(a, b):
  return (a+b)%MOD

def mod_sub(a, b):
  return (a+MOD-b)%MOD

def mod_mul(a, b):
  return (a*b)%MOD

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = (1,0,a)
    w = (0,1,b)
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    return w[0], w[1]

def mod_inv(a):
    x, _  = extgcd(a, MOD)
    return (MOD+x%MOD)%MOD

def mod_div(a, b):
    return a*mod_inv(b)%MOD

def mod_pow(a, b):
    res = 1
    while b > 0:
        if b & 1:
            res = res * a * MOD
        a = a * a % MOD
        b >>= 1
    return res

MAX = 200010

fac  = [1,1]
finv = [1,1]
inv  = [1,1]

def COMinit():
    # fac[0] = fac[1] = 1
    # finv[0] = finv[1] = 1
    # inv[1] = 1
    for i in range(2, MAX):
        fac.append(fac[i - 1] * i % MOD)
        inv.append(MOD - inv[MOD%i] * (MOD / i) % MOD)
        finv.append(finv[i - 1] * inv[i] % MOD)

def mod_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;


# s = input()
# n = int(input())
COMinit()
N, A, B, C = list(map(int, input().split()))

a = mod_div(A, 100)
b = mod_div(B, 100)
c = mod_div(C, 100)

k_factor_memo = {}
def k_factor(M):
    if M in k_factor_memo:
        return k_factor_memo[M]
    if C == 100-C:
        res = fac[M+1]

        res = mod_div(res, mod_sub(1,c))
        k_factor_memo[M] = res
        return res
    res = mod_mul(fac[M], mod_div(c, mod_sub(1, mod_mul(2,c))))
    c2 = mod_div(c, mod_sub(1, c))
    c2 = pow(c2, M, MOD)
    c2 = mod_sub(c2, 1)
    res = mod_mul(res, c2)
    res = mod_div(res, mod_sub(1,c))
    k_factor_memo[M] = res
    return res

res = 0
an = pow(a, N, MOD)

for j in range(N):
    tmp = mod_mul(mod_mul(N, finv[N]), finv[j])
    # print(tmp)
    tmp = mod_mul(tmp, an)
    # print(tmp)
    tmp = mod_mul(tmp, pow(b, j, MOD))
    # print(tmp)
    tmp = mod_mul(tmp, k_factor(N+j))
    # print(tmp)
    res = mod_add(res, tmp)
# print(res)

bn = pow(b, N, MOD)
for j in range(N):
    tmp = mod_mul(mod_mul(N, finv[N]), finv[j])
    tmp = mod_mul(tmp, bn)
    tmp = mod_mul(tmp, pow(a, j, MOD))
    tmp = mod_mul(tmp, k_factor(N+j))
    res = mod_add(res, tmp)

print(res)


### FIXED CODE ###

import numpy as np
from collections import defaultdict
from functools import reduce

s = input()
# n = int(input())
# A = list(map(int, input().split()))
# a, b = map(int, input().split())

# print((n-2)*180)

if 15 - len(s) + s.count('o') >= 8:
  print('YES')
else:
  print('NO')
S=input()
T=input()
length=len(T)
for i in range(0,len(S)-len(T)+1):
	diff=0
	for i in range(0,len(T)):
		if T[i]!=S[s+i]:
			diff+=1
	result=min(ans,diff)

print(result)


### FIXED CODE ###

S=input()
T=input()
result=len(T)
for s in range(0,len(S)-len(T)+1):
	diff=0
	for i in range(0,len(T)):
		if T[i]!=S[s+i]:
			diff+=1
	result=min(result,diff)

print(result)
X = int(input())
if X == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input()
  print(A + B)

### FIXED CODE ###

X = int(input())
if X == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A + B)
import numpy as np
import sys

x = [[int(i) for i in input().split()] for j in range(1)]
k = x[0]
s = x[1]

#k = 5
#s = 15

count = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x + y + z == s:
                count = count + 1
                break
print(count)


### FIXED CODE ###

import numpy as np
import sys

x = [[int(i) for i in input().split()] for j in range(1)]
k = x[0][0]
s = x[0][1]


#k = 5
#s = 14

count = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if z <= k and 0 <= z:
            count += 1
print(count)
r = int(input())
print(3 * a**2)

### FIXED CODE ###

r = int(input())
print(3 * r**2)
import math
a=int(input())
b=int(input())
c=int(input())

### FIXED CODE ###

a,b,c=map(int,raw_input().split())
if a+b >= c:
    print "No"
else:
    q = 4 * a * b;
    h = (c - a - b) * (c - a - b)
    if q < h:
        print "Yes"
    else:
        print "No"
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
trees[1].set_rank(1, None)

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
exit()
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
try:
    trees[1].set_rank(1, None)
except:
    print(-1)
    exit()

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))
xyz = input().split()
x,y,z = int(xyz=[0]), int(xyz[1]),int(xyz[2])

a = x + y
b = y + z
c = z + x
ptint(min([a,b,c])

### FIXED CODE ###

x,y,z = (int(x) for x in input().split())

a = x + y
b = y + z
c = z + x

print(min([a, b, c]))
a,b = (int(x) for x in input().split(' '))

c = math.fabs(a)
d = math.fabs(b)
f = (c + b) % 2

if f = 0:
  print((c+b)/2)
if f >0:
  print('IMPOSSIBLE')

### FIXED CODE ###

import math
a, b = (int(x) for x in input().split(' '))

a = abs(a)
b = abs(b)

c = a + b

if c % 2 == 0:
    print(int(c / 2))
else:
    print('IMPOSSIBLE')
n,k=map(int,input().split())

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

check=[0]*n
group=[]

for i in range(n):
    tmp=i
    if check[tmp]==0:
        tmp_group=[]
        while check[tmp]==0:
            tmp_group.append(tmp)
            check[tmp]=1
            tmp=p[tmp]-1

        group.append(tmp_group)

ans="start"

#startの最低とgoalの最高の和
for item in group:
    
    #一周すると何になるか。これはどこスタートでも同じ
    circle=0
    cnt=k
    if len(item)<k:
        for v in item:
            circle+=c[v]
        circle=circle*(k//len(item))
        circle=max(circle,0)    
        cnt=k%len(item)
    
    #一周した後のあまりで最強を探す


    goal="INF"
    
    #startは各groupのindexが入ってる
    for start in range(len(item)):
        tmp=0
        #print("start",item,start,cnt)
        for i in range(start,start+cnt):
            #print(">>",i)
            tmp+=c[item[i%len(item)]]
            #print(item[i%len(item)],c[item[i%len(item)]])
            if goal=="INF":
                goal=tmp
            else:
                goal=max(goal,tmp)

    #print(item,circle,goal)
    if ans=="start":
        ans=goal+max(0,circle)
    else:
        ans=max(ans,goal+max(0,circle))

print(ans)














### FIXED CODE ###

n,k=map(int,input().split())

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

group_score=[]
checked=[0]*n

for i in range(n):
    if checked[i]==0:
        tmp_group=[]
        tmp=i
        while checked[tmp]==0:
            checked[tmp]=1
            tmp_group.append(score[tmp])
            tmp=p[tmp]-1
        group_score.append(tmp_group)



#aryの中から連続するk個選択するときの最大
def calc(k):
    if k==0:
        return 0
    global group
    ans="INF"
    for i in range(len(group)):
        tmp=0
        for j in range(k):
            tmp+=group[(i+j)%len(group)]
            if ans=="INF":
                ans=tmp
            else:
                if ans<tmp:
                    ans=tmp
    return ans

ans=score[0]
for group in group_score:
    #一周以上する場合
    if len(group)<k:
        cycle=sum(group)
        if cycle>0:
            cycle_sum=cycle*(k//len(group))
            tmp=calc(k%len(group))
            ans=max(ans,cycle_sum+tmp)

            if k//len(group)>=2:
                cycle_sum=cycle*(k//len(group)-1)
                tmp=calc(len(group))
                ans=max(ans,cycle_sum+tmp)
          

        tmp=calc(len(group))
        ans=max(ans,tmp)



    #一周しない場合k)
    else:
        tmp=calc(k)
        ans=max(ans,tmp)

print(ans)
li = list(map(int,input().split()))
s=list(input())
cnt = 0
b = 0
for i in s:
    if i == "a":
        if cnt < li[1] + li[2]:
            cnt += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        b += 1
        if cnt < li[1] + li[2]:
            if b <= li[2]:
                cnt += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        #cnt -= 1
        print("No")
#print(a)
li = list(map(int,input().split()))
s=list(input())
cnt = 0
b = 0
for i in s:
    if i == "a":
        if cnt < li[1] + li[2]:
            cnt += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        b += 1
        if cnt < li[1] + li[2]:
            if b <= li[2]:
                cnt += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        #cnt -= 1
        print("No")

### FIXED CODE ###

li = list(map(int,input().split()))
s=list(input())
cnt = 0
b = 0
for i in s:
    if i == "a":
        if cnt < li[1] + li[2]:
            cnt += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        b += 1
        if cnt < li[1] + li[2]:
            if b <= li[2]:
                cnt += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        #cnt -= 1
        print("No")
import numpy as np
n,m,k=map(int,input().split())
A=[0]
A.append(list(map(int, input().split())))
B=[0]
B.append(list(map(int, input().split())))
ans=0
a=np.cumsum(np.array(A))
b=np.cumsum(np.array(B))
for i in range(n+1):
    if k<a[i]:
        break
    j=m
    while b[j]>k-a[i]:
        j-=1
        ans=max(ans,i+j)
print(ans)

### FIXED CODE ###

a=int(input())
print(a+a*a+a*a*a)
n = int(input())
ab = [tuple(map(int,input().split())) for i in range(n-1)]

es = [[] for i in range(n)]
for a,b in ab:
    a,b = a-1,b-1
    es[a].append(b)
    es[b].append(a)


colors = [0]
maxc = 0
i = 0
stack = [0]
visited = [0]*n
while stack:
    v = stack.pop(0)
    visited[v] = 1
    first = 0
    for to in es[v]:
        if visited[to]: continue
        stack.append(to)
        if first == 0:
            first = colors[v]
            i = 1

        if first == i:
            i +=1
        colors.append(i)
        mzxc = max(maxc, i)

        i += 1


print(maxc)

colors.pop(0)
for _ in range(len(colors)):
    print(colors[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

n = int(input())
ab = [tuple(map(int,input().split())) for i in range(n-1)]

es = [[] for i in range(n)]
for i, (a,b) in enumerate(ab):
    a,b = a-1,b-1
    es[a].append((b, i))
    es[b].append((a, i))

visited = [0]*n
ans_color = [0]*(n-1)

# DFS
def dfs(v, fromColor):
    color = 1
    visited[v] = 1
    for to, i in es[v]:
        if visited[to]: continue

        if color == fromColor:
            color += 1
        ans_color[i] = color
        dfs(to, color)
        color += 1

root = 0 # 頂点1が存在することが問題文中で保証されてるからここを根ノードとしよう
dfs(root, 0)

print(max(ans_color))
print(*ans_color, sep='\n')
MOD = 10**9+7

def mod_pow(x, n):
  if x==0: return 1
  res = 1
  while n > 0:
    if n&1:
      res = (res*x)%MOD
    x = (x*x)%MOD
    n >>= 1
  return res

fact, invfact = [0]*(10**5+1), [0]*(10**5+1)
fact[0], invfact[0] = 1, 1
for i in range(1, 10**5+1):
  fact[i] = (fact[i-1]*i)%MOD
  invfact[i] = mod_pow(fact[i], MOD-2)%MOD

def comb(n, r):
  if n<r or n==0 or r==0: return 0
  return (((fact[n]*invfact[r])%MOD)*invfact[n-r])%MOD

from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i, ele in enumerate(a):
  if d[ele] == 0:
    d[ele]= i+1
  else:
    l = d[ele]
    r = i+1

print(n)
for k in range(2, n+2):
  print((comb(n+1, k)-comb(l-1+n-r+1, k-1))%MOD)

### FIXED CODE ###

MOD = 10**9+7

def mod_pow(x, n):
  if x==0: return 1
  res = 1
  while n > 0:
    if n&1:
      res = (res*x)%MOD
    x = (x*x)%MOD
    n >>= 1
  return res

fact, invfact = [0]*(10**5+2), [0]*(10**5+2)
fact[0], invfact[0] = 1, 1
for i in range(1, 10**5+2):
  fact[i] = (fact[i-1]*i)%MOD
  invfact[i] = mod_pow(fact[i], MOD-2)%MOD

def comb(n, r):
  if n<r or n==0 or r==0: return 0
  return (((fact[n]*invfact[r])%MOD)*invfact[n-r])%MOD

from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i, ele in enumerate(a):
  if d[ele] == 0:
    d[ele]= i+1
  else:
    l = d[ele]
    r = i+1

print(n)
for k in range(2, n+2):
  print((comb(n+1, k)-comb(l-1+n-r+1, k-1))%MOD)
N=int(input())
if int((N//1.08)*1.08)==N:
  print(int(N//1.08))
elif int((N//1.08+1)*1.08)==N:
  print(int(N//1.08+1))
else:
  print(':(')

### FIXED CODE ###

m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m1==m2:
  print('0')
else:
  print('1')
h, w = list(map(int, input().split()))
s = [list(input()) for i in range(h)]
dir = [[-1, 0], [1, 0], [0, -1], [0, 1]]
for y in range(h):
    for x in range(w):
        if s[y][x] == "#":
            for dx, dy in dir:
                cx = x + dx
                cy = y + dy
                if x >= 0 and x < w and y >= 0 and y < h and s[cy][cx] == "#":
                    break
            else:
                break
    else:
        continue
    print("No")
    break
else:
    print("Yes")

### FIXED CODE ###

h, w = list(map(int, input().split()))
s = [list(input()) for i in range(h)]
dir = [[-1, 0], [1, 0], [0, -1], [0, 1]]
for y in range(h):
    for x in range(w):
        can_put = True
        if s[y][x] == "#":
            for dx, dy in dir:
                cx = x + dx
                cy = y + dy
                if cx >= 0 and cx < w and cy >= 0 and cy < h:
                    if s[cy][cx] == "#":
                        can_put = True
                        break
            else:
                can_put = False
        if can_put == False:
            break
    else:
        continue
    break
if can_put == True:
    print("Yes")
else:
    print("No")
N = int(input())

X = [[] for i in range(N)]
P = [-1] * N

for i in range(N-1):
    x, y = map(int, input().split())
    X[x-1].append(y-1)
    X[y-1].append(x-1)


def set_parent(i):
    # print(i)
    for a in X[i]:
        if a != P[i]:
            P[a] = i
            # print(a)
            X[a].remove(i)
            set_parent(a)
    
set_parent(0)

B = [-1] * N
def set_block(i):
    for a in X[i]:
        B[a] = max(i, B[i])
        set_block(a)

B_id = [-1] * N
B_id_cnt = [0] * N
def BID(i):
    for a in X[i]:
        if a > B[i]:
            B_id[a] = a
        else:
            B_id[a] = B_id[i]
            
        # print(a, B_id)
        B_id_cnt[B_id[a]] += 1
        BID(a)
        
Ans = [1] * N
def flow(i):
    for a in X[i]:
        if B_id[a] == B_id[i]:
            Ans[a] = Ans[i]
        else:
            Ans[a] = Ans[i] + B_id_cnt[a]
        flow(a)

set_block(0)


# print("X=", X) # 子リスト
# print("P=", P) # 親
# print("B=", B) # Block
# print(B_id) # BlockのID
# print(B_id_cnt) # BlockのID
# print(Ans)
print(" ".join(map(str, Ans[1:])))


### FIXED CODE ###

s = input()
n = len(s)
a = 0
b = 0
for i in range(n):
    if s[i] == "W":
        a += 1
        b += i
        
print(b - a*(a-1)//2)
n,q =map(int,input().split())
s = input()
resu = [0]
ans = 0
for i in range(n):
	if s[i] == "A" and s[i+1] == "C":
		ans +=1
		resu.append(ans)
	else:
		resu.append(ans)
for i in range(q):
	l,r = map(int,input().split())
	print(resu[r-1],resu[l-1])

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
c=[0]
t=0

for i in range(0,n-1):
    if s[i]=="A" and s[i+1]=="C":
        t+=1
        c.append(t)
    else:
        c.append(t)

for i in range(q):
    l,r=map(int,input().split())
    print(c[r-1]-c[l-1])
a = int(input())
s = int(input())
if a >= 3200:
    print('s')
if a < 3200:
    print('red')

### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200:
    print(s)
if a < 3200:
    print('red')
N = int(input())
a = list(map(int, input().split()))
odd = 0
even = 0
num = []
res = []

for i in range(N):
    if i%2 == 0 and a[i] > 0:even += a[i]
    if i%2 == 1 and a[i] > 0:odd += a[i]
if even >= odd:
    for i in range(N):
        if i % 2 == 0 and a[i] > 0: num.append(i)
else:
    for i in range(N):
        if i % 2 == 1 and a[i] > 0: num.append(i)

count = len(num)

ed = N-1
while ed > num[-1]:
    res.append(ed)
    ed -= 1
for i in range(count)[::-1]:
    if i > 0:
        if num[i] - num[i-1] > 2:
            for j in range(1,(num[i]-num[i-1])/2):
                res.append(num[i]-2*j)
for i in range(num[0]):
    res.append(0)
for i in range(count-1):
    res.append(1)

print(max(even,odd))
print(len(res))
print('\n'.join(map(str, res)))





### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mx = max(a)
a[a.index(mx)] = abs(mx)
evn = sum(max(0, i) for i in a[::2])
odd = sum(max(0, i) for i in a[1::2])
if mx < 0:
    print(mx)
else:
    print(max(evn, odd))
oe = int(evn < odd)
res = []
beg = 0
while beg%2!=oe or a[beg]<0:
    res.append(1)
    beg += 1
end = n-1
while end%2!=oe or a[end]<0:
    res.append(end-beg+1)
    end -= 1
while beg < end:
    if a[end-2] < 0:
        res.append(end-beg-1)
    else:
        res.append(end-beg)
    end -= 2
print(len(res))
for i in res:
    print(i)
N =int(input())
amari = N % 10
if |m == 2||m ~~ 4||m == 5||m == 7||m == 9| in str(amari) :
    print ('hon')


### FIXED CODE ###

N = int(input())
n = N%10
if n == 3:
    print('bon')
elif n == 0 or n == 1 or n == 6 or n == 8:
    print('pon')
else:
    print('hon')
n = int(input())
h_list = [int(_) for _ in input().split()]
ans = 0
while sum(h_list) != 0:
    # 0で区切られた、1以上の数のかたまりを数える
    # 要素が全て1以上ならansに+1して次のループ
    if h_list.count(0) == 0:
        ans += 1
    else:
        for i in range(1, n):
            # 1以上から0に下がった時にかたまりをカウント
            if h_list[i] == 0 and h_list[i - 1] != 0:
                ans += 1
            elif i == n - 1 and h_list[i] != 0:
                ans += 1
    # 1以上の箇所を1段ずつ落とす
    for i in range(n):
        if h_list[i] != 0:
            h_list[i] -= 1

print(ans)

### FIXED CODE ###

ab,bc,ca = map(int, input().split())

print(bc * ab // 2)
X,Y = map(int(input().split())
print(int(X + Y /2))

### FIXED CODE ###

X,Y = map(int,input().split())
print(int(X + Y /2))
import math,sys,os,collections,functools
if(os.path.exists('input.txt')):
	sys.stdin=open('input.txt','r')
	sys.stdout=open('output.txt','w')
for testcase in range(int(input())):
	D,T,S=map(int,input().split())
	t=D/S
	if t<=T:
		print('Yes')
	else:
		print('No')	
		                                         

### FIXED CODE ###

D,T,S=map(int,input().split())
t=D/S
if t<=T:
  print('Yes')
else:
  print('No')