Harryxun/stf_run huggingface dataset:
S = input()

count0, count1 = 0, 0
val = []
for i in range(len(S)):
    if S[i] == '<':
        count0 += 1
        if count1 != 0:
            val.append(count1)
        if i == len(S)-1:
            val.append(count0)
        count1 = 0
    else:
        count1 += 1
        if count0 != 0:
            val.append(count0)
        if i == len(S)-1:
            val.append(count1)
        count0 = 0
#print(val)
ans = 0
for i in range(0, len(val)-1, 2):
    a = max(val[i], val[i+1])
    b = min(val[i], val[i+1])
    ans += a*(a+1)/2 + (b-1)*b/2
if len(val) % 2 == 1:
    if S[-1] == '>':
        a = max(val[-2], val[-1])
        ans += a*(a+1)/2
    else:
        b = min(val[-2], val[-1])
        ans += (b+1)*b/2    
print(int(ans))


### FIXED CODE ###

s = input()
num = len(s)
a = [0]*(num+1)

for i in range(num):
    if s[i] is '<':
        a[i+1] = max(a[i+1], a[i]+1)

for i in range(1, num+1):
    if s[-i] is '>':
        a[-(i+1)] = max(a[-(i+1)], a[-i]+1)
print(sum(a))
total, k = map(int, input().split())

d = input().split()

def find_lowest_denomination(total, d):
    for i in range(total, 10001):
        if not set(str(i)) & set(d):
            print(i)
            return
    raise ValueError('Should never reach this code block')



find_lowest_denomination(total, d)


### FIXED CODE ###

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

d = list(map(int, input().split()))

def total_to_digits(total):
    return map(int, list(str(total)))

def find_lowest_denomination(total, d):
    res = None
    for i in range(total, 99999):
        digits = list(total_to_digits(i))
        if not (set(digits) & set(d)):
            print(i)
            return


find_lowest_denomination(total, d)
S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGIOUS")

### FIXED CODE ###

def check(M_1, M_2):
    M_1 = int(M_1)
    M_2 = int(M_2)
    MM = M_1 * 10 + M_2
    if 1 <= MM <= 12:
        return True
    else:
        return False


S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGUOUS")
import math
A = int(input())
p = int(math.sqrt(A))
all_lis = []
ans_lis = []

for i in range(1,p,1):
    if A % i == 0:
        kumi = [i,A/i]
        all_lis.append(kumi)

for j in all_lis:
    ans_lis.append(j[0]+j[1])
    
print(int(min(ans_lis)-2))

### FIXED CODE ###

import math
A = int(input())
p = int(math.sqrt(A)) + 1
all_lis = []
ans_lis = []

for i in range(1,p,1):
    if A % i == 0:
        kumi = [i,int(A/i)]
        all_lis.append(kumi)

for j in all_lis:
    ans_lis.append(j[0]+j[1])
    
print(int(min(ans_lis)-2))
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 0
else:
    if (N-B) < A:
        ans = (N-B+1) + ((distAB-1)/2)-1
    else:
        ans = A+1 + ((distAB-1)/2)-1

print(int(ans))

### FIXED CODE ###

from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))
n = int(input())
A = list(map(int,input().split()))
A.sort()
# print(A)
multiple = [0]*(A[-1]+1)
for i in range(n):
    now = A[i]
    while(now <= A[-1]):
        multiple[now] += 1
        now += now
ans = 0
for i in range(N):
    if(multiple[A[i]] == 1):
        ans += 1
# print(multiple)
print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
A.sort()
# print(A)
multiple = [0]*(A[-1]+1)
for i in range(n):
    now = A[i]
    while(now <= A[-1]):
        multiple[now] += 1
        now += A[i]
ans = 0
for i in range(n):
    if(multiple[A[i]] == 1):
        ans += 1
# print(multiple)
print(ans)
n=int(input()):
ans=1
for i in range(1,32):
  for j in range(2,10):
    if i**j <=n and i**j >ans:
      ans=i**j
print(ans)

### FIXED CODE ###

n=int(input())
ans=1
for i in range(1,32):
  for j in range(2,10):
    if i**j <=n and i**j >ans:
      ans=i**j
print(ans)
n = int(input())

a = 0
w = 0
t = 0
r = 0

for i in range(n):
    b = input()
    if b == "AC":
        a += 1
    if b == "WA":
        w += 1
    if b == "TLE":
        t += 1
    if b == "RE":
        r += 1
print("AC x", a)
print("WA x", w)
print("TLE x", t)
print("RE x", r)




### FIXED CODE ###

a = input()
a= int(a)

if 1<= a < 1000:
    print(1000 - a)
if 1000 < a < 2000:
    print(2000 - a)
if 2000 < a < 3000:
    print(3000 - a)
if 3000 < a < 4000:
    print(4000 - a)
if 4000< a < 5000:
    print(5000 - a)
if 5000< a < 6000:
    print(6000 - a)
if 6000< a < 7000:
    print(7000 - a)
if 7000 < a < 8000:
    print(8000 - a)
if 8000 < a < 9000:
    print(9000 - a)
if 9000 < a <10000:
    print(10000 - a)
if a == 1000:
    print(0)
if a == 2000:
    print(0)
if a == 3000:
    print(0)
if a == 4000:
    print(0)
if a == 5000:
    print(0)
if a == 6000:
    print(0)
if a == 7000:
    print(0)
if a == 8000:
    print(0)
if a == 9000:
    print(0)
if a == 10000:
    print(0)

# (物の値段/入力)a + （おつり）N = 1000?
#Nは整数だから　print(おつり)
#　N　＝　1000? - a

#input 1900  print 100 (2000)
# input 1525 print 475 (2000)
# input 2500 print 500 (3000)
# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print('Yes' if A + B >= C else 'No')

### FIXED CODE ###

# -*- coding: <encoding name> -*-

a, b, c = map(int, input().split())
print('Yes' if a + b >= c else 'No')
import sys
n = int(input())
alis = list(map(int, input().split()))
blis = list(map(int, input().split()))
alis.sort()
blis.sort()
for i in range(n):
    if alis[i] > blis[i]:
        print("No")
        sys.exit()


for i in range(n-1):
    if alis[i+1] > blis[i]:
        pass
    else:
        print("Yes")
        sys.exit()
print("No")


### FIXED CODE ###

n = int(input())
print((n-1)//2)
def main():
  import sys
  input = sys.stdin.readline
  h, w = map(int, input().split())
  A = []
  AB = []
  for i in range(h):
    row = list(map(int, input().split()))
    A.append(row)
  for i in range(h):
    row = [abs(A[i][j] - int(b)) for j, b in enumerate(input().split())]
    AB.append(row)
 
  dp = [[{} for j in range(w+1)] for i in range(h+1)]
  dp[0][0][abs(A[0][0] - B[0][0])] = 1
  for i in range(h):
    for j in range(w):
      dif1 = 0
      dif2 = 0
      if j < w - 1:
        dif1 = AB[i][j+1]
      if i < h - 1:
        dif2 = AB[i+1][j]
      for item in dp[i][j]:
        if j < w - 1:
          dp[i][j+1][item+dif1] = 1
          dp[i][j+1][abs(item-dif1)] = 1
        if i < h - 1:
          dp[i+1][j][item+dif2] = 1
          dp[i+1][j][abs(item-dif2)] = 1
  print(min(dp[h-1][w-1].keys()))
if __name__ == '__main__':
  main()


### FIXED CODE ###

import sys
def main():
  input = sys.stdin.readline
  h, w = map(int, input().split())
  A = []
  AB = []
  A_append = A.append
  AB_append = AB.append
  for i in range(h):
    row = list(map(int, input().split()))
    A_append(row)
  for i in range(h):
    row = [abs(A[i][j] - int(b)) for j, b in enumerate(input().split())]
    AB_append(row)
 
  dp_cur = [set([]) for _ in range(w)]
  dp_cur[0].add(AB[0][0])
  for i in range(h):
    dp_next = [set([]) for _ in range(w)]
    for j in range(w):
      if j < w - 1:
        add1 = dp_cur[j+1].add
        dif1 = AB[i][j+1]
      if i < h - 1:
        add2 = dp_next[j].add
        dif2 = AB[i+1][j]
      for item in dp_cur[j]:
        if j < w - 1:
          add1(item+dif1)
          add1(abs(item-dif1))
        if i < h - 1:
          add2(item+dif2)
          add2(abs(item-dif2))
    if i == h - 1:
      break
    dp_cur = dp_next
  print(min(dp_cur[w-1]))
if __name__ == '__main__':
  main()
n=int(input())
a=list(map(int,input().split()))

list=[0]*(10**5+1)

for i in range(n):
    list[a[i]]+=1

one=0
two=0

for i in range(10**5+1):
    if one==0 and list[i]>1:
        one=i
    elif list[i]>1:
        two=one
        one=i

print(one*two)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))

dict={}

for i in range(n):
    if not a[i] in dict:
        dict[a[i]]=0
    dict[a[i]]+=1


a=sorted(dict.items(), key=lambda x:x[0])
one=0
two=0
for i in range(len(a)):
    if a[i][1]>3:
            one=a[i][0]
            two=one

    elif a[i][1]>1:
        two=one
        one=a[i][0]
    
print(one*two)
N,K= map(int,input().split())
mod = 10**9+7
def comb(n, k):
    m = 1
    if n < 2 * k:
        k = n - k
    for i in range(1, k + 1):
        m = m * (n - i + 1) / i    
    return int(m)

R = N-K

for i in range(1,K+1):
    # blue
#    if i == 1:
#        b_div = 2
#    else:
    b_div = comb(K-1,i-1)%mod
    # RED
    r_div = comb(R+1,i)%mod
    if i == K+1:
        r_div += comb(R+1,i+1)%mod
    
#    print(b_div,r_div)
    print((b_div*r_div)%mod)

### FIXED CODE ###




N,K= map(int,input().split())
mod = 10**9+7
def comb(n,k):
  """power_funcを用いて(nCk) mod p を求める"""
  p = 10**9+7
  from math import factorial
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=factorial(n) %p
  b=factorial(k) %p
  c=factorial(n-k) %p
  return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p
def power_func(a,b,p):
  """a^b mod p を求める"""
  if b==0: return 1
  if b%2==0:
    d=power_func(a,b//2,p)
    return d*d %p
  if b%2==1:
    return (a*power_func(a,b-1,p ))%p
R = N-K


for i in range(1,K+1):
    # blue
#    if i == 1:
#        b_div = 2
#    else:
#    print(R,i)
    b_div = comb(K-1,i-1)%mod
    # RED
#    if (R+1)<i:
#        print('0')
#    else:
    r_div = comb(R+1,i)%mod
#        if i == K+1:
#            r_div += comb(R+1,i+1)%mod
        
#        print(b_div,r_div)
    print(int(b_div*r_div)%mod)
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
num=[0,2,5,5,4,5,6,3,7,6]
inf=float("inf")
dp=[-1*inf]*(n+1)
dp[0]=0
for i in range(1,n+1):
    for j in range(m):
        dp[i]=max(dp[i],dp[i-num[a[j]]]+1)
ans=[]
for i in range(dp[n]):
    for j in range(m):
        if dp[n-num[a[j]]]==dp[n]-1:
            ans.append(a[j])
            n-=num[a[j]]
            break
an=""
for i in range(len(ans)):
    an+=str(ans[i])
print(an)


### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
nums=[0,2,5,5,4,5,6,3,7,6]
dp=[-1]*(n+1)
dp[0]=0
for i in range(1,n+1):
    for x in a:
        if i-nums[x]>=0:
            dp[i]=max(dp[i-nums[x]]+1,dp[i])
k=dp[n]
ans=[]
for i in range(k):
    for x in a:
        if n-nums[x]<0:
            continue
        if dp[n-nums[x]]==dp[n]-1:
            n-=nums[x]
            ans.append(x)
            break
print("".join(list(map(str,ans))))
import sys
def input():
    return sys.stdin.readline()[:-1]
h,w=map(int,input().split())
a=[list(map(int,input().split())) for i in range(h)]
b=[list(map(int,input().split())) for i in range(h)]
d=[[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        d[i][j] = abs(a[i][j]-b[i][j])
dp=[[[False for i in range(80*80)] for j in range(w)] for k in range(h)]
dp[0][0][d[0][0]] = True
for i in range(h):
    for j in range(w):
        for dis in range(80*(h+w)):
            if dp[i][j][dis]:
                if i+1<h:
                    dp[i+1][j][abs(dis-d[i+1][j])]=True
                    if dis+d[i+1][j]<80*80:
                        dp[i+1][j][dis+d[i+1][j]]=True
                if j+1<w:
                    dp[i][j+1][abs(dis-d[i][j+1])]=True
                    if dis+d[i][j+1]<80*80:
                        dp[i][j+1][dis+d[i][j+1]]=True
for dis in range(80*(h+w)):
    if dp[-1][-1][dis]:
        print(dis)
        break


### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
h,w=map(int,input().split())
a=[list(map(int,input().split())) for i in range(h)]
b=[list(map(int,input().split())) for i in range(h)]
d=[[0 for i in range(w)] for j in range(h)]
maxd=1
for i in range(h):
    for j in range(w):
        d[i][j] = abs(a[i][j]-b[i][j])
        maxd=max(maxd,d[i][j])
dp=[[0 for j in range(w)] for k in range(h)]
c=20000
dp[0][0] |= 1 << c+d[0][0]
for i in range(h):
    for j in range(w):
        if i+1<h:
            dp[i+1][j] |= dp[i][j] << d[i+1][j]
            dp[i+1][j] |= dp[i][j] >> d[i+1][j]
        if j+1<w:
            dp[i][j+1] |= dp[i][j] << d[i][j+1]
            dp[i][j+1] |= dp[i][j] >> d[i][j+1]
m=1000000
cnt = 0
for x in bin(dp[h-1][w-1])[2:][::-1]:
    if x=='1':
        m=min(m,abs(cnt-c))
    cnt+=1
print(m)
import math

a, b, c, d = map(int, input().split())
g = math.gcd(c, d)


t = b//c + b//d - b//(c*d//g)
l = (a - 1)//c + (a - 1)//d - (a - 1)//(c*d//g)
ans = b - (a - 1) - t + l

print(ans)

### FIXED CODE ###

import fractions

a, b, c, d = map(int, input().split())
g = fractions.gcd(c, d)


t = b//c + b//d - b//(c*d//g)
l = (a - 1)//c + (a - 1)//d - (a - 1)//(c*d//g)
ans = b - (a - 1) - t + l

print(ans)
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
graph=[[0 for _ in range(m)] for _ in range(m)]
for i in range(m):
  graph[ab[i][0]-1][ab[i][1]-1]=1
  graph[ab[i][1]-1][ab[i][0]-1]=1
visited=[0 for _ in range(m)]

def dfs(v):
  visited[v]=1
  for v2 in range(n):
    if graph[v][v2]==0:
      continue
    if visited[v2]==1:
      continue
    dfs(v2)

ans=0

for i in range(m):
  graph[ab[i][0]-1][ab[i][1]-1]=0
  graph[ab[i][1]-1][ab[i][0]-1]=0
  for j in range(n):
    visited[j]=0
  dfs(0)
  bridge=0
  for j in range(n):
    if visited[j]==0:
      bridge=1
  if bridge==1:
    ans+=1
  graph[ab[i][0]-1][ab[i][1]-1]=1
  graph[ab[i][1]-1][ab[i][0]-1]=1
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
graph=[[0 for _ in range(n)] for _ in range(n)]
for i in range(m):
  graph[ab[i][0]-1][ab[i][1]-1]=1
  graph[ab[i][1]-1][ab[i][0]-1]=1
visited=[0 for _ in range(n)]

def dfs(v):
  visited[v]=1
  for v2 in range(n):
    if graph[v][v2]==0:
      continue
    if visited[v2]==1:
      continue
    dfs(v2)

ans=0

for i in range(m):
  graph[ab[i][0]-1][ab[i][1]-1]=0
  graph[ab[i][1]-1][ab[i][0]-1]=0
  for j in range(n):
    visited[j]=0
  dfs(0)
  bridge=0
  for j in range(n):
    if visited[j]==0:
      bridge=1
  if bridge==1:
    ans+=1
  graph[ab[i][0]-1][ab[i][1]-1]=1
  graph[ab[i][1]-1][ab[i][0]-1]=1
print(ans)
N, M = map(int, input().split())

G = [[] for _ in range(N + 1)]
for _ in range(M):
    A, B = map(int, input().split())
    G[A].append(B)
    G[B].append(A)

check = [0] * (N + 1)
check[1] = 1
ans1 = [1]
stack = [1]
while stack:
    tmp = stack.pop()
    for next_ in G[tmp]:
        if check[next_] == 1:
            continue
        else:
           stack.append(next_)
           check[next_] = 1
           ans1.append(next_)
           break

# print (ans1)

ans2 = []
stack = [1]
while stack:
    tmp = stack.pop()
    for next_ in G[tmp]:
        if check[next_] == 1:
            continue
        else:
           stack.append(next_)
           check[next_] = 1
           ans2.append(next_)
           break

# print (ans2)

print (len(ans1) + len(ans2))
print (*ans2[::-1], *ans1)

### FIXED CODE ###

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

G = [[] for _ in range(N + 1)]
for _ in range(M):
    A, B = map(int, input().split())
    G[A].append(B)
    G[B].append(A)

check = [0] * (N + 1)
check[1] = 1
ans1 = [1]
stack = [1]
while stack:
    tmp = stack.pop()
    for next_ in G[tmp]:
        if check[next_] == 1:
            continue
        else:
           stack.append(next_)
           check[next_] = 1
           ans1.append(next_)
           break

# print (ans1)

ans2 = []
stack = [1]
while stack:
    tmp = stack.pop()
    for next_ in G[tmp]:
        if check[next_] == 1:
            continue
        else:
           stack.append(next_)
           check[next_] = 1
           ans2.append(next_)
           break

# print (ans2)

print (len(ans1) + len(ans2))
print (*ans2[::-1], end ='')
if len(ans1):
    print (' ', end = '')
else:
    print ()
print (*ans1)
n, q = [int(i) for i in input().split()]
s = input()
td = reversed([input().split() for _ in range(q)])

l = 0
r = n - 1
for t, d in td:
    if d == "L":
        if s[l] == t:
            l = min(l + 1, n)

        if r + 1 < n and s[r + 1] == t:
            r = min(r + 1, n)
    else:
        if 0 < l and s[l - 1] == t:
            l -= 1

        if s[r] == t:
            r -= 1


'''
    if s[l] == t:
        if d == "L":
            l += 1
        else:
            l -= 1
        l = max(0, min(n - 1, l))
    if s[r] == t:
        if d == "L":
            r += 1
        else:
            r -= 1
        r = max(0, min(n - 1, r))
'''
print(max(0, r-l+1))


### FIXED CODE ###

n, q = [int(i) for i in input().split()]
s = input()
td = reversed([input().split() for _ in range(q)])

l = 0
r = n - 1
for t, d in td:
    if d == "L":
        if 0 <= l < n and s[l] == t:
            l = l + 1

        if 0 <= r + 1 < n and s[r + 1] == t:
            r = min(r + 1, n - 1)
    else:
        if 0 <= l-1 < n and s[l - 1] == t:
            l = max(0, l - 1)

        if 0 <= r < n and s[r] == t:
            r = r - 1


'''
    if s[l] == t:
        if d == "L":
            l += 1
        else:
            l -= 1
        l = max(0, min(n - 1, l))
    if s[r] == t:
        if d == "L":
            r += 1
        else:
            r -= 1
        r = max(0, min(n - 1, r))
'''
print(max(0, r-l+1))
a,b = map(int,input().split())
if(a*b<=0):
    print(Zero)
elif(a<0 and (b-a)%2==0):
    print(Positive)
else:
    print(Negative)

### FIXED CODE ###

a,b = map(int,input().split())
if a*b<=0:
    print("Zero")
elif a<0 and (b-a)%2==0:
    print("Negative")
else:
    print("Positive")
N = int(input())

if N % sum(str(N)) == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())

if N % sum(map(int,str(N))) == 0:
    print("Yes")
else:
    print("No")
import math

input = input()
l = input.split()

print(math.gcd(int(l[0]), int(l[1])))

### FIXED CODE ###

N = input()
L = N.split()
a = int(L[0])
b = int(L[1])

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

r = a % b
    
while r != 0:
    a = b
    b = r
    r = a % b

# この時のbが最大公約数

print(int(int(L[0])*int(L[1])/b))
N = input()
T,A = map(int,input().split(" ")
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
print(argmin(H_)+1)
          


          

### FIXED CODE ###

N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
     
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H_[i]
     
print(arg)
if __name__ == "__main__":
    S = input()
    for i in range(0, len(S), 2):
        if S[i] == "h" and S[i+1] == "i":
            ret = "Yes"            
        else:
            ret = "No"
    print(ret)


### FIXED CODE ###


if __name__ == "__main__":
    S = input()
    if len(S) % 2 == 0:
        for i in range(0, len(S), 2):
            if S[i] == "h" and S[i+1] == "i":
                ret = "Yes"
            else:
                ret = "No"
                break
    else:
        ret = "No"
    print(ret)
n, a = map(int, input().split())
Max = -1000000
Min = a
for i in range(n):
    x = input()
    if (Max < (x-Min)):
        Max = x-Min
    if (x < Min):
        Min = x
print(Max)

### FIXED CODE ###

n = int(input())
a = int(input())
Max = -10 ** 9
Min = a
for i in range(n-1):
    x = int(input())
    if (Max < x - Min):
        Max = x - Min
    if (x < Min):
        Min = x
print(Max)
N = int(input())
A = list(map(int, input().split()))

T = 1 
for i in A:
    T = T * i
    if T > 10^18:
        print(-1)
    else:
        print(T)


### FIXED CODE ###

x, y = map(int, input().split())
print(x*y)
N = int(input())
A = input()
b = A.split(" ")
c = []
for i in range(0,N):
    c.append(abs(int(b[i])))
c.sort

print(c[-1]-c[0])

### FIXED CODE ###

N = int(input())
if N%2 == 0:
    print(N)
else:
    print(N*2)
n = int(input())

a = []

for i in range(n):
  	# input as str
	s, p = input().split()
    # p -> integer
	p = int(score)
    # create list
	a.append((s, p, i+1))

# sort
a.sort(key=lambda x:x[1], reverse=True)

# sort
a.sort(key=lambda x:x[0])

# output
for i in range(n):
	print(a[i][2])

### FIXED CODE ###

n = int(input())

a = []

for i in range(n):
  	# input as str
	s, p = input().split()
    # p -> integer
	p = int(p)
    # create list
	a.append((s, p, i+1))

# sort
a.sort(key=lambda x:x[1], reverse=True)

# sort
a.sort(key=lambda x:x[0])

# output
for i in range(n):
	print(a[i][2])
array1 = [int(input()) for i in range(6)]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
    if (i < 4 and array2[4 - i] - array2[0] > k):
        print(':(')
        break
    if (i < 3 and array2[4 - i] - array2[1] > k):
        print(':(')
        break
    if (i < 2 and array2[4 - i] - array2[2] > k):
        print(':(')
        break
    if (i < 1 and array2[4 - i] - array2[3] > k):
        print(':(')
        break
    if (i == 4):
        print('Yay!')

### FIXED CODE ###

array1 = [int(input()) for i in range(6)]
array2 = array1[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')
N, K = map(int, input().split())
A = [int(input()) for i in range(N)]


ans = []

i = 0
while(i<=N-2):
  a = A[i]
  T = 1
  while (i<=N-3):
    if ( abs(a-A[i+1]) <= K ):
      T += 1
      a = A[i]
    i += 1
  ans.append(T)
  i += 1
  
print(max(ans))


### FIXED CODE ###

K = int(input())
A = ""
for i in range(K):
  A += "ACL"
  
print(A)
import numpy as np
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n = int(input())

a = list(map(int, input().split(' ')))

devisor = gcd_list(a)

a = np.array(a) / devisor
child = a.prod()
child *= devisor

mother = 0

for m in range(n):
    mother += np.delete(a, m).prod()

x = child / mother

print(x)



### FIXED CODE ###

import numpy as np
from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())

a = list(map(int, input().split(' ')))

devisor = gcd_list(a)

a = np.array(a) / devisor
child = a.prod()
child *= devisor

mother = 0

for m in range(n):
    mother += np.delete(a, m).prod()

x = child / mother

print(x)
def solve(n,p):
    
    memo = {}
    items = [(0,p)]
    result = 0
    while items:
        step, p = items.pop(0)
        if check(n,p):
            result = step
            break
        else:
            for i in range(n-1):
                candidate = tuple( p[:i] +[ p[i+1] ,p[i]] + p[i+2:] )
                if not candidate in memo:
                    items.append([step +1 , list(candidate)])
                    memo[candidate] = step + 1
                
    return result

n = int(input())
p = list(map(int, input().split(" ")))

print(solve(n, p))


### FIXED CODE ###

def solve(n, p):
    result = 0
    for i in range(n-1):
        if (i+1) == p[i]:
            p[i], p[i+1] = p[i+1],p[i]
            result += 1
    i = n - 1
    if (i+1) == p[i]:
        p[i-1], p[i] = p[i],p[i-1]
        result += 1
    return result

if __name__ == '__main__':
    n = int(input())
    p = list(map(int, input().split(" ")))
    print(solve(n, p))