Harryxun/stf_run huggingface dataset:
n = int(input())
e = [[int(i) for i in input().split()] for i in range(n)]

def f():
    for x in range(101):
        for y in range(101):
            flg = True
            H = e[0][2] + abs(x-e[0][0]) + abs(y-e[0][1])
            if len(e) > 1:
                for e_ in e[1:]:
                    if H != e_[2] + abs(x-e_[0]) + abs(y-e_[1]):
                        flg = False
                        break
            if flg:
                return (x, y, H)
result = f()
print("{} {} {}".format(result[0], result[1], result[2]) )

### FIXED CODE ###

n = int(input())
e = sorted([[int(i) for i in input().split()] for i in range(n)], key=lambda x:x[2])[::-1]

def f():
    for x in range(101):
        for y in range(101):
            flg = True
            H = e[0][2] + abs(x-e[0][0]) + abs(y-e[0][1])
            for e_ in e:
                if (e_[2] == 0):
                    if H > abs(x-e_[0]) + abs(y-e_[1]):
                        flg = False
                        break
                    else:
                        continue
                
                if H != e_[2] + abs(x-e_[0]) + abs(y-e_[1]):
                    flg = False
                    break
            if flg:
                return (x, y, H)
result = f()
print("{} {} {}".format(result[0], result[1], result[2]) )
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

x = max(A)
hurui = [x]*(x+1)
for i in range(2, x+1):
    for j in range(i, x, i):
        hurui[j] = min(i, hurui[j])

cnt = Counter()
for i in range(N):
    num = A[i]
    while num > 1:
        x = hurui[num]
        while num%x == 0:
            num //= x
        cnt[x] += 1

a = cnt.most_common(1)[0][1]
if a == 1:
    print("pairwise coprime")
elif a < N:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))

x = max(A)
hurui = [x]*(x+1)
for i in range(2, x+1):
    for j in range(i, x+1, i):
        hurui[j] = min(i, hurui[j])

cnt = Counter([1])
for i in range(N):
    num = A[i]
    while num > 1:
        x = hurui[num]
        while num%x == 0:
            num //= x
        cnt[x] += 1

a = cnt.most_common(1)[0][1]
if a == 1:
    print("pairwise coprime")
elif a < N:
    print("setwise coprime")
else:
    print("not coprime")
n, s = map(int, input().split())
xxx = [abs(s - y) for y in map(int, input().split())]
d = 0
while True:
    d = min(xxx)
    xxx = [x % d for x in xxx]
    if all(x == 0 for x in xxx):
        break
print(d)


### FIXED CODE ###

n, s = map(int, input().split())
xxx = [abs(s - y) for y in map(int, input().split())]
d = 0
while True:
    xxx = [x for x in xxx if x > 0]
    d = min(xxx)
    xxx = [x % d for x in xxx]
    if all(x == 0 for x in xxx):
        break
print(d)
k,s=map(int,input().split())
ans=0

z = list(range(0,K+1))
answer = []

for i in z:
  s_z = S - i
  if K < s_z:
    for x in list(range(s_z - K,K+1)):
      y = s_z - x
      answer.append([x, y, z])

  else:
    for x in list(range(0,s_z+1)):
      y = s_z - x
      answer.append([x, y, z])

print(len(answer))

### FIXED CODE ###

K,S=map(int,input().split())

z = list(range(0,K+1))
answer = []

for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      answer.append(K + 1 - (s_z - K))
  else:
    answer.append(s_z + 1)

print(sum(answer))
package main

import (
	"fmt"
)

func main() {
	var n int
	var ans int = 1
	var t int

	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&t)
		ans = ans * t
		if ans > 1000000000000000000 {
			ans = -1
		}
	}

	fmt.Println(ans)
}


### FIXED CODE ###

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

ans = 1

if 0 in A:
    print(0)
    exit()

for i in range(N):
    ans *= A[i]

    if ans > 10**18:
        ans = -1
        break

print(ans)
N, M = map(int, input().split())
X=[]
for i in range(M):
    X.append(list(map(int, input().split())))
P=list(map(int, input().split()))


ans=0
key='{:0'+str(N)+"b}"
for i in range(2**N):
    
    switch=list(key.format(i))
    for i in range(M):
        if P[i]==1:
            odd=0
            for j in range(X[i][0]):
                odd+=int(switch[ X[i][j+1]-1] )
            if odd%2==0:
                break
            #print(X[i],switch,odd)
        else:
            even=0
            for j in range(X[i][0]):
                even+=int(switch[ X[i][j+1]-1] )
            if even%2==1:
                break
    if odd%2==1 and even%2==0:
        ans+=1
        
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
X=[]
for i in range(M):
    X.append(list(map(int, input().split())))
P=list(map(int, input().split()))
ans=0

key='{:0'+str(N)+"b}"
for k in range(2**N):
    
    switch=list(key.format(k))
    for i in range(M):
        odd=1
        even=0
        if P[i]==1:
            odd=0
            for j in range(X[i][0]):
                odd+=int(switch[ X[i][j+1]-1] )
            if odd%2==0:
                break
            
        else:
            even=0
            for j in range(X[i][0]):
                even+=int(switch[ X[i][j+1]-1] )
            if even%2==1:
                break
    
    if odd%2==1 and even%2==0:
        ans+=1
        #print(X[i],switch,odd,even)
            
print(ans)
x, y, z = map(int, input().split())
lis = [x, y, z]
print("".join(lis))

### FIXED CODE ###

a, b, c = input().split()
lis = [c, a, b]
print(" ".join(lis))
import math

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

a = list(map(int, input().split()))
l = 0
r = max(a)

x = (l+r)//2
ans = r+1
while(r>1+l):
    
    x = (l+r)//2
    count = 0
    for i in range(N):
        count += math.ceil(a[i] /x)-1
    if (count <=K):
        if (ans > x):
            ans = x
        r = x
    else:
        l = x

for i in range(N):
    count += math.ceil(a[i]/l)-1

if (count <=K):
    ans = l
else:
    ans = r
print(ans)

        
        

    


### FIXED CODE ###

import math

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

a = list(map(int, input().split()))
l = 0
r = max(a)

x = (l+r)//2
ans = r+1
while(r>1+l):

    
    x = (l+r)//2
    if x == 0:
        break

    count = 0
    for i in range(N):
        count += math.ceil(a[i] /x)-1
    if (count <=K):
        if (ans > x):
            ans = x
        r = x
    else:
        l = x
count = 0
ans = x
if(x!= 0 and l != 0):
        
    for i in range(N):
        count += math.ceil(a[i]/l)-1

    if (count <=K):
        ans = l
    else:
        ans = r

if l==0:
    ans = r
print(ans)
int x = input()
print(x**3)


### FIXED CODE ###

x=int(input())
print(x**3)
a=input()
print a**3


### FIXED CODE ###

x=int(input())
print (x**3)
A,B = map(int, input().split())

if (A+B)%0 :
	print((A+B)/2)
else :
	print('IMPOSSIBLE')

### FIXED CODE ###

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

if (A+B)%2 == 1 :
	print('IMPOSSIBLE')
else :
	print((A+B)//2)
a, v=map(int, input().split())
b, w=map(int, input().split())
t=int(input())
 
dis =abs(a-b)
mob =v-w
 
if speed<=0:
    print("No")
else:
    if distance/speed <=T:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if (v-w)*t>=abs(b-a):
    print("YES")
else:
    print("NO")
n = int(input())
x = n%10
if (x == 2, or x == 4, or x == 5, or x == 7, or x == 9):
  print("hon")
elif (x == 0, or x == 1, or x == 6, or x == 8):
  print("pon")
else:
  print("bon")

### FIXED CODE ###

n = int(input())
x = n%10
if (x == 2 or x == 4 or x == 5 or x == 7 or x == 9):
  print("hon")
elif (x == 0 or x == 1 or x == 6 or x == 8):
  print("pon")
else:
  print("bon")
a,b = map(int,input().split())

import numpy as np
ans = int(a * b / np.gcd(a, b))

print(ans)



### FIXED CODE ###


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

def gcd(a,b):
    if a%b==0:
        return b
    else:
        return gcd(b,a%b)
ans = a*b//gcd(a,b)
print(ans)
import math

def count_index(list, k):
    count = 0
    for i in range(k):
        if (list[i] < list[k]):
            count = count + 1
    return list[k]-count-1

n = int(input())-1
p = list(map(int,input().split()))
q = list(map(int,input().split()))

a = (p[0]-1) * math.factorial(n)+1
b = (q[0]-1) * math.factorial(n)+1

for i in range(1,n):
    a = a + count_index(p, i) * math.factorial(n-i)
    b = b + count_index(q, i) * math.factorial(n-i)

ans = a-b
print(abs(ans))

### FIXED CODE ###

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

if k * 500 >= x:
    print('Yes')
else:
    print('No')
N, K = map(int, input().split())
x = [int(i) for i in input().split()]

time = 10 ** 20
# 0以上の最小の整数
base = 0
index = 0

for i in range(N):
    if x[i] >= 0:
        base = x[i]
        index = i
        break

for i in range(max(0, index - K), min(index, N)):
    if x[i+K-1] < 0:
        time = min(abs(x[i]), time)
    elif x[i] < 0 and  x[i+K-1] >= 0:
        time = min(min(abs(x[i]), x[i+K-1]) * 2 + max(abs(x[i]), x[i+K-1]), time)
    else:
        time = min(x[i+K-1], time)

print(time)

### FIXED CODE ###

# 無駄なところも数えて良いっていう考え方もある。
# 常に最適化しないといけないわけではない

N, K = map(int, input().split())
x = [int(i) for i in input().split()]

time = 10 ** 20

for i in range(N - K + 1):
    x_min = x[i]
    x_max = x[i + K - 1]
    if x_min >= 0:
        this_time = x_max
    elif x_max <= 0:
        this_time = abs(x_min)
    else:
        this_time = x_max - x_min + min(x_max, abs(x_min))

    if time > this_time:
        time = this_time

print(time)
import sys
import math
def input(): return sys.stdin.readline().rstrip()
def main():
    h=int(input())
    print(2**(int(math.log2(h))+1)-1)

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
import math
def input(): return sys.stdin.readline().rstrip()
def main():
    h=int(input())
    print(2**(int(math.log2(h))+1)-1)

if __name__=='__main__':
    main()
num=int(input())
for i in range (0,num):
	some=input(list1[])
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

### FIXED CODE ###

list1=[]
num=int(input())
for i in range (0,num):
    list1.append(input())
print(len(set(i for i in list1 if i.isalpha())))
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
i=0
while total<=X:
    total+=L[i]
    i+=1
    count+=1
print(count)

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=1
for i in range(N):
    total+=L[i]
    if total<=X:
        count+=1
print(count)
N, M = [int(x) for x in input().split()]
links = [tuple(map(int, input().split())) for _ in range(M)]
S, T = [int(x) for x in input().split()]

d = {}
for x, y in links:
    if x in d:
        d[x][0].add(y)
    else:
        d[x] = [{y}, False]

def next_node(start):
    history = set()
    for s in start:
        if s in d:
            history |= d[s][0]
    return history

history = {S}
s = 1
while True:
    for _ in range(3):
        history = next_node(history)
    if T in history:
        print(s)
        break
    for h in tuple(history):
        if d[h][1]:
            history.remove(h)
        else:
            d[h][1] = True
    if len(history) == 0:
        print(-1)
        break
    s += 1
    

### FIXED CODE ###

N, M = [int(x) for x in input().split()]
links = [tuple(map(int, input().split())) for _ in range(M)]
S, T = [int(x) for x in input().split()]

d = {}
for x, y in links:
    if x in d:
        d[x][0].add(y)
    else:
        d[x] = [{y}, False]

def next_node(start):
    history = set()
    for s in start:
        if s in d:
            history |= d[s][0]
    return history

history = {S}
s = 1
while True:
    for _ in range(3):
        history = next_node(history)
    if T in history:
        print(s)
        break
    for h in tuple(history):
        if h not in d or d[h][1]:
            history.remove(h)
        else:
            d[h][1] = True
    if len(history) == 0:
        print(-1)
        break
    s += 1
import sys
from numpy.linalg import solve
import numpy as np
inputs = sys.stdin.readlines()

n = int(inputs[0])
A = np.array(list(map(int, inputs[1].split())))
I = np.eye(n, dtype=np.int)
B = np.empty((n, n), dtype=np.int)
for i in range(n):
    B[i, :] = I[i] + I[(i+1)%n]
print(*(map(lambda x: int(2*x), solve(B, A))))

### FIXED CODE ###

import sys
import numpy as np
inputs = sys.stdin.readlines()

n = int(inputs[0])
A = np.array(list(map(int, inputs[1].split())))
B = np.empty((n,), dtype=np.int)
B[0] = (sum(A[::2])-sum(A[1::2])) // 2
for i in range(1, n):
    B[i] = A[i-1] - B[i-1]
print(*(B*2))
# -*- coding: utf-8 -*-


def qui(l):
    num = len(l)
    if num <= 1:
        return l
    piv = 0
    piv2 = len(l)-1
    piv3 = int(len(l)/2)
    if l[piv] > l[piv2] > l[piv3]:
        piv = piv2
    elif l[piv] > l[piv3] > l[piv2]:
        piv = piv3
    else:
        pass
    mini = []
    maxi = []

    for i in range(0,len(l)):
        if i == piv:
            continue
        if l[piv] > l[i]:
            mini.append(l[i])
        elif l[piv] <= l[i]:
            maxi.append(l[i])
    return qui(mini) + [l[piv]] + qui(maxi)

input()
list1 = list(map(lambda x: int(x), input().split(" ")))
result = qui(list1)

print(' '.join(map(str, result)))

### FIXED CODE ###

# -*- coding: utf-8 -*-

import random
def qui(l):
    num = len(l)
    if num <= 1:
        return l
    piv = random.randrange(0,len(l))
    piv2 = random.randrange(0,len(l))
    piv3 = random.randrange(0,len(l))
    if (l[piv] > l[piv2]) and (l[piv2] > l[piv3]):
        piv = piv2
    elif (l[piv] > l[piv3]) and (l[piv3] > l[piv2]):
        piv = piv3
    elif (l[piv] < l[piv2]) and (l[piv2] < l[piv3]):
        piv = piv2
    elif (l[piv] < l[piv3]) and (l[piv3] < l[piv2]):
        piv = piv3
    else:
        pass
    mini = []
    middlei = []
    maxi = []

    for i in range(0,len(l)):
        if l[i] == l[piv]:
            middlei.append(l[i])
        elif l[piv] > l[i]:
            mini.append(l[i])
        elif l[piv] <= l[i]:
            maxi.append(l[i])
    mini = qui(mini)
    maxi = qui(maxi)
    return mini+ middlei+maxi
input()
list1 = input().split(" ")
for i in range(0, len(list1)):
    list1[i] = int(list1[i])

result = qui(list1)

print(' '.join(map(str, result)))
import sys
sys.setrecursionlimit(10000)
n = int(input())
d = int(input())
p = 10**9+7
DP = {}
DP[-1] = [0]*d
DP[0] = [0]*d
DP[0][0] = 1
def dp(i):
    try:
        return DP[i]
    except:
        pass
    q, r = i//10, i % 10
    DP[i] = []
    for j in range(d):
        tmp = 0
        for k in range(r+1):
            tmp += dp(q)[(j-k) % d]
        for k in range(r+1, 10):
            tmp += dp(q-1)[(j-k) % d]
        DP[i].append(tmp)
    return DP[i]
print((dp(n)[0]-1) % p)


### FIXED CODE ###

n = int(input())
d = int(input())
p = 10**9+7
if d == 1:
    print(n % p)
    exit()
N = [int(i) for i in list(str(n))]
DP0 = [0] * d
DP1 = [0] * d
DP1[0] += 1
for i in N:
    DP0_ = [0] * d
    DP1_ = [0] * d
    for r in range(d):
        for j in range(i):
            DP0_[r] += DP1[(r-j) % d]
            DP1_[r] += DP1[(r-j) % d]
        DP0_[r] += DP0[(r-i) % d]
        DP1_[r] += DP1[(r-i) % d]
        for j in range(i+1, 10):
            DP0_[r] += DP0[(r-j) % d]
            DP1_[r] += DP0[(r-j) % d]
        DP0_[r], DP1_[r] = DP0_[r] % p, DP1_[r] % p
    DP0, DP1 = DP0_, DP1_
print((DP1[0]-1+p) % p)
a,b = map(int(), input().split())
c=a*b
if c%2==0:
  print("Odd")
else:
  print("Even")

### FIXED CODE ###

a,b = map(int, input().split())
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")
#sを最高のパターンにして，tを最悪のパターンにすればいい
#continueで強制的に次のループへ
s = list(input())
t = list(input())
condition = 0

s.sort()
t.sort()
t.reverse()

if len(s)  == len(t):
    pattern == -1
elif len(s) < len(t):
    length = len(s)
    pattern = 0
else:#sのほうが長い時 pattern = 1
    length = len(t)
    pattern = 1

if pattern == -1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] > t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
    if condition == 0:
        print("No")
elif pattern == 0:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
    
    if condition == 0:
        print("Yes")
elif pattern == 1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
            
    if condition == 0:
        print("No")
        
    



### FIXED CODE ###

#sを最高のパターンにして，tを最悪のパターンにすればいい
#continueで強制的に次のループへ
s = list(input())
t = list(input())
condition = 0

s.sort()
t.sort()
t.reverse()

if len(s)  == len(t):
    length = len(s)
    pattern = -1
elif len(s) < len(t):
    length = len(s)
    pattern = 0
else:#sのほうが長い時 pattern = 1
    length = len(t)
    pattern = 1

if pattern == -1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
    if condition == 0:
        print("No")
elif pattern == 0:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
    
    if condition == 0:
        print("Yes")
elif pattern == 1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
            
    if condition == 0:
        print("No")
import math
N,M=(int(x) for x in input().split())
a=[0]*(N+1)
b=[0]*(N+1)
c=0
v=0
i=0

for i in range(N):
    A,B=(int(x) for x in input().split())
    a[i]=A
    b[i]=B
v = max(a)
#ソート開始
b.sort(reverse=True)
#ソート終了
#print(i,b[i],v,M,N)
i=0
for i in B:
    if i>=v:
        c+=1
        M-=i
    else:break
if M>0
    c+=math.ceil(M/v)
print(c)


### FIXED CODE ###

import math
N,M=(int(x) for x in input().split())
a=[0]*(N)
b=[0]*(N)
c=0
v=0
for i in range(N):
    A,B=(int(x) for x in input().split())
    a[i]=A
    b[i]=B
#print(a,b)
v = max(a)
#ソート開始
b.sort(reverse=True)
#ソート終了
#print(i,b[i],v,M,N)
i=0
for i in b:
    if i>=v:
        c+=1
        M-=i
    else:break
    if M <= 0:
        break
if M>0:
    c+=math.ceil(M/v)
print(c)
i = int(input())
num = map(int, input().split())
count = 0
while True:
  if type(sum(num/2)) is float:
    break
  count += 1
print(count)


### FIXED CODE ###

i = int(input())
num = list(map(int, input().split()))
count = 0
while True:
  flag = False
  for k in range(i):
    if num[k] % 2 != 0:
      flag = True
  if flag:
    break
  for k in range(i):
    num[k] /= 2
  count += 1
print(count)
s=list(map(len,input().split("T")))
x,y=map(int,input().split())
def f(i,w):
    if i==0:
        return w==0
    if (i,w) not in m:
        m[(i,w)]=f(i-1,w-t[i-1]) or f(i-1,w+t[i-1])
    return m[(i,w)]
m={}
t=sorted(s[2::2])
a=f(len(t),x-s[0])
m={}
t=sorted(s[1::2])
print(["No","Yes"][a and f(len(t),y)])

### FIXED CODE ###

s=list(map(len,input().split("T")))
x,y=map(int,input().split())
def f(t,w):
    m=[{} for i in range(len(t)+1)]
    m[0][0]=1
    for i in range(len(t)):
        for z in m[i]:
            m[i+1][z+t[i]]=1
            m[i+1][z-t[i]]=1
    return w in m[len(t)]
print(["No","Yes"][f(s[2::2],x-s[0]) and f(s[1::2],y)])
n = int( input() )
p = map(int, input().split())
q = map(int, input().split())

import math
def order(k):
    l = 0
    for i in range(n-1):
        l += (k[i]-1) * math.factorial(n-1-i)
    return l

order(p)
order(q)
print(abs(a-b))




### FIXED CODE ###

from itertools import permutations
n=int(input())
v=list(permutations(range(1,n+1),n))
print(abs(v.index(tuple(map(int,input().split())))-v.index(tuple(map(int,input().split())))))
n, a = map(int, input().split())

print(n^2 - a)

### FIXED CODE ###

n = int(input())
a = int(input())
 
print(n*n - a)
import math
n = input()    
m = n.split()
p = [int(i) for i in m]
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(p[0], p[1]))

### FIXED CODE ###

import fractions
n = input()    
m = n.split()
p = [int(i) for i in m]
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(p[0], p[1]))
import sys

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

for i in range(1, max(a,b)):
    if a%i == 0 and b%i == 0:
        l.append(i)
if l == []:
    print(1)
    sys.exit()
l.sort(reverse=True)
print(l[k-1])

### FIXED CODE ###

import sys

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

for i in range(1, max(a,b)+1):
    if a%i == 0 and b%i == 0:
        l.append(i)
if l == []:
    print(1)
    sys.exit()
l.sort(reverse=True)
print(l[k-1])
a = int(input())
b = int(input())

print max(a+b,a-b,a*b)

### FIXED CODE ###

a,b = map(int,raw_input().split())

print max(a+b,a-b,a*b)
N = int( input() )
if N == 1 : 
   print( "Hello World" )
else : 
{
   A = int( input() )
   B = int( input() )
   print( A + B )
}

### FIXED CODE ###

N = int( input() )
if N == 1 : 
   print( "Hello World" )
else : 
   A = int( input() )
   B = int( input() )
   print( A + B )
import math
n = int(input())
a = list(map(int,input().split()))
b = sorted(a)
count = 0

def find_i(j):
    global a,b
    for i in range(n):
        if a[i] == b[j]:
            return i+1
        
def expand_a():
    global a,b,count
    for i in range(1,n):
        if a[i-1] > a[i]:
            for j in range(n):
                if b[j] >= a[i-1]-a[i]:
                    a[i] += b[j]
                    print (str(find_i(j)) +" " + str(i+1))
                    count += 1
                    break
            else:
                mc = math.ceil((a[i-1]-a[i])/b[n-1])
                a[i] += b[n-1]*mc
                count += mc
                for _ in range(mc):
                    print(str(find_i(n-1)) +" "+ str(i+1))
expand_a()
print (count)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
count = 0
s = []

def find_i():
    for i in range(n):
        if a[i] == max(a):
            return i+1
        
def find_m():
    for i in range(n):
        if a[i] == min(a):
            return i+1
        
maxi = find_i()
mini = find_m()

if min(a) < 0:
    if abs(min(a)) <= abs(max(a)):
        for _ in range(n):
            a[_] += max(a)
            s.append(str(maxi) + ' ' + str(_+1))
            count += 1
        for i in range(n-1):
            a[i+1] += a[i]
            s.append(str(i+1) + ' ' + str(i+2))
            count += 1
            
    else:
        for _ in range(n):
            a[_] += min(a)
            s.append(str(mini) + ' ' + str(_+1))
            count += 1
        for i in range(n-2,-1,-1):
            a[i] += a[i+1]
            s.append(str(i+2) + ' ' + str(i+1))
            count += 1

else:
    for i in range(n-1):
        a[i+1] += a[i]
        s.append(str(i+1) + ' ' + str(i+2))
        count += 1
print(count)
for i in range(len(s)):
    print (s[i])
n = int(input())
w_dict = {1:"a", 2: "b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g" , 8:"h", 9:"i", 10:"j", 11:"k"
        , 12:"l", 13:"m", 14:"n", 15:"o" , 16:"p", 17:"q", 18:"r", 19:"s", 20:"t", 21:"u"
        , 22:"v", 23:"w", 24:"x", 25:"y", 26:"z"}
out = ""
while n > 26:
    out = out + w_dict[n % 26]
    n = n // 26

out = out + w_dict[n]
print(out[::-1])

### FIXED CODE ###

n = int(input())

n_c = n - 1
w_dict = {0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5:"f", 6:"g" , 7:"h", 8:"i", 9:"j", 10:"k"
        , 11:"l", 12:"m", 13:"n", 14:"o" , 15:"p", 16:"q", 17:"r", 18:"s", 19:"t", 20:"u"
        , 21:"v", 22:"w", 23:"x", 24:"y", 25:"z"}
out = ""
while n_c > 25:
    out = out + w_dict[n_c % 26]
    n_c = n_c // 26 - 1

out = out + w_dict[n_c]
print(out[::-1])