Harryxun/stf_run huggingface dataset:
import sys
N = int(input())
c = input()
ans = 0
exchange = 0
for i in range(N):
    if c[i] == "W":
        exchange = i
        break
else:
    print(0)
    sys.exit()

for i in range(N//2):
    # print(i+1,"回目")
    # print("exchange=",exchange)
    # print("c=",c)
    if c[-(i+1)] =="R":
        # c = list(c)
        # c[exchange] = "R"
        # c[-(i+1)] = "W"
        # c = "".join(c)
        c = c[:exchange]+"R"+c[exchange+1:]
        print("newc=",c)
        c = c[:-(i+1)]+"W"+c[N-i:]
        # print("newc=",c)
        ans += 1
        for k in range(exchange+1,N):
            if c[k] == "W":
                exchange = k
                break
        else:
            break
    
print(ans)

### FIXED CODE ###

import sys
N = int(input())
c = input()
ans = 0
exchange = 0
for i in range(N):
    if c[i] == "W":
        exchange = i
        break
else:
    print(0)
    sys.exit()

for i in range(N):
    if N-i > exchange:
        if c[-(i+1)] =="R":
            # c = list(c)
            # c[exchange] = "R"
            # c[-(i+1)] = "W"
            # c = "".join(c)
            # c = c[:exchange]+"R"+c[exchange+1:]
            # print("newc=",c)
            # c = c[:-(i+1)]+"W"+c[N-i:]
            # print("newc=",c)
            ans += 1
            for k in range(exchange+1,N-(i+1)):
                if c[k] == "W":
                    exchange = k
                    break
            else:
                break
    else:
        break
print(ans)
n  = int(input())
a = map(int(input().split()))
b = map(int(input().split()))
c = map(int(input().split()))

ans = 0

for i in range(n):
    ans += b[a[i]]
    if a[i]+1 == a[i+1]:
        ans += c[i]
        
print(ans)

### FIXED CODE ###

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

ans = 0

for i in range(n):
      #print(i)
      ans += b[a[i]-1]
      #print("ans",ans)
  #print("aaa",a[i])
      if i != 0:
        hantei = a[i-1] + 1
        if a[i] == hantei:
          ans += c[a[i]-2]
    
print(ans)
from collections import Counter
def main(n:int,lst:list)->int:
    lst1 = [::2]
    lst2 = [1::2]
    c1 = Counter(lst1).most_common(2)
    c2 = Counter(lst2).most_common(2)
    if c1[0][0] == c2[0][0]:
        if len(c1)!=1 and len(c2)!=1:
            return n - max(c1[0][1] + c2[1],c2[0][1] + c1[1])
        else:
            return n//2
    else:
        return n - c1[0][1] - c2[0][1]

n = int(input())
lst = input().split()
print(main(n,lst))


### FIXED CODE ###

from collections import Counter


def solve(V):
    n = len(V)
    ac = Counter(V[::2]).most_common(2)
    bc = Counter(V[1::2]).most_common(2)

    if ac[0][0] != bc[0][0]:
        return n - ac[0][1] - bc[0][1]
    else:
        if len(bc) == 1 or len(ac) == 1:
            return n // 2
        else:
            return n - max(ac[0][1] + bc[1][1], ac[1][1] + bc[0][1])


if __name__ == "__main__":
    n = int(input())
    l = input()
    print(solve(l.split(" ")))
import sys

args = sys.argv
l = []

for i in range(0,3):
    l.append(int(args[i+1]))
l.sort()
print(abs(l[0]-l[1]) + abs(l[1]-l[2]))

### FIXED CODE ###

a = list(int(i) for i in input().split())
a.sort()
print(abs(a[0]-a[1]) + abs(a[1]-a[2]))
s = input()
b = 0

if s[0] == s[1] or s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print('Bad')
else:
    print('Good')

### FIXED CODE ###

s = input()
b = 0

if s[0] == s[1] or s[1]==s[2] or s[2]==s[3]:
    print('Bad')
else:
    print('Good')
n,p=map(int,input().split())
s=input()
arr=[int(s[i]) for i in range(len(s))]
dic={}
match=[]
pows=[1]
for _ in range(n):
  pows.append((pows[-1]*10)%p)
tmp=0
for i in range(n-1,-1,-1):
  tmp+=arr[i]*pows[n-1-i]
  tmp%=p
  match.append(tmp)
  if tmp not in dic:
    dic[tmp]=1
  else:
    dic[tmp]+=1
match=match[::-1]
ans=0
rem=0
rev=pow(10,p-2,p)
for i in range(n-1,-1,-1):
  ans+=dic[rem]
  rem*=rev
  rem+=arr[i]
  rem%=p
  dic[match[i]]-=1
print(ans)

### FIXED CODE ###

import collections

n,p=map(int,input().split())
s=input()
arr=[int(s[i]) for i in range(len(s))]
if p==2 or p==5:
  ans=0
  for i in range(n):
    if arr[i]%p==0:
      ans+=i+1
  print(ans)
else:
  dic=collections.defaultdict(int)
  match=[]
  pows=[1]
  for _ in range(n):
    pows.append((pows[-1]*10)%p)
  tmp=0
  for i in range(n-1,-1,-1):
    tmp+=arr[i]*pows[n-1-i]
    tmp%=p
    match.append(tmp)
    dic[tmp]+=1
  match=match[::-1]
  ans=0
  rem=0
  rev=pow(10,p-2,p)
  for i in range(n-1,-1,-1):
    ans+=dic[rem]
    rem+=arr[i]*pows[n-1-i]
    rem%=p
    dic[match[i]]-=1
  print(ans)
def givel(): 
	n=int(input()) 
    l=[int(i) for i in input().split()] 
    curr = 0 
    i = 0 
    while i<len(l): 
    	temp = i+1 
	    ans = 0 
		while temp<len(l) and l[temp]<=l[temp-1]: 
        	temp+=1 
	        ans+=1 
			i=temp 
		curr = max(curr,ans) 
    return curr
givel()

### FIXED CODE ###

def givel(): 
    n=int(input()) 
    l=[int(i) for i in input().split()] 
    curr = 0 
    i = 0 
    while i<len(l): 
        temp = i+1 
        ans = 0 
        while temp<len(l) and l[temp]<=l[temp-1]: 
            temp+=1 
            ans+=1 
        i=temp 
        curr = max(curr,ans) 
    return curr
print(givel())
import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)
    
elif m == 0:
    dp = [0] * (n + 1)
    dp[1] = 1
    dp[2] = 1
    for i in range(3, len(dp)):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[m])
    

else:
    dp = [0]*(n+1)
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        #dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)
    x = 1
    for i in ans:
        x = x*dp[i]%d
    print(x)

### FIXED CODE ###

p, q, r= [int(i) for i in input().split()]

l=[p,q,r]
print(sum(l)-max(l))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
from functools import cmp_to_key
import itertools
 
N, T = map(int, readline().split())
m = map(int, read().split())
AB0 = []
AB1 = []
for a,b in zip(m,m):
    if a == 0:
        AB0.append(b)
    else:
        AB1.append((a,b))
 
def sort_func(ab0, ab1):
    a0, b0 = ab0
    a1, b1 = ab1
    return a1*(1+b0) - a0*(1+b1)
 
AB0.sort()
AB1.sort(key=cmp_to_key(sort_func))
AB0, AB1
 
def compute_0():
    INF = T + 1
    dp = [INF] * 40
    dp[0] = 0
    for a,b in AB1:
        for n in range(39, -1, -1):
            if dp[n] > T:
                continue
            x = (dp[n] + 1) * (a + 1) + b
            if x < dp[n+1]:
                dp[n+1] = x
    return dp
 
def compute_1():
    return [0] + list(itertools.accumulate(x + 1 for x in AB0))
 
dp0 = compute_0()
dp1 = compute_1()
 
R = len(dp1) - 1
answer = 0
for i,x in enumerate(dp0):
    if x > T:
        break
    while x + dp1[R] > T:
        R -= 1
    value = i + R
    if answer < value:
        answer = value
 
print(answer)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
m = map(int,read().split())
AB = zip(m,m)
 
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
 
dist = [-1] * (N+1)
stack = [1]
dist[1] = 0
while stack:
    v = stack.pop()
    for w in graph[v]:
        if dist[w] == -1:
            dist[w] = dist[v] + 1
            stack.append(w)
 
ev = [i for i,x in enumerate(dist) if x % 2 == 0 and i > 0]
od = [i for i,x in enumerate(dist) if x % 2 == 1 and i > 0]
 
def make_perm(N, ev, od, x0, x1, x2, y0, y1, y2):
    assert len(ev) == x0 + x1 + x2
    assert len(od) == y0 + y1 + y2
    P = [0] * (N+1)
    for i in ev:
        if x0:
            P[i] = (x0 + y0) * 3
            x0 -= 1
            continue
        if x1:
            P[i] = (x1 + y1) * 3 - 2
            x1 -= 1
            continue
        if x2:
            P[i] = (x2 + y2) * 3 - 1
            x2 -= 1
            continue
    for i in od:
        if y0:
            P[i] = (x0 + y0) * 3
            y0 -= 1
            continue
        if y1:
            P[i] = (x1 + y1) * 3 - 2
            y1 -= 1
            continue
        if y2:
            P[i] = (x2 + y2) * 3 - 1
            y2 -= 1
            continue
    return P[1:]
 
def solve(N, ev, od):
    x0 = N // 3
    x1 = (N+2) // 3
    x2 = (N+1) // 3
    perm = [0] * (N+1)
    LE = len(ev)
    LO = len(od)
    if LE <= x0:
        return make_perm(N, ev, od, LE, 0, 0, x0-LE, x1, x2)
    if LO <= x0:
        return make_perm(N, ev, od, x0-LO, x1, x2, LO, 0, 0)
    if LE == x1:
        return make_perm(N, ev, od, 0, x1, 0, x0, 0, x2)
    if LO == x1:
        return make_perm(N, ev, od, x0, 0, x2, 0, x1, 0)
    # どちらも x1 よりたくさんある
    return make_perm(N, ev, od, LE-x1, x1, 0, LO-x2, 0, x2)
 
P = solve(N, ev, od)
print(' '.join(map(str, P)))
import sys
a = [print(len(sum(map(int, line.split())))) for line in sys.stdin]

### FIXED CODE ###

import sys
[print(len(str(sum(map(int, line.split()))))) for line in sys.stdin]
from functools import reduce 
from operator import add
 
n = int(input())
arr = map(int, input().split())
 
pt_a = 0
pt_b = 0
 
arr.sort(reverse=True)
 
for ind, num in enumerate(arr):
  if ind % 2 == 0:
    pt_a += num
  else:
    pt_b += num
 
print(pt_a - pt_b)

### FIXED CODE ###

from functools import reduce 
from operator import add
 
n = int(input())
arr = list(map(int, input().split()))
 
pt_a = 0
pt_b = 0
 
arr.sort(reverse=True)
 
for ind, num in enumerate(arr):
  if ind % 2 == 0:
    pt_a += num
  else:
    pt_b += num
 
print(pt_a - pt_b)
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//b-A*(x//b))


### FIXED CODE ###

A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//B-A*(x//B))
N,M,C = map(int, input().split())
B = map(int, input().split())
A = [[0 for i in range(M)] for j in range(N)]

for i in range(N):
	A[i] = map(int, input().split())

ans = 0

for i in range(N):
	tmp = 0
	for j in range(M):
		tmp = tmp + A[i][j]*B[j]
	if(tmp+C>0):
		ans += 1

print(ans)


### FIXED CODE ###

N,M,C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = []

for i in range(N):
	A.append(list(map(int, input().split())))

ans = 0

for i in range(N):
	tmp = 0
	for j in range(M):
		tmp = tmp + A[i][j]*B[j]
	if(tmp+C>0):
		ans += 1

print(ans)
import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n=int(readline())
    aa=[]
    for _ in range(n):
        a = readline().strip()
        if a in aa:
            aa.remove(a)
        else:
            aa.append(a)
    print(len(aa))
    return

if doTest!=1:
    resolve()
    sys.exit()

### FIXED CODE ###

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n=int(readline())
    d={}
    for _ in range(n):
        a = readline().strip()
        if a in d:
            d[a]+=1
        else:
            d[a]=1
    cnt=0
    for key in d:
        if d[key]%2==1:
            cnt+=1
    print(cnt)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()
lis=[]
while True:
  if input()=="0":
    break
  else:
    lis.append(input())

for i in range(len(lis)):
  print("Case %i: %i" % (i,lis[i]))

### FIXED CODE ###

lis=[]
while True:
  d=input()
  if d=="0":
    break
  else:
    lis.append(int(d))

for i in range(len(lis)):
  print("Case %i: %i" % (i+1,lis[i]))
c = [0]*10**5
for i in open(0).read().split()[::2]: c[int(i)] ^= 1
print("NO" if any(c) else "YES")

### FIXED CODE ###

c = [0]*10**5
for i in open(0).read().split()[2:]: c[int(i)-1] ^= 1
print("NO" if any(c) else "YES")
S = list(input())
li = list(set(S))
li.sort()
ascii_lowercase = list("abcdefghijklmnopqrstuvwxyz")
for i in range(0,len(S),1):
  if li[i] != ascii_lowercase[i]:
    print(ascii_lowercase[i])
    break
  elif li == ascii_lowercase:
    print("None")
    break

### FIXED CODE ###

S = list(set(input()))
S.sort()
tmp = "abcdefghijklmnopqrstuvwxyz"
for i in range(0,len(tmp),1):
    if tmp[i] not in S:
        print(tmp[i])
        exit()
print("None")
n,m = map(int,input().split())
cards = list(map(int,input().split()))
cards.sort()
actions = []
#print()
#print(cards)
for i in range(m):
    l,r  = map(int,input().split())
    actions.append([r,l])
actions.sort(reverse=True)
start = 0
for i in range(m):
    minnum = min(cards)
    if actions[i][0] <= minnum:
        break
    else:
        for j in range(actions[i][1]):
            #print(cards[j])
            if cards[start+j] <= actions[i][0]:
                cards[start+j] = actions[i][0]
            else:
                break
    start += actions[i][1]
    #print(cards)
print(sum(cards))


### FIXED CODE ###

import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

minA = A[0]
Query = []
for _ in range(m):
    b,c = map(int,input().split())
    if c > minA:
        Query.append([b,c])
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)

ans = 0
index = 0
for b,c in Query:
    if index >= n:
        break
    #print("----")
    cnt = 0
    Flag = True
    while Flag:
        #print(A,b,c,index)
        if A[index] < c:
            A[index] = c
            cnt += 1
            index += 1
            if (cnt >= b) or (index >= n):
                Flag = False
        else:
            Flag = False
    '''
    #A.sort()
    if A[0] >= c:
        break
    else:
        index = min(bisect.bisect_left(A,c),b)
        if index > len(A):
            ans += c * len(A)
            break
        else:
            ans += c * index
            A = A[index:]
    print(A)
    '''
print(sum(A))
n = int(input())

X = list(input().split())
X.append(1000000)
ans = 0

for i in range(1, n):
    if(X[i-1] == X[i]):
        ans+=1
        X[i] = X[i-1] + X[i+1]
print(ans)

### FIXED CODE ###

n = int(input())

X = list(map(int, input().split()))
X.append(1000000)
ans = 0

for i in range(1, n):
    if(X[i-1] == X[i]):
        ans+=1
        X[i] = X[i-1] + X[i+1]
print(ans)
N, T = map(int, input().split())
ans = []
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans.append(c)
ans.sort()
print(ans[0])

### FIXED CODE ###

N, T = map(int, input().split())
ans = []
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans.append(c)
if not ans:
  print('TLE')
else:
  ans.sort()
  print(ans[0])
import itertools
n = int(input())
t = [i for i in range(n)]
li = list(itertools.permutations(t))
p = list(map(int,input().split())
q = list(map(int,input().split())
p = tuple(p)
q = tuple(q)
pp = li.index(p)
qq = li.index(q)
print(abs(pp-qq))     

### FIXED CODE ###

import sys
input=sys.stdin.buffer.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
import itertools
n = int(input())
t = [i+1 for i in range(n)]
li = list(itertools.permutations(t))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
p = tuple(p)
q = tuple(q)
pp = li.index(p)
qq = li.index(q)
print(abs(pp-qq))
N,K=map(int,input().split())
R,S,P=map(int,input().split()) #RSP グーチョキパー
T=list(input())

c=0

def jan(a):
    if a=="r":
        return P
    if a=="s":
        return R
    if a=="p":
        return S

for i in range(1,N):
    if T[i]==T[i-1]:
        T[i]="o"

for i in range(1,K+1): #modK
    for j in range(N//K+1):
        if i+K*j>N-1:
            continue
        c+=jan(T[i+K*j])

print(c)

### FIXED CODE ###

N,K=map(int,input().split())
R,S,P=map(int,input().split()) #RSP グーチョキパー
T=list(input())

c=0

def jan(a):
    if a=="r":
        return P
    elif a=="s":
        return R
    elif a=="p":
        return S
    else:
        return 0

for i in range(K,N):
    if T[i-K]==T[i]:
        T[i]="o"

for i in range(1,K+1): #modK
    for j in range(N//K+1):
        if i+K*j>N:
            continue
        c+=jan(T[i+K*j-1])

print(c)
N=int(input())
L=list(map(int,input().split()))
c=0
L.sort()
for i in range(0,N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[k]>=L[i]+L[j]:
                c+=N-k
                break
N=int((N-2)*(N-1)*N/6-c)
print(N)

### FIXED CODE ###

A,B=map(int,input().split())
if A<=2*B:
    print(0)
else:
    print(A-2*B)
N, K, X, Y = map(int, input().split())
if N >= K:
    res = K * X + (N-K) * Y
else: 
    res = N * X
print(res)


### FIXED CODE ###

n, k, x, y = (int(input()) for _ in range(4)) 
if n >= k:
    res = k * x + (n-k) * y
else: 
    res = n * x
print(res)
X,Y,Z,K = map(int, input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
C.sort()
C.reverse()


array = []
tmp = []

for a in A:
  for b in B:
    tmp.append(a+b)
tmp.sort()
tmp.reverse()

for i in range(K):
  for c in C:
    array.append(tmp[i]+c)

array.sort()
array.reverse()

for i in range(K):
  print(array[i])

### FIXED CODE ###

from heapq import heappop, heappush,heapify
X,Y,Z,K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
H = []
heappush(H,[-1*(A[0]+B[0]+C[0]),0,0,0])
count = 1
memo = []
while H and count <= K:
  tmp,i,j,k = heappop(H)
  print(-1*tmp)
  count += 1
  if i+1 < X and ((i+1,j,k) not in memo):
    heappush(H,[-1*(A[i+1]+B[j]+C[k]),i+1,j,k])
    memo.append((i+1,j,k))
  if j+1 < Y and ((i,j+1,k) not in memo):
    heappush(H,[-1*(A[i]+B[j+1]+C[k]),i,j+1,k])
    memo.append((i,j+1,k))
  if k+1 < Z and ((i,j,k+1) not in memo):
    heappush(H,[-1*(A[i]+B[j]+C[k+1]),i,j,k+1])
    memo.append((i,j,k+1))
def flpl(): return [float(i) for i in input().split()]
def inpl(): return [int(i) for i in input().split()]
import numpy as np
import heapq

xs, ys, xt, yt = flpl()
N = int(input())
xyr = [(xs, ys, 0),(xt, yt, 0)] + [inpl() for _ in range(N)]
X, Y, R = np.array(xyr).T
X, Y, R = np.tile(X, (N+2, 1)), np.tile(Y, (N+2, 1)), np.tile(R, (N+2, 1))
edge = np.maximum(np.zeros((N+2, N+2)), np.sqrt(np.square(X-X.T) +\
                  np.square(Y-Y.T))-(R+R.T)) +\
                  np.diag(np.ones(N+2)*np.inf)

dist = np.array([np.inf for _ in range(N+2)])
dist[0] = 0 
remain = set(range(N+2))
Q = []
heapq.heappush(Q,(0,0))
while Q:
    c, vn = heapq.heappop(Q)
    if vn not in remain or c > dist[c]:
        continue
    remain.remove(vn)
    for j in remain:
        if dist[vn] + edge[vn][j] < dist[j]:
            dist[j] = dist[vn] + edge[vn][j] 
            heapq.heappush(Q,(dist[j],j)) 
    if 1 not in remain:
        break
print(dist[1])

### FIXED CODE ###

def flpl(): return [float(i) for i in input().split()]
def inpl(): return [int(i) for i in input().split()]
import heapq
def dijkstra(vnum, vs):
    dist = [float('inf') for _ in range(vnum)]
    dist[vs] = 0 
    remain = set(range(vnum))
    Q = []
    heapq.heappush(Q,(0,vs))
    while Q:
        c, vn = heapq.heappop(Q)
        if vn not in remain :
            continue
        remain.remove(vn)
        for j in remain:
            evnj = edge(vn, j)
            if dist[vn] + evnj < dist[j]:
                dist[j] = dist[vn] + evnj 
                heapq.heappush(Q,(dist[j],j)) 
        if not remain:
            break
    return dist
def edge(s, t):
    return max(((X[s] - X[t])**2 + (Y[s] - Y[t])**2)**(1/2) -(R[s]+R[t]), 0)

xs, ys, xt, yt = flpl()
N = int(input())
xyr = [(xs, ys, 0),(xt, yt, 0)] + [inpl() for _ in range(N)]
X, Y, R = list(map(list, zip(*xyr)))
D = dijkstra(N+2, 0)
print(D[1])
from operator import itemgetter

N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]
ans = []
for i in range(N):
  l[i].append(l[i][0] - l[i][1])
  l[i].append(l[i][0] + l[i][1])
  del l[i][:2]
l.sort(key = itemgetter(1))

def search(x):
  for i in range(x, len(l)):
    if l[i][0] < l[i-1][1]:
      del(l[i])
      ans.append(1)
      search(x)
      break
search(1)
if ans == []:
  print(N)
else:
  print(N-sum(ans))

### FIXED CODE ###

from operator import itemgetter

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

l.sort(key = itemgetter(1))
cnt = 0
s = - 10 ** 10
for i in range(N):
  if l[i][0] >= s:
    s = l[i][1]
  else:
    cnt += 1
print(N-cnt)
n = input()
m = n % 10

if m == 2 or m == 4 or m == 5 or m == 7 or m == 9:
  print("hon")
elif m == 3:
  print("bon")
else:
  print("pon")

### FIXED CODE ###

n = int(input())
m = n % 10

if m == 2 or m == 4 or m == 5 or m == 7 or m == 9:
  print("hon")
elif m == 3:
  print("bon")
else:
  print("pon")
import sys
import numpy as np
import numba
from numba import jit
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(p):
  count = 0
  if np.any(p%2==1):
    return 0
  if np.unique(p).size == 1:
    return -1
  while True:
    if np.all(p%2 == 0):
      print('hoge')
      p = p/2
      count += 1
      continue
    break
  return count


p = np.array(readline().split(), np.int64)
print(main(p))


### FIXED CODE ###

a, b, c = map(int, input().split())
if a == b and b == c:
    if a % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
        count += 1
    print(count)
import collections
N = int(input())
G = [set() for i in range(N)]

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


F = [-1]*N
F[0] = 0
q = collections.deque()
q.append(0)
while(q):
    x = q.popleft()
    for y in G[x]:
        if F[y] < 0:
            F[y] = F[x] + 1
            q.append(y)

S = [-1]*N
S[N-1] = 0
q.append(N-1)
while(q):
    x = q.popleft()
    for y in G[x]:
        if S[y] < 0:
            S[y] = S[x] + 1
            q.append(y)
# print(F)
# print(S)
ans = 0
for i in range(N):
    if F[i] + S[i] == F[-1]:



if ans > N // 2:
    print("Fennec")
else:
    print("Snuke")


### FIXED CODE ###

N=int(input())
import collections
import heapq
ab=[tuple(map(int,input().split())) for i in range(N-1)]
G=[set() for i in range(N)]
for a,b in ab:
  a-=1
  b-=1
  G[a].add(b)
  G[b].add(a)
q=collections.deque()

dis=[[-1]*N for i in range(2)]
dis[0][0]=0
q.append(0)
while(q):
  x=q.popleft()
  for y in G[x]:
    if dis[0][y]==-1:
      q.append(y)
      dis[0][y]=dis[0][x]+1
dis[1][N-1]=0
q.append(N-1)
while(q):
  x=q.popleft()
  for y in G[x]:
    if dis[1][y]==-1:
      q.append(y)
      dis[1][y]=dis[1][x]+1

hqF=[(0,0)]
hqS=[(0,N-1)]
colord=[False]*N

while(1):
  if len(hqF)==0:
    print("Snuke")
    exit(0)
  _,x = heapq.heappop(hqF)
  while(colord[x]):
    if hqF:
      _,x = heapq.heappop(hqF)
    else:
      print("Snuke")
      exit(0)
  colord[x]=True
  for y in G[x]:
    if colord[y]==False:
      heapq.heappush(hqF,(dis[1][y],y))

  if len(hqS)==0:
    print("Fennec")
    exit(0)
  _,x = heapq.heappop(hqS)
  while(colord[x]):
    if hqF:
      _,x = heapq.heappop(hqS)
    else:
      print("Fennec")
      exit(0)
  colord[x]=True
  for y in G[x]:
    if colord[y]==False:
      heapq.heappush(hqS,(dis[0][y],y))
from fractions import gcd
from math import sqrt

d = gcd(*map(int, input().split()))
r = 1
for i in range(2, int(sqrt(d)) + 1):
    if d % i == 0:
        d //= i
        r += 1
    while d % i == 0:
        d //= i
print(r + (d > 1))


### FIXED CODE ###

R = lambda: map(int, input().split())
n, = R()
a = list(R())
print(*sorted(range(1, n + 1), key=lambda x: a[x - 1]))