Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
from collections import deque

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

positives = deque(sorted(a))
negatives = deque([positives.popleft()])
for i in range(n - 2):
    if positives[i] < 0:
        negatives.append(positives.popleft())
    else:
        break

# print M
print(sum(positives) - sum(negatives))

while len(positives) > 1:
    y = positives.popleft()
    x = negatives.pop()
    print(x, y)
    negatives.append(x - y)

x = positives.popleft()

while len(negatives) > 0:
    y = negatives.pop()
    print(x, y)
    x = x - y

### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque

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

positives = deque(sorted(a))
negatives = deque([positives.popleft()])
while len(positives) > 1:
    if positives[0] < 0:
        negatives.append(positives.popleft())
    else:
        break

# print M
print(sum(positives) - sum(negatives))

while len(positives) > 1:
    y = positives.popleft()
    x = negatives.pop()
    print(x, y)
    negatives.append(x - y)

x = positives.popleft()

while len(negatives) > 0:
    y = negatives.pop()
    print(x, y)
    x = x - y
import numpy as np
import fractions

s=str(input())
for i in range(len(s)):
    if(i%2==0):
        if(s[i]!='h' or s[i+1]!='i'):
            print("No")
            exit(0)
    if(s[i]!='h' and s[i]!='i'):
        print("No")
        exit(0)
print("Yes")

### FIXED CODE ###

import numpy as np
import fractions

s=str(input())
if(len(s)%2==1):
    print("No")
    exit(0)
for i in range(len(s)-1):
    if(i%2==0):
        if(s[i]!='h' or s[i+1]!='i'):
            print("No")
            exit(0)
    if(s[i]!='h' and s[i]!='i'):
        print("No")
        exit(0)
if(s[len(s)-1]!='h' and s[len(s)-1]!='i'):
    print("No")
    exit(0)
print("Yes")
N, A, B = map(int, input().split())
q = N // (A + B)
r = N % (A + B)

if 0 <= r <= A:
  blue = q * A + r
else:
  blue = a * A + A
  
print(blue)



### FIXED CODE ###

N, A, B = map(int, input().split())
q = N // (A + B)
r = N % (A + B)

if 0 <= r <= A:
  blue = q * A + r
else:
  blue = q * A + A
  
print(blue)
n,m = map(int,input().split())
l = [list(input().split()) for i in range(m)]
p,s = [list(i) for i in zip(*l)]
t = []
x = 0
y = 0

for i in range(m):
    if not p[i] in t:
        if s[i] == 'WA':
            y += 1
        else:
            t.append(p[i])
            x += 1

print(x,y)

### FIXED CODE ###

n,m = map(int,input().split())
if m != 0:
    l = [list(input().split()) for i in range(m)]
    p,s = [list(i) for i in zip(*l)]
t = [0] * n
ac = 0
wa = 0

for i in range(m):
    if s[i] == 'WA' and t[int(p[i])-1] != 'AC':
        t[int(p[i])-1] += 1
    elif s[i] == 'AC' and t[int(p[i])-1] != 'AC':
        ac += 1
        wa += t[int(p[i])-1]
        t[int(p[i])-1] = 'AC'

print(ac,wa)
import sys

sys.setrecursionlimit(10000)
N = int(input())
W = []
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    W.append([u - 1, v - 1, w])
color = [0] * N
tree = [[] for _ in range(N)]
for w in W:
    tree[w[0]].append([w[1], w[2]])
    tree[w[1]].append([w[0], w[2]])
for i, t in enumerate(tree):
    if len(t) == 1:
        start = i
        break
 
 
def rec(n, prev, w):
    if color[prev] == color[n]:
        if w % 2 == 1:
            color[n] = 1 if color[prev] == 0 else 0
    elif w % 2 == 0:
        color[n] = color[prev]
    for i in tree[n]:
        if i[0] == prev:
            continue
        else:
            rec(i[0], n, i[1])
 
 
rec(tree[start][0][0], start, tree[start][0][1])
for c in color:
    print(c)

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

N = int(input())
M = [[] for _ in range(N)]
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    M[u].append([v, w])
    M[v].append([u, w])

V = [0] * N
D = [0] * N
C = [0] * N


def dfs(n, c):
    if V[n] == 1:
        return
    C[n] = c
    V[n] = 1
    for w in M[n]:
        if w[1] % 2 == 0:
            dfs(w[0], c)
        else:
            dfs(w[0], (c + 1) % 2)

dfs(0, 0)
for c in C:
    print(c)
def segfunc(x, y): return max(x, y)

def update(i, x):
    i += MAX_N - 1
    node[i] = x
    while i:
        i = (i-1)//2
        node[i] = segfunc(node[i*2+1], node[i*2+2])

def query(l, r):
    L = l + MAX_N
    R = r + MAX_N
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = segfunc(s, node[R - 1])
        if L & 1:
            s = segfunc(s, node[L - 1])
            L += 1
        L >>= 1
        R >>= 1
    return s

N, K = map(int, input().split())
MAX_N = 2**(N-1).bit_length()
a = [int(input()) for _ in range(N)]
node = [0] * (2 * MAX_N)
INF = 0
ma = max(a)
ans = 0
for i in a:
    tmp = query(max(i - K, 0), min(ma, i + K) + 1)
    update(i, tmp + 1)
    ans = max(ans, tmp + 1)
print(ans)


### FIXED CODE ###

def segfunc(x, y): return max(x, y)

class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 2 ** (size - 1).bit_length()
        self.n = n
        self.node = [0] * (2*n)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = segfunc(self.node[2*i+1], self.node[2*i+2])

    def update(self, i, x):
        i += self.n - 1
        self.node[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.node[i] = segfunc(self.node[i * 2 + 1], self.node[i * 2 + 2])

    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = segfunc(self.node[2 * x + 1], self.node[2 * x + 2])

    def query(self, a, b):
        res = 0
        l = self.n - 1 + a
        r = self.n - 1 + (b - 1)

        while l <= r:
            if l == r:
                res = segfunc(res, self.node[l])
                break

            if l % 2 == 0:
                res = segfunc(res, self.node[l])
            if r % 2 == 1:
                res = segfunc(res, self.node[r])
            l = l // 2
            r = r // 2 - 1

        return res

N, K = map(int, input().split())
INF = 0
seg = SegmentTree([0] * 300005)
for i in range(N):
    a = int(input())
    tmp = seg.query(max(a - K, 0), min(a + K, 300000) + 1) + 1
    seg.update(a, tmp)
print(seg.query(0, 300005))
n, m = [int(i) for i in input().split()]
a = [-1] + [int(input()) for _ in range(m)] + [n+1]

fib_l = [-1] * (n+2)

def fib(step):
    if step < 0:
        return 0
    if fib_l[step] != -1:
        return fib_l[step]
    if 0 <= step <= 1:
        return 1
    else:
        t = fib(step-1) + fib(step-2)
        fib_l[step] = t
        return t

ret = 1
for i in range(m+1):
    ret *= fib(a[i+1] - a[i] - 2)
print(ret % 1000000007)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
a = [-1] + [int(input()) for _ in range(m)] + [n+1]

fib_l = [-1] * (n+3)

def make_fib(n):
    fib_l[0] = fib_l[1] = 1
    for i in range(2, n):
        fib_l[i] = fib_l[i-1] + fib_l[i-2]

make_fib(n+3)
ret = 1
for i in range(m+1):
    t = a[i+1] - a[i] - 2
    if t < 0:
        ret = 0
        break
    ret *= fib_l[t]
print(ret % 1000000007)
a=input()
total=0
for i in range(1, a):
  if i %5 != 0 and i %3 != 0:
    total += a
print(total)

### FIXED CODE ###

a = int(input())
total = 0
for i in range(1, a+1):
  if i % 5 != 0 and i % 3 != 0:
    total += i

print(total)
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit()
p = list(map(int, input().split()))
unique = set(range(1, max(p)+1)) - set(p)
ans = {}
ans2 = []
for i in unique:
  calc = abs(x-i)
  ans[calc] = i
  ans2.append(calc)
print(ans[min(ans2)])

### FIXED CODE ###

x, n = map(int, input().split())
if n == 0:
  print(x)
  exit()
p = list(map(int, input().split()))
unique = set(range(0, 102)) - set(p)
ans = {}
ans2 = []
for i in unique:
  calc = abs(x-i)
  if calc in ans.keys():
    ans[calc] = min(ans[calc], i)
  else:
    ans[calc] = i
  ans2.append(calc)
print(ans[min(ans2)])
a = input()
b = a / 3
print(b)

### FIXED CODE ###

a = int(input())
b = int(a / 3)
print(b)
a,b = map(str,input8).split()
if a==b:
  print("H")
else:
  print("D")

### FIXED CODE ###

a,b = map(str,input().split())
if a==b:
  print("H")
else:
  print("D")
import fraction
import numpy as np

def gcd_mul(numbers):
    s = fraction.gcd(numbers[0], numbers[1])
    for i in range(2, len(numbers)) :
        s = fraction.gcd(s, numbers[i])
    return(s)

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

ans = 0
for i in range(N) :
    B = A[np.arange(len(A))!=i]
    g = gcd_mul(B)
    if g > ans :
        ans = g
print(ans)





### FIXED CODE ###

import fractions # for python 3.4.3

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

gcd_l = [0]
gcd_r = [0]
for i in range(N):
    gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
    gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
    #print(gcd_l)
    #print(gcd_r)
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

print(max(ans))
A, B, K = map(int, input().split())
N = min(A, B)
list_gcd = [] 

for i in range(1, N):
  if A % i == 0 and B % i == 0:
    list_gcd.append(i)
    
print(list_gcd[K-1])

### FIXED CODE ###

A, B, K = map(int, input().split())
N = min(A, B)
list_gcd = [] 

for i in range(1, N+1):
  if A % i == 0 and B % i == 0:
    list_gcd.append(i)
    
if N == 1:
  Y = max(A,B)
  if Y == 1:
    list_gcd.append(1)
  else:
    for i in range(1, Y):
      if Y % i == 0:
        list_gcd.append(i)

print(list_gcd[-K])
w,h,x,y= map(int, input().split())

d=w*h/2
if x == w/2 or y == h/2:
    k = 0
if x == w/2 and y == h/2:
    k = 1
print(d, k)


### FIXED CODE ###

w,h,x,y= map(int, input().split())

k = 0
if x == w/2 or y == h/2:
    k = 0
if x == w/2 and y == h/2:
    k = 1

print("%f %d" %(w*h/2, k))
s=input()
for i in range(len(s)):
    s[i].replace("x")
print(s)

### FIXED CODE ###

s=input()
print("x"*len(s))
h,a=map(int,input.split())
cnt=0
while h>0:
    h-=a
    cnt+=1
print(cnt)

### FIXED CODE ###

h,a=map(int,input().split())
cnt=0
while True:
    h-=a
    cnt+=1
    if h<=0:
        break
print(cnt)
N = int(input())
MOD = 10 ** 9 + 7
if N == 1:
  print(0)
  exit()
a = 1
b = 1
c = 1
for i in range(N):
  a = pow(10, n, MOD)
  b = pow(9, n, MOD)
  c = pow(8, n, MOD)
ans = a - (2 * b) + c
if ans < 0:
  ans += MOD
print(ans)

### FIXED CODE ###

N = int(input())
MOD = 10 ** 9 + 7
if N == 1:
  print(0)
  exit()
a = pow(10, N, MOD)
b = pow(9, N, MOD)
c = pow(8, N, MOD)
ans = (a - (2 * b) + c) % MOD
if ans < 0:
  ans += MOD
print(ans)
S = [int(n) for n in input().split()]
    total = sum(S)
    if total >= 22:
      print("bust")
    else:
      print("win")

### FIXED CODE ###

S = [int(n) for n in input().split()]
total = sum(S)
if total >= 22:
    print("bust")
else:
      print("win")
import math
S=input()
hatena = S.count("?")
S_temp = int(S.replace("?","0"))
Q = 10 ** hatena
S_temp_amari =(S_temp-5) %13
temp = math.floor((Q-S_temp_amari)/13)
print(temp%(1000000000+7))


### FIXED CODE ###

import math
S=input()
dp=[0]*13
dp[0]=1
# dp[k] 13で割った余りkのパターン数
mod = 1000000007

for i in range(len(S)):
    nextDp=[0]*13
    if S[i] == "?":
        for j in range(13):
            for k in range(10):
                nextDp[((10*j) + k) % 13] += dp[j]
                nextDp[((10*j) + k) % 13] %= mod
    else:
        k = int(S[i])
        for j in range(13):
            nextDp[((10*j) + k) % 13] += dp[j]
            nextDp[((10*j) + k) % 13] %= mod
    for j in range(13):
        dp[j] = nextDp[j]

print(dp[5])
A,B = map(int, input().split())

outlet = A

if A == B:
    print(1)
    
else:
    count = 1
    while outlet <= B:
        count += 1
        outlet += A-1
        ans = count
        break
    print(ans)

### FIXED CODE ###

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

if A == B:
    anss=1
    print(anss)
    
else:
    count = 0
    outlet = A
    while outlet < B + A -1 :
        count += 1
        outlet += A-1
    print(count)
n, i = map(int, input())
print(n - i + 1)

### FIXED CODE ###

n, i = map(int, input().split())
print(n - i + 1)
str = input()
chars = list(str)
if chars[0] == 7:
  print("Yes")
elif chars[1] == 7:
  print("Yes")
elif chars[2] == 7:
  print("Yes")
else print("No")

### FIXED CODE ###

int = int(input())
st = str(int)
chars = list(st)
if chars[0] == "7":
  print("Yes")
elif chars[1] == "7":
  print("Yes")
elif chars[2] == "7":
  print("Yes")
else:
  print("No")
x,y = map(int,input().split())
p = []
ans = 0
z=x+1

for i in range(x):
    p.append(4)

for i in range(z):
    if sum(p)==y:
        ans = 1
        break
    else:
        p.remove(4)
        p.append(2)

if ans == 1:
    print('Yes')
else:
    if (y==2)&(x==1):
        print('Yes')
    if (y==4)&(x==1):
        print('Yes')
    else :
        print('No')


### FIXED CODE ###

x,y = map(int, input().split())
list = []
ans = 0
for i in range(x) :
    list.append(4)

if sum(list) == y:
    print('Yes')
    ans = 1

else :
    for i in range(x) :
        list.remove(4)
        list.append(2)
        if sum(list) == y:
            print('Yes')
            ans = 1
            break

    if ans == 0:
        print('No')
W,a,b = map(int, input().split())
if (a<=b<=a+W):
    print(0)
elif (a=<b+W<=a+W):
    print(0)
elif a<=b:
    print(b-a-W)
else:
    print(a-b-W)


### FIXED CODE ###

W,a,b = map(int, input().split())
if (a<=b<=a+W):
    print(0)
elif (a<=b+W<=a+W):
    print(0)
elif a<=b:
    print(b-a-W)
else:
    print(a-b-W)
s = input().split()
#print(s)
if s[0] => s[1]:
  print(unsafe)
	else:
      print(safe)
      

### FIXED CODE ###

s = list(map(int, input().split()))
#print(s)
if s[0] <= s[1]:
  print('unsafe')
else:
  print('safe')
n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
diff = [abs((t-x*0.006)-a) for x in listh]
print(diff.index(min(diff)+1))


### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
temp = 100000
index = 0

for i in range(n):
    c = t - listh[i] * 0.006
    diff = abs(c-a)
    if temp > diff:
        temp = diff
        index = i+1

print(index)
class Com:
    def __init__(self, MAX = 10000000, MOD = 1000000000007):
        self.MAX = MAX
        self.MOD = MOD
        self._fac = [0]*MAX
        self._finv = [0]*MAX
        self._inv = [0]*MAX
        self._fac[0], self._fac[1] = 1, 1
        self._finv[0], self._finv[1] = 1, 1
        self._inv[1] = 1
        for i in range(2,self.MAX):
            self._fac[i] = self._fac[i - 1] * i % self.MOD
            self._inv[i] = self.MOD - self._inv[self.MOD%i] * (self.MOD // i) % self.MOD
            self._finv[i] = self._finv[i - 1] * self._inv[i] % self.MOD
    
    def com(self, n, k):
        if (n < k):
            return 0
        if (n < 0 or k < 0):
            return 0
        return self._fac[n] * (self._finv[k] * self._finv[n - k] % self.MOD) % self.MOD
n = int(input())
A = list(map(int,input().split()))
amax = max(A)
com = Com(amax+10)
ans = -1
MAX = -1
for a in A:
    if a == amax:continue
    if com.com(amax,a) > MAX:
        MAX = com.com(amax,a)
        ans = a
print(amax,ans)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
amax = max(A)
AA = sorted(A,key=lambda x: abs(amax/2-x))
if AA[0] == amax:
    print(amax,AA[1])
else:
    print(amax,AA[0])
#import numpy as np
N,M,Q=map(int, input().split())
matrix=[]
for _ in range(Q):
    c=list(map(int, input().split()))
    matrix.append(c)
#matrix = np.array(matrix)
import itertools
ansscore = 0
combi = list(combinations_with_replacement(range(1,M+1),N)
for i in combi:
    i = list(i)
    i.sort()
    score=0
    for l in matrix:
        a=l[0]
        b=l[1]
        c=l[2]
        d=l[3]
        if i[b-1]-i[a-1]==c:
            score+=d
    ansscore = score if score>ansscore else ansscore

print(ansscore)

### FIXED CODE ###

#import numpy as np
N,M,Q=map(int, input().split())
matrix=[]
for _ in range(Q):
    c=list(map(int, input().split()))
    matrix.append(c)
#matrix = np.array(matrix)
import itertools
ansscore = 0
combi = list(itertools.combinations_with_replacement(range(1,M+1),N))
for i in combi:
    i = list(i)
    i.sort()
    score=0
    for l in matrix:
        a=l[0]
        b=l[1]
        c=l[2]
        d=l[3]
        if i[b-1]-i[a-1]==c:
            score+=d
    ansscore = score if score>ansscore else ansscore

print(ansscore)
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

### FIXED CODE ###

n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
    
days=[]
for i in range(k):
    if L[i]==R[k-i-1]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)
a = int(input())
b, c = map(int, input().split())
s= input()
print("{} {}".format(a+b+c, s))

### FIXED CODE ###

a, b = map(int, input().split())
if (a * b) % 2:
    print('Odd')
else:
    print('Even')
n, m = map(int, input().split())
f = []

for i in range(n):
  f.append(list(map(int, input().split())))

num = [0 for i in range(m+1)]
  
for i in range(n):
  for j in range(1, len(f[i])):
    num[f[i][j]] += 1
    
    
cnt = 0
for i in num:
  if i = n:
    cnt += 1
    
    
print(cnt)

### FIXED CODE ###

n, m = map(int, input().split())
f = []

for i in range(n):
  f.append(list(map(int, input().split())))

num = [0 for i in range(m+1)]
  
for i in range(n):
  for j in range(1, len(f[i])):
    num[f[i][j]] += 1
    
    
cnt = 0
for i in num:
  if i == n:
    cnt += 1
    
    
print(cnt)
import sys
sys.setrecursionlimit(10000)
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
x, y = [0] * M, [0] * M
from_x = [[] for _ in range(N)]
memo = [-1] * N
ans = 0

def length(i):
	if memo[i] >= 0:
		return memo[i]
	else:
		if len(from_x[i]) == 0:
			memo[i] = 0
			return memo[i]
		else:
			ret = 0
			
			for j in from_x[i]:
				tmp = length(j) + 1
				if tmp > ret:
					ret = tmp
					
			memo[i] = ret
			return ret

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

for i in range(N):
	tmp = length(i)
	if tmp > ans:
		ans = tmp

print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 5)
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
x, y = [0] * M, [0] * M
from_x = [[] for _ in range(N)]
memo = [-1] * N
ans = 0

def length(i):
	if memo[i] >= 0:
		return memo[i]
	else:
		if len(from_x[i]) == 0:
			memo[i] = 0
			return memo[i]
		else:
			ret = 0
			
			for j in from_x[i]:
				tmp = length(j) + 1
				if tmp > ret:
					ret = tmp
					
			memo[i] = ret
			return ret

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

for i in range(N):
	tmp = length(i)
	if tmp > ans:
		ans = tmp

print(ans)
import math
N = int(input())
Array = [1]*(N+1)
for i in range(1,int(math.sqrt(N))):
  for j in range(i+1,N,i):
    N[j]+=1
ans = 0
for i in range(1,N+1):
  ans+=i*N[i]
print(ans)

### FIXED CODE ###

N=int(input())
ans=0
for i in range(1,N+1):
  m=N//i
  ans+=i*m*(m+1)//2
  #print(i,N//i,m)
print(ans)
aa

### FIXED CODE ###


S, T = input().split()
A, B = map(int, input().split())
U = input()
if S==U:
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))
a,b,c = [int(x) for x in input().sprit()]
print(max([c-(a-b),0]))

### FIXED CODE ###

a,b,c = [int(x) for x in input().split()]
n = c-(a-b)
print(n if n > 0 else 0)
N,M=map(int,input().split())

student=[list(map(int,input().split())) for n in range(N)]

check=[list(map(int,input().split())) for m in range(M)]

for n in range(N):
  man=200000001
  for m in range(M):
    dis=abs(student[n][0]-check[m][0])+abs(student[n][1]-check[m][1])
    point=m+1
    if dis<man:
      man=dis
      ans=point
  print(ans)
  

### FIXED CODE ###

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

student=[list(map(int,input().split())) for n in range(N)]

check=[list(map(int,input().split())) for m in range(M)]

for n in range(N):
  man=400000001
  for m in range(M):
    dis=abs(student[n][0]-check[m][0])+abs(student[n][1]-check[m][1])
    point=m+1
    if dis<man:
      man=dis
      ans=point
  print(ans)
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god + 1
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
if color_max>8:
    print(color_min, "8")
else:
    print(color_min, color_max)

### FIXED CODE ###

r, g, b = map(str, input().split())
if int(r+g+b, 10)%4==0:
    print("YES")
else:
    print("NO")
n, m = map(int, input().split())
dp = [-1]*n
path = [[] for i in range(n)]
X = []; Y = []
for i in range(m):
    x, y = map(int, input().split())
    X.append(x-1); Y.append(y-1)
    path[x-1].append(y-1)

def dfs(i):
    if dp[i]>0: return dp[i]
    res = 0
    for k in path[i]:
        res = max(res, dfs(k)+1)
    dp[i] = res
    return res

ans = 0
for i in range(n):
    ans = max(ans, dfs(i))
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n, m = map(int, input().split())
dp = [-1]*(n+1)
path = [[] for i in range(n)]
X = []; Y = []
for i in range(m):
    x, y = map(int, input().split())
    X.append(x-1); Y.append(y-1)
    path[x-1].append(y-1)

def dfs(i):
    if dp[i]>0: return dp[i]
    res = 0
    for k in path[i]:
        res = max(res, dfs(k)+1)
    dp[i] = res
    return res

ans = 0
for i in range(n):
    ans = max(ans, dfs(i))
print(ans)
n = int(input())
h = list(map(int, input().split()))

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    cnt = 0
  ansers.append(cnt)

print(max(ansers))

### FIXED CODE ###

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

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ansers.append(cnt)
    cnt = 0
else:
  ansers.append(cnt)

print(max(ansers))
n = input()
kakeru = list(map(int, input().split()))
kakekake = kakeru[0]
    for i in range(n-1):
        kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

### FIXED CODE ###

n = int(input())
b = 1
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    for i in range(n):
        b *= a[i]
        if b > 10**18:
            print(-1)
            break
    if b <=10**18:
        print(b)
def gcd(x, y):
    if x < y:
        swap(x, y)
    if y == 0:
        return x
    return gcd(y, x % y)

x, y = [int(i) for i in input().split()]
print(gcd(x, y))


### FIXED CODE ###

def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

x, y = [int(i) for i in input().split()]
if x < y:
    x, y = y, x
print(gcd(x, y))