Harryxun/stf_run huggingface dataset:
n = int(input())
v = list(map(int, input().split()))


first = {}
second = {}

for i in range(n):
    if i % 2 == 0:
        if v[i] in first:
            first[v[i]] += 1
        else:
            first[v[i]] = 1
    else:
        if v[i] in second:
            second[v[i]] += 1
        else:
            second[v[i]] = 1

first = sorted(first.items(), key=lambda x: x[1])
second = sorted(second.items(), key=lambda x: x[1])

f = first.pop()
s = second.pop()

if f[0] == s[0]:
    if len(first) >= 1:
        if len(second) >= 1:
            f2 = first.pop()
            s2 = second.pop()

            if f2[1] > s2[2]:
                f = f2
            else:
                s = s2
        else:
            s = second.pop()
    elif len(second) >= 1:
        f = first.pop()
    else:
        s = (0, 0)

print(n-f[1]-s[1])

### FIXED CODE ###

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

first = {}
second = {}

for i in range(n):
    if i % 2 == 0:
        if v[i] in first:
            first[v[i]] += 1
        else:
            first[v[i]] = 1
    else:
        if v[i] in second:
            second[v[i]] += 1
        else:
            second[v[i]] = 1

first = sorted(first.items(), key=lambda x: x[1])
second = sorted(second.items(), key=lambda x: x[1])

f = first.pop()
s = second.pop()

if f[0] == s[0]:
    if len(first) >= 1:
        if len(second) >= 1:
            f2 = first.pop()
            s2 = second.pop()

            if f2[1] + s[1] > f[1] + s2[1]:
                f = f2
            else:
                s = s2
        else:
            s = second.pop()
    elif len(second) >= 1:
        f = first.pop()
    else:
        s = (0, 0)

print(n-f[1]-s[1])
N, heights = input().split('\n')

N = int(N)
heights = map(int, heights.split(' '))

def solve_problem(N, heights):
    memory = {}

    def minimum_cost(N, heights):
        mem_key = str(N) + str(heights)
        if mem_key in memory: return memory[mem_key]
        if N == 1:
            return 0
        elif N == 2:
            return abs(heights[0] - heights[1])

        jump_one_cost = abs(heights[0] - heights[1]) + minimum_cost(N-1, heights[1:])
        jump_two_cost = abs(heights[0] - heights[2]) + minimum_cost(N-2, heights[2:])

        best_cost = min(jump_one_cost, jump_two_cost)
        memory[mem_key] = best_cost
        return best_cost
    
    return minimum_cost(N, heights)

print(solve_problem(test3_N, test3_heights))

### FIXED CODE ###

N = input() 
heights = input()

N = int(N)
heights = list(map(int, heights.split(' ')))

def solve_problem_dp(N, heights):
    if N == 1:
        return 0
    elif N == 2:
        return abs(heights[0] - heights[1])
    costs = [0] * len(heights)
    costs[1] = abs(heights[0] - heights[1])

    for i in range(2, len(heights)):
        cost_jump1 = abs(heights[i] - heights[i-1]) + costs[i-1]
        cost_jump2 = abs(heights[i] - heights[i-2]) + costs[i-2] 
        best_cost = min(cost_jump1, cost_jump2)
        costs[i] = best_cost
    
    return costs[-1]


print(solve_problem_dp(N, heights))
n = int(raw_input())
 
p1_x = float(0)
p1_y = float(0)
p2_x = float(100)
p2_y = float(0)
 
def KC(i, n, x1, y1, x2, y2):
    v = [0]*5
    w = [0]*5
    if i < n:
        v[0] = x1
        w[0] = y1
        v[1] = (2*x1+x2)/3.0
        w[1] = (2*y1+y2)/3.0
        v[2] = (x1+2*x2)/3.0
        w[2] = (y1+2*y2)/3.0
        v[3] = (v[2] - v[1])*math.cos(math.pi/3) - (w[2] - w[1])*math.sin(math.pi/3) + v[1]
        w[3] = (w[2] - w[1])*math.cos(math.pi/3) + (v[2] - v[1])*math.sin(math.pi/3) + w[1]
        v[3] = x2
        w[3] = y2
        KC(i+1, n, v[0], w[0], v[1], w[1])
        print v[1], w[1]
        KC(i+1, n, v[1], w[1], v[3], w[3])
        print v[3], w[3]
        KC(i+1, n, v[3], w[3], v[2], w[2])
        print v[2], w[2]
        KC(i+1, n, v[2], w[2], v[4], w[4])
 
print p1_x, p1_y
KC(0, n, p1_x, p1_y, p2_x, p2_y)
print p2_x, p2_y

### FIXED CODE ###

import math
n = int(raw_input())
 
p1_x = float(0)
p1_y = float(0)
p2_x = float(100)
p2_y = float(0)
 
def KC(i, n, x1, y1, x2, y2):
    v = [0] * 5
    w = [0] * 5
    if i < n:
        v[0] = x1
        w[0] = y1
        v[1] = (2 * x1 + x2) / 3.0
        w[1] = (2 * y1 + y2) / 3.0
        v[2] = (x1 + 2 * x2) / 3.0
        w[2] = (y1 + 2 * y2) / 3.0
        v[3] = (v[2] - v[1]) * math.cos(math.pi/3) - (w[2] - w[1]) * math.sin(math.pi/3) + v[1]
        w[3] = (w[2] - w[1]) * math.cos(math.pi/3) + (v[2] - v[1]) * math.sin(math.pi/3) + w[1]
        v[4] = x2
        w[4] = y2
        KC(i+1, n, v[0], w[0], v[1], w[1])
        print v[1], w[1]
        KC(i+1, n, v[1], w[1], v[3], w[3])
        print v[3], w[3]
        KC(i+1, n, v[3], w[3], v[2], w[2])
        print v[2], w[2]
        KC(i+1, n, v[2], w[2], v[4], w[4])
 
print p1_x, p1_y
KC(0, n, p1_x, p1_y, p2_x, p2_y)
print p2_x, p2_y
x, n = list(map(int, input().split()))
if n == 0:
    print(x)
    exit()
p_list = list(map(int, input().split()))

idx = p_list.index(x)

i = 0
while True:
    x_i = x - i
    x_j = x + i

    if x_i not in p_list:
        print(x_i)
        exit()
    if x_j not in p_list:
        print(x_j)
        exit()

    i += 1


### FIXED CODE ###

x, n = list(map(int, input().split()))
p_list = list(map(int, input().split()))
if n == 0:
    print(x)
    exit()

i = 0
while True:
    x_i = x - i
    x_j = x + i

    if x_i not in p_list:
        print(x_i)
        exit()
    if x_j not in p_list:
        print(x_j)
        exit()

    i += 1
n = int(input())
a = list(map(int,input().strip().split()))
p = 1
j = 10**18
for i in range(n):
	p = p * a[i]
    if p > j:
      print(-1)
      break
    elif i = n-1:
      ptint(p)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
i = 0
p = 1

if 0 in a:
    print("0")
else:
    while i < n:
        p *= a[i]
        if p > 10**18:
            break
        i += 1
    if p <= 10**18:
        print(p)
    else:
        print("-1")
s = str(input())
n = int(input())
k = ord("z")
a = [0]*len(s)
for i in range(len(s)):
    a[i] = ord(s[i])
for i in range(len(s)):
    if n>=k+1-a[i]:
        n = n - (k+1-a[i])
        a[i] = ord("a")
    
    if n<=0:
        break
if n>0:
    a[-1] += n
ans = ""
for i in range(len(s)):
    ans += chr(a[i])
print(ans)


### FIXED CODE ###

s = str(input())
n = int(input())
k = ord("z")
a = [0]*len(s)
for i in range(len(s)):
    a[i] = ord(s[i])
for i in range(len(s)):
    if a[i] == ord("a"):
        continue
    if n>=k+1-a[i]:
        n = n-k-1+a[i]
        a[i] = ord("a")
    
    if n<=0:
        break
if n>0:
    a[-1] += n%26
ans = ""
for i in range(len(s)):
    ans += chr(a[i])
print(ans)
S = input()

S = [s for s in S]

ans = 0
while len(S) > 0:
    counter = 0
    for ix in range(len(S)):
        if ix+1 < len(S):
            if S[ix] != S[ix+1]:
                del S[ix]
                del S[ix]
                ans += 1
                counter += 1
                break

            if S[ix] == S[ix+1] and S[ix+1] == S[ix+2]:
                del S[ix+1]
    if counter == 0:
        break

print(ans*2)

### FIXED CODE ###


S = input()

S = [s for s in S]
S = [int(s, 0) for s in S]
S.sort()
if 1 in S and  0 in S:
    print(min(S.count(0)*2,S.count(1)*2))
else:
    print(0)
a,b,c = map(int,raw_input().split())
print(min(a+b,b+c,a+c))

### FIXED CODE ###

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

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)
sum = 0
while 1:
   x, y =map(int, raw_input().split())
   sum = sum + 1
   a = max(x, y)
   b = min(x, y)
   if x == y == '0':
      break
   print '%s %s' %(b, a)

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

a = 0
for i in range(0,n):
    for j in range(1,n-i):
        c = abs(x[i] - x[i + j]) + abs(y[i] - y[i + j])
        print(c)
        if a >= c:
            a = a
        else:
            a = c
print(a)

    

### FIXED CODE ###

n = int(input())
if n == 0:
    print("1")
else:
    print("0")
import math
N = int(input())
neck = int(input())
for i in range(N-1):
  neck = min(neck, int(input()))
res = math.ceil(N/neck)
print(res)


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
  print('Yay!')
else:
  print(':(')
from functools import reduce
from math import log
n, m = map(int, input().split())
f1 = lambda x, y: 1 << x | 1 << y
f2 = lambda x, y: x & y
lst = []
for i in range(n):
  tmplst = [int(i) for i in input().split()]
  tmp = reduce(f1, tmplst[1:])
  lst.append(tmp)
ret = reduce(f2, lst)
if ret:
  print(int(log(ret, 2)))
else:
  print(0)
  

### FIXED CODE ###

n, m = map(int, input().split())
lst = []
for i in range(n):
  tmplst = [int(i) for i in input().split()]
  tmp = 0
  for item in tmplst[1:]:
    tmp |= 1 << item
  lst.append(tmp)
ret = lst[0]
for item in lst[1:]:
  ret &= item
if ret:
  s = sum(map(int, bin(ret)[2:]))
  print(s)
else:
  print(0)
import sys
import os
f = open('input.txt', 'r')
sys.stdin = f

tap,out = map(int,input().split())

count = 1

while(1):
    if(out>tap):
        out = out - (tap-1)
        count += 1
    else:
        break
print(count)


### FIXED CODE ###

a,b = map(int,input().split())
m = 1
cnt = 0
while m < b:
    m -= 1
    m += a
    cnt += 1
print(cnt)
H,W = map(int,input().split())
tmp = True
A = []
B = []
for i in range(H):
    a = list(input())
    if a != ['.']*W:
        A.appned(a)
for i in range(W):
    cnt = 0
    for j in range(len(A)):
        if A[j][i] != '.':
            cnt += 1
    if cnt == 0:
        B.insert(0,i)
for i in range(len(A)):
    for j in range(len(B)):
        del A[i][B[j]]
for i in range(len(A)):
    ans = "".join(A[i])
    print(ans)



### FIXED CODE ###

H,W = map(int,input().split())
A = []
B = []
for i in range(H):
    a = list(input())
    if a != ["."]*W:
        A.append(a)
for i in range(W):
    cnt = 0
    for j in range(len(A)):
        if A[j][i] != '.':
            cnt += 1
    if cnt == 0:
        B.insert(0,i)
for i in range(len(A)):
    for j in range(len(B)):
        del A[i][B[j]]
for i in range(len(A)):
    ans = "".join(A[i])
    print(ans)
import itertools
import collections
n=int(input())
s=[list(map(int, input().split())) for i in range(n)]
ans=[]
x=list(itertools.permutations(s))

v=[]
r=[]
count=0
for i in range(len(x)):
    e=[]
    v=[]
    for j in range(n-1):
        a=x[i][j][0]
        b=x[i][j+1][0]
        c=x[i][j][1]
        d=x[i][j+1][1]
        v.append(b-a)
        v.append(d-c) 
    q=[v[i:i+2] for i in range(0,len(v),2)]
    for i in range(len(q)):
        e.append(q.count(q[i]))
    r.append(max(e))
    
print(n-max(r))

### FIXED CODE ###

n=int(input())
s=[list(map(int, input().split()))  for i in range(n)]
x=[]
if n==1:
    print(1)
    exit(0)

for i in range(n):
    for j in range(n):
        if i==j:
            continue
        t=(s[i][0]-s[j][0],s[i][1]-s[j][1])
        x.append(t)
        
ans = [x.count(x[i]) for i in range(len(x))]
print(n-max(ans))
a, b = input().split()
print('H' if (a == 'H') ^ (b == 'D') else 'D')

### FIXED CODE ###

a, b, c = map(int, input().split())
if b - a == c - b:
    print("YES")
else:
    print("NO")
import numpy as np
# Calculate intensity
N, K = [int(v) for v in input().split(" ")]
A_arr = [int(v) for v in input().split(" ")]
start = time.time()
step = np.arange(len(A_arr))
def Luminate(A_arr, i):
  isLuminated = np.abs(step - i) < np.array(A_arr)+1
  return isLuminated
def get_Intensity(A_arr):
  return [np.sum(Luminate(A_arr, i)) for i in range(len(A_arr))]
Intensity = A_arr
for i in range(K):
  Intensity = get_Intensity(Intensity)

print(" ".join([str(v) for v in Intensity]))


### FIXED CODE ###

import numpy as np
 
N, K = map(int, input().split(' '))
A = tuple(map(int, input().split(' ')))
indexes = np.arange(0, N)
 
dp = np.zeros(shape=N + 1, dtype=np.int64)
 
for k in range(K):
    np.add.at(dp, np.maximum(0, indexes - A), 1)
    np.add.at(dp, np.minimum(N, indexes + A + 1), -1)
    A = dp.cumsum()[:-1]
    if np.all(A == N):
        break
    dp *= 0
 
print(' '.join(map(str, A)))
n = input()

if n[1] in [2, 4, 5, 7, 9]:
    print("hon")
elif n[1] in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")


### FIXED CODE ###

# Nの1の位が
# 2,4,5,7,9のときhonNの1の位が0,1,6,8のときponNの1の位が3のときbonです。

a = int(input()) % 10
print('pphbhhphph'[a] + "on")
import math as mt 
A,B=map(int,input().split())
print(int(A*B/mt.gcd(A,B)))

### FIXED CODE ###

import fractions
A,B=map(int,input().split())
print(int(A*B/fractions.gcd(A,B)))
N, K = map(int, input().split)
h = map(int, input().split())
for hantei in h:
    if K > hantei:
        N -= 1
    else:
        pass
print(str.N)
        

### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
for hantei in h:
    if K > hantei:
        N -= 1
    else:
        pass
print(N)
n = int(input())
A = list(map(int, input().split()))

C = Counter(A)
C = [[k, v] for k, v in C.items() if v >= 2]
C.sort(key=lambda x:x[0], reverse=True)

ans = 0
if len(C) >= 1:
    if C[0][1] >= 4:
        ans = C[0][0] * C[0][0]
    elif len(C) >= 2:
        ans = C[0][0] * C[1][0]

print(ans)

### FIXED CODE ###

from collections import Counter

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

C = Counter(A)
C = [[k, v] for k, v in C.items() if v >= 2]
C.sort(key=lambda x:x[0], reverse=True)

ans = 0
if len(C) >= 1:
    if C[0][1] >= 4:
        ans = C[0][0] * C[0][0]
    elif len(C) >= 2:
        ans = C[0][0] * C[1][0]

print(ans)
N = int(input())
A = input().split()
print(max(A)-min(A))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
print(max(A)-min(A))
s=input()
count=0
for i for range(3):
  if s[i]=='1':
    count+=1
print(count)

### FIXED CODE ###

s=input()
count=0
for i in range(3):
  if s[i]=='1':
    count+=1
print(count)
list=[int(i) for i in input().split()]

if list[0]>list[1]:
    a=list[0]
    b=list[1]
else:
    b=list[0]
    a=list[1]    


if a%b==0:
    print (b)
else:
    while b>0:
        c=a%b
        a=b
        b=c
        

    print(a)



### FIXED CODE ###

list=[int(i) for i in input().split()]

if list[0]>list[1]:
    a=list[0]
    b=list[1]
else:
    b=list[0]
    a=list[1]    


if a%b==0:
    print(b)
else:
    while b>0:
        c=a%b
        a=b
        b=c
    print(a)
A = int(input())
B = int(input())

rist = [ A+B , A-B , A*B]

print(max(rist))

### FIXED CODE ###

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

rist = [ A+B , A-B , A*B]

print(max(rist))
from collections import defaultdict

def foo():
	H, W = map(int, input().split())
	s = ""
	for _ in range(H):
		s += input()

	counter = defaultdict(int)
	for c in s:
		counter[c] += 1

	x1, x2 = H // 2, H % 2
	y1, y2 = W // 2, W % 2

	n = x1 * y1
	k = 0
	for c in counter:
		if k == n:
			break
		if counter[c] >= 4:
			k += 1
			counter[c] -= 4

	if k != n:
		print("No")
		return

	if x2 == 1:
		n = y1
		k = 0
		for c in counter:
			if k == n:
				break
			if counter[c] >= 2:
				k += 1
				counter[c] -= 2
		if k != n:
			print("No")
			return
	if y2 == 1:
		n = x1
		k = 0
		for c in counter:
			if k == n:
				break
			if counter[c] >= 2:
				k += 1
				counter[c] -= 2
		if k != n:
			print("No")
			return
	print("Yes")

foo()



### FIXED CODE ###

S = input()
if len(S) < 4:
    print("No")
elif S[0:4] == "YAKI":
    print("Yes")
else:
    print("No")
A,B,T=(int,input().split())
int a =T//A
for i in range(a):
 int b=1
 int s = a-b
 if sum >0:
   number++
 b++
print(number*B)

  

### FIXED CODE ###

A,B,T = map(int,input().split())
a =T//A
number = 0
for i in range(a):
  b=1
  s = a-b
  if s >=0:
    number+=1
  b+=1
print(number*B)
N=int(input())
a=input().split()

while len(a) !=0:
  alice+=max(a)
  a.remove(max(a))
  bob+==max(a)
  a.remove(max(a))
print(alice-bob)

### FIXED CODE ###

N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)
import sys
re = range(int(raw_input()))
for li in sys.stdin:
    [a,b] = [int(x) for x in li.split(",")]
    tmp = re[a-1]
    re[a-1] = re[b-1]
    re[b-1] = tmp
for i in re:
    print i+1

### FIXED CODE ###

import sys
l = range(input())
n = input()
for line in sys.stdin:
    [a,b] = [int(x) for x in line.split(',')]
    tmp = l[a-1]
    l[a-1] = l[b-1]
    l[b-1] = tmp
for i in l:
    print i+1
M,D = map(int, input().split())
if M < 4 or D < 22:
    print(0)
else:
    result=0
    for m in range(4,M+1):
        for d in range(22,D+1):
            if str(d)[0] >= 2 and str(d)[1] >= 2 and int(str(d)[0])*int(str(d)[1])==m:
                result += 1
    print(result)

### FIXED CODE ###

M,D = map(int, input().split())
if M < 4 or D < 22:
    print(0)
else:
    result=0
    for m in range(4,M+1):
        for d in range(22,D+1):
            if int(str(d)[0]) >= 2 and int(str(d)[1]) >= 2 and int(str(d)[0])*int(str(d)[1])==m:
                result += 1
    print(result)
n = int(input())
h = list(map(int,input().split()))

ans = 'Yes'
for i in range(n-1):
  diff = h[i+1]-h[i]
  if diff <= -1:
    if flag:
      ans='No'
      break        
    
    if diff <= -2:
      ans = 'No'
      break
        
    flag = True          
    
  else:
    if diff >= 1:
      flag = False

print(ans)      

### FIXED CODE ###

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

ans = 'Yes'
flag = False
for i in range(n-1):
  diff = h[i+1]-h[i]
  if diff <= -1:
    if flag:
      ans='No'
      break        
    
    if diff <= -2:
      ans = 'No'
      break
        
    flag = True          
    
  else:
    if diff >= 1:
      flag = False

print(ans)
k, n = map(int, input().split())
a = list(map(int, input().split())
b = []
for i in range(N):
    d = int(a[i+1]-a[i])
    b.append(int(d))

b.append(K - a[N-1] + a[0])

ans = K - max(b)

print(ans)

### FIXED CODE ###

k, n = map(int, input().split())
a = list(map(int, input().split()))
a2 = []
for i in range(n-1):
    d = int(a[i+1]-a[i])
    a2.append(d)
a2.append(k-a[n-1]+a[0])
ans = k - max(a2)
print(ans)
N = int(intput())
W = list(map(int, input().split()))

minimum = 100000000000000000
for i in range(len(W)):
  abs_value = abs(sum(W[:i]) - sum(W[i:]))
  if abs_value < minimum:
    	minimum = abs_value
print(abs_value)

### FIXED CODE ###

N = int(input())
W = list(map(int, input().split()))
 
minimum = 100000000000000000
for i in range(len(W)):
  abs_value = abs(sum(W[:i]) - sum(W[i:]))
  if abs_value < minimum:
    	minimum = abs_value
print(minimum)
import math
n=int(input())
count=0
for a in range(math.floor(n/4)+1):
    if (n-a*4)%7==0:
        count+=1
print(count)


### FIXED CODE ###

n,k=map(int,input().split())
if n%k:
    print(1)
else:
    print(0)
S=input()

if S = 'SUN':
    print(7)
else if S == 'MON':
    print(1)
else if S == 'TUE':
    print(2)
else if S == 'WED':
    print(3)
else if S == 'THS':
    print(4)
else if S == 'FRI':
    print(5)
else if S == 'SAT':
    print(6)


### FIXED CODE ###

S=input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
N, M = map(int,input().split())
tree = {}

for i in range(M):
    a, b, c = map(int, input().split())
    v= tree.get(a,[])
    v.append([b, c])
    tree[a] = v

def has_loop(tree):
    pass

m = []
def cost(v, c, visited):
    if v in visited:
        m.append(c)
        if max(m) <= 0:
            print(max(m))
        else:
            print('inf')
        exit()
    b = tree.get(v, None)
    if b is None:
        return 
    elif len(b) == 1 and tree.get(b[0][0],None) == None:
        j = c+b[0][1]
        m.append(j)
    else:
        for b, c2 in b: 
            cost(b, c+c2, visited + [v])

if has_loop(tree):
    print('inf')
    exit()

cost(1, 0, [])
print(max(m))

### FIXED CODE ###

N, M = map(int,input().split())
dist = [0] + [float('inf')] * (N - 1)

a = []
b = []
c = []

for i in range(M):
    i,j,k = map(int,input().split())
    a.append(i)
    b.append(j)
    c.append(-1*k)

INF = float('inf')

for i in range(N-1):
    for j in range(M):
        if dist[a[j] - 1] == INF: continue
        if dist[b[j] - 1] > dist[a[j] - 1] + c[j]:
            dist[b[j] - 1] = dist[a[j] - 1] + c[j]
        
ans = dist[N -1]

negative = [False] * N

for i in range(N):
    for j in range(M):
        if dist[a[j] - 1] == INF: continue
        if dist[b[j] - 1] > dist[a[j] - 1] + c[j]:
            dist[b[j] - 1] = dist[a[j] - 1] + c[j]
            negative[b[j] - 1] = True

        if negative[a[j] - 1] == True:
            negative[b[j] - 1] = True

if negative[N - 1]:
    print('inf')
else:
    print(-1 * ans)
N = int(input())
A = [int(i) for i in input().split()]
ans = reduce(mul, A)
print(ans if ans <= 10**18 else -1)

### FIXED CODE ###

N = int(input())
A = sorted([int(i) for i in input().split()])
ans = 1
for a in A:
    if a == 0:
        ans = 0
        break
    ans *= a
    if ans > 10**18:
        ans = -1
        break
print(ans)
n,k = map(int,input().split())
X = list(map(int,input().split()))
from bisect import bisect_left as bl
zero = bl(X,0)
ans = 0

temp = []
for i in range(max(zero,k-1),min(zero+k,n)):
    
    if X[i-k+1] >= 0:
        temp.append(X[i])
    elif X[i] <= 0:
        temp.append(abs(X[i-k+1]))
    else:
        temp.append(min(abs(X[i]),abs(X[i-k+1]))*2+max(abs(X[i]),abs(X[i-k+1])))
print(min(temp))

### FIXED CODE ###

n,k = map(int,input().split())
X = list(map(int,input().split()))
from bisect import bisect_left as bl
zero = bl(X,0)

temp = []
for i in range(max(zero,k-1),min(zero+k,n)):
    if X[i-k+1] >= 0:
        temp.append(X[i])
    elif X[i] <= 0:
        temp.append(abs(X[i-k+1]))
    else:
        temp.append(min(abs(X[i]),abs(X[i-k+1]))*2+max(abs(X[i]),abs(X[i-k+1])))
try:
        print(min(temp))
except:
        print(abs(X[-k]))
H, N = map(int,input().split())
A = list(map(int,input().split())
T = 0
for i in range(N):
  T += A[i]
if H - T <=0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

H, N = map(int,input().split())
A = list(map(int,input().split()))
T = 0
for i in range(N):
  T += A[i]
if H-T <=0:
  print('Yes')
else:
  print('No')
x=list(input().split())
x1=int(x[0])
y1=int(x[1])
x2=int(x[2])
if (x2-x1)==(x3-x2):
  print('YES')
else:
  print('NO')

### FIXED CODE ###

x=list(input().split())
x1=int(x[0])
x2=int(x[1])
x3=int(x[2])
if (x2-x1)==(x3-x2):
  print('YES')
else:
  print('NO')
a=int(input())
b=input()
for 
for i in range(a-2):
	if b[i:i] == "A":
		if b[i+1:i+1] == "B":
			if b[i+2:i+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)


### FIXED CODE ###

a=int(input())
b=input()
sum=0
for i in range(a-2):
	if b[i:i+1] == "A":
		if b[i+1:i+2] == "B":
			if b[i+2:i+3] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)
import fractions
N, M = map(int, input().split())
S = input()
T = input()

def lcm(x, y):
    return (x*y)//(fractions.gcd(x, y))

len_x = lcm(N, M)
n = [""]*(len_x)    
m = [""]*(len_x)

for i in range(len(S)):
    n[(len_x//N)*i] = S[i]
    
for i in range(len(T)):    
    m[(len_x//M)*i] = T[i]
for i in range(len_x):
    if(n[i] == "" or m[i] == ""):
        continue     
    if(n[i] != m[i]):
        print(-1)
else:
    print(len_x)

### FIXED CODE ###

import fractions
N, M = map(int, input().split())
S = input()
T = input()

def lcm(x, y):
    return (x*y)//(fractions.gcd(x, y))

L = lcm(N, M)
num = lcm(L//N, L//M)

n = (N-1)*(L//N)+1
m = (M-1)*(L//M)+1

if(max(n, m) < num):
    if(S[0] == T[0]):
        print(L)
    else:
        print(-1)
else:
    if(N > M):
        tmp = M//(L//N)
    else:
        tmp = N//(L//M)
    for i in range(tmp):
        if(S[i*L//M] != T[i*L//N]):
            print(-1)
            break
    else:
        print(L)
A, B, K = [int(x) for x in input().split()]
print(*[max(0, A - k),max(0, B - k)])

### FIXED CODE ###

# B - Greedy Takahashi

A, B, K = [int(x) for x in input().split()]
AB = A + B
if A > K:
    print(A - K, B)
elif AB > K:
    print(0, AB - K)
else:
    print(0, 0)