Harryxun/stf_run huggingface dataset:
def merge(A, left, mid, right):
    global count
    L = A[left:mid]
    R = A[mid:right]
    R.append[1000000001]
    L.append[1000000001]

    i = j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
    count += right - left


def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
merge_sort(A, 0, N)
print(*A)
print(count)











def merge(A, left, mid, right):
    global count
    L = A[left:mid] + [1000000001]
    R = A[mid:right] + [1000000001]
    i = j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
    count += right - left


def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
def merge(A, left, mid, right):
    global count
    L = A[left:mid]
    R = A[mid:right]
    R.append[1000000001]
    L.append[1000000001]
    
    i = j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
    count += right - left

def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
merge_sort(A, 0, N)
print(*A)
print(count)

### FIXED CODE ###

def merge(A, left, mid, right):
    global count
    L = A[left:mid] + [1000000001]
    R = A[mid:right] + [1000000001]
    i = j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
    count += right - left


def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
merge_sort(A, 0, N)
print(*A)
print(count)
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())

x = [0]*n
y = [0]*n
for i in range(n):
    xx,yy= map(int, input().split())
    x[i] = xx-1
    y[i] = yy-1

from collections import defaultdict
d = defaultdict(lambda:0)

for i in range(n):
    for j in range(n):
        if i==j:continue

        p = x[j]-x[i]
        q = y[j]-y[i]

        d[p*10**9+q] +=1

dv = d.values()
mad =max(dv)

print(n-mad)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())

x = [0]*n
y = [0]*n
for i in range(n):
    xx,yy= map(int, input().split())
    x[i] = xx-1
    y[i] = yy-1

if n==1:
    print(1)
    exit()

from collections import defaultdict
d = defaultdict(lambda:0)

for i in range(n):
    for j in range(n):
        if i==j:continue

        p = x[j]-x[i]
        q = y[j]-y[i]

        d[p*10**9+q] +=1

dv = d.values()
mad =max(dv)

print(n-mad)
for i in range(K-1):
  x = q.get()
  if x%10 != 0:
    q.put(10*x + (x%10 -1) )
  q.put(10*x+x%10)
  if x%10 != 9:
    q.put(10*x + (x %10 + 1) )
print(q.get())

### FIXED CODE ###

import queue
K = int(input())
q = queue.Queue()
for i in range(1,10):
  q.put(i)
    
    
for i in range(K-1):
  x = q.get()
  if x%10 != 0:
    q.put(10*x + (x%10 -1) )
  q.put(10*x+x%10)
  if x%10 != 9:
    q.put(10*x + (x %10 + 1) )
print(q.get())
import sys

n,m = input().split()
n,m = int(n), int(m)

l, r = [],[]

count = 0

for i in range(1,m) :
    l[i], r[i] = input().split()
    l[i], r[i]  = int(l[i]), int( r[i] )

    if l[i] <= m and m <= r[i] :
        count = count + m - l[i] 


### FIXED CODE ###

import sys

n,m = input().split()
n,m = int(n), int(m)


list = []

count = 0
lMin, rMax = -1, -1

for i in range(0,m) :
    l, r = input().split()

    list.append((int(l),int(r)))

    if lMin == -1 and rMax == -1:
        lMin, rMax = list[i]
    else:
        if lMin < list[i][0] :
            lMin = list[i][0]
            
        if rMax > list[i][1] :
            rMax = list[i][1]

count = rMax - lMin +1

if count < 0 : 
    count = 0

print(count)
N, M = map(int, input().split())
g = [list() for _ in range(M + 1)]
for _ in range(M):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)

ans = 0
def walk(cur, visited):
    global ans
    tmp = visited + [cur]
    if len(tmp) == N:
        ans += 1
    for nex in g[cur]:
        if nex not in tmp:
            walk(nex, visited + [cur])
walk(1, [])
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
g = [[]for _ in range(n + 1)]
for _ in range(m):
    a, b = map(int, input().split())
    g[a].append(b) 
    g[b].append(a)

ret = 0
def walk(node, visited):
    global ret
    tmp = visited + [node]
    if len(tmp) == n:
        ret += 1 
    for nd in g[node]:
        if nd not in tmp:
            walk(nd, tmp)
walk(1, [])
print(ret)
# Author: cr4zjh0bp
# Created: Sun Mar  8 11:28:28 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

s = ns()
n = len(s)
cnt = True
i = 0
flag = True
while i < n:
    if s[i] != 'h' or s[i + 1] != 'i':
        flag = False
        break
    i += 2

if flag:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

# Author: cr4zjh0bp
# Created: Sun Mar  8 12:16:38 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

s = ns()
n = len(s)
if n % 2 == 1:
    print("No")
else:
    i = 0
    cnt = 0
    while i < n - 1:
        if s[i] == 'h' and s[i + 1] == 'i':
            cnt += 2
        i += 2
    if cnt == n:
        print("Yes")
    else:
        print("No")
N, K = map(int, input().split())
cnt = 0
while True:
  cnt += 1
  N = N//K
  if N != 0:
print(cnt) 

### FIXED CODE ###

N, K = map(int, input().split())
cnt = 0
while True:
  cnt += 1
  N = N//K
  if N == 0:
    break
print(cnt)
abcd=int(input().split())
a=abcd[0]
b=abcd[1]
c=abcd[2]
d=abcd[3]
if a+b=c+d:
  print('balanced')
  else:
    if a+b>c+d:
      print('Left')
      else:
        print('Right')
        

### FIXED CODE ###

abcd=input().split()
a=int(abcd[0])
b=int(abcd[1])
c=int(abcd[2])
d=int(abcd[3])
if a+b==c+d:
  print('Balanced')
else:
    if a+b>c+d:
      print('Left')
    else:
        print('Right')
import collections
H,W,M=map(int,input().split())
h=[None]*M
w=[None]*M
for i in range(M):
    h[i],w[i]=map(int,input().split())
c1=collections.Counter(h)
c2=collections.Counter(w)
for x in range(M):
    flag=True
    if h[x]==c1.most_common()[i][0] and w[x]==c2.most_common()[j][0]:
        print(c1.most_common()[i][1]+c2.most_common()[j][1]-1)
        exit()
print(c1.most_common()[i][1]+c2.most_common()[j][1])

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
H, W, M = map(int, readline().split())
bomb = [tuple(map(lambda x: int(x) - 1, s.split())) for s in readlines()]
X = [0] * H 
Y = [0] * W 
for h, w in bomb:
    X[h] += 1
    Y[w] += 1
maxX = max(X)
maxY = max(Y)

R = [h for h, x in enumerate(X) if x == maxX]  
C = [w for w, y in enumerate(Y) if y == maxY] 

bomb = set(bomb)
for r in R:
    for c in C:
        if (r, c) not in bomb:
            print(maxX + maxY)
            exit()
print(maxX + maxY - 1)
nums = int(input())

S = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}

for i in nums:
  input_str = input()
  if input_str in S:
    S[input_str] += 1
    
print('AC x %d' % S['AC'])
print('WA x %d' % S['WA'])
print('TLE x %d' % S['TLE'])
print('RE x %d' % S['RE'])


### FIXED CODE ###

nums = int(input())

S = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for i in range(0, nums):
    input_str = input()
    if input_str in S:
        S[input_str] += 1

print('AC x %d' % S['AC'])
print('WA x %d' % S['WA'])
print('TLE x %d' % S['TLE'])
print('RE x %d' % S['RE'])
n = int(input())
a = list(map(int, input().split()))

ans = 1

for i in range(n):
    ans *= a[i]
    if ans = 0:
        print(0)
        exit()
    elif ans > 10**18:
        print(-1)
        exit()

print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
def fizzbuzz(n):
	if n%15==0: return "FizzBuzz"
	if n%5==0: return "Buzz"
	if n%3==0: return "Fizz"
	return str(n)

while 1:
	m,n=map(int,raw_input().split())
	if m==0:break
	player=range(1,m+1)
	for i in range(n):
		if len(player)==1:
			break
		if fizzbuzz(i+1)!=raw_input():
			del player[(i-(m-len(player)))%len(player)]
	print " ".join(map(str,player))

### FIXED CODE ###

def fizzbuzz(n):
	if n%15==0: return "FizzBuzz"
	if n%3==0: return "Fizz"
	if n%5==0: return "Buzz"
	return str(n)
while 1:
	try:
		m,n=map(int,raw_input().split())
		if m==0:break
		player=range(1,m+1)
		p=0
		for i in range(n):
			if fizzbuzz(i+1)!=raw_input():
				del player[p]
				m=len(player)
				if m==1:
					break
				p%=m
			else:
				p=(p+1)%m
		print " ".join(map(str,player))
	except:
		pass
import math
N,K = map(int,input().split())
blue = K
red = N-K
def combinations(n, r):
  if n == r:
    return 1
  else:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,K+1):
  ans = (combinations(red+1, i)*combinations(K-1, i-1))%(10**9+7)
  print(ans)


### FIXED CODE ###

import math
N,K = map(int,input().split())
blue = K
red = N-K
def combinations(n, r):
  if n == r:
    return 1
  else:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,K+1):
  if i > N-K+1:
    print(0)
  else:
    ans = (combinations(red+1, i)*combinations(K-1, i-1))%(10**9+7)
    print(ans)
K = str(input)
S = input()
if len(S)<=K:
    print(S)
else:
    print(S[:K]+'...')

### FIXED CODE ###

K = int(input())
S = input()
if len(S)<=K:
    print(S)
else:
    print(S[:K]+'...')
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

t = 0
for i in B:
  t = t + i
y = []
for x in ramnge(len(A)):
  if A[x] + 1 == A[x+1]:
    y.append(x)

z = 0
for k in range(len(y)):
  t = t + y[k]
print(t)
    
  

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
 
t = 0
for i in B:
  t = t + i
  
y = []
for x in range(len(A)-1):
  if A[x] + 1 == A[x+1]:
    y.append(A[x]-1)
  else:
    pass
for k in y:
  t = t + C[k]
print(t)
S =input()
if S = "ABC":
  print("ARC")
else:
  print("ABC")


### FIXED CODE ###

s=input()

if s.find('B')==1:
  print('ARC')
else:
  print('ABC')
s=input()
k=int(input())

import re
def nchars(s, n):
    """文字列 s に、同じ文字が n 個以上連続している部分文字列を見つける
    """

    assert n > 0
    reg = re.compile("(.)\\1{%d,}" % (n - 1))  # カンマを取ると n 個ちょうどになる
    while True:
        m = reg.search(s)
        if not m:
            break
        yield m.group(0)
        s = s[m.end():]
        
if len(s)==1:
	print(k//2)
elif len(s)==2:
	if len(set(s))==1:
		print(k)
	else:
		print(0)
elif len(s)==3:
	if len(set(s))==1:
		print(3*k//2)
	elif len(set(s))==2:
		print(k)
else:
    if s[0]!=s[-1]:
        a=list(nchars(s, 2))
        b=0
        for i in a:
            b+=len(i)//2
        print(b*k)
    else:
        if s[0]!=s[1] and s[-1]!=s[-2]:
            a=list(nchars(s, 2))
            b=0
            for i in a:
                b+=len(i)//2
            print(b*k+k-1)
        else:
            a=list(nchars(s, 2))
            b=0
            c=list(nchars(s+s, 2))
            l1_l2_sym_diff = set(a) ^ set(c)
            if len(l1_l2_sym_diff)%2==1 and (s[0]!=s[1] or s[-1]!=s[-2]):
				for i in a:
                    b+=len(i)//2
                print(b*k)
            else:
                for i in a:
                    b+=len(i)//2
                print(b*k+k-1)    

### FIXED CODE ###

s=input()
k=int(input())
chain_hajime=0
chain_owa=0
for i in range(len(s)):
    if s[0]==s[i]:
        chain_hajime+=1
    else: break
for i in range(len(s)):
    if s[-1]==s[-(i+1)]:
        chain_owa+=1
    else: break
#print(chain_hajime)
#print(chain_owa)
import re
def nchars(s, n):
    """文字列 s に、同じ文字が n 個以上連続している部分文字列を見つける
    """

    assert n > 0
    reg = re.compile("(.)\\1{%d,}" % (n - 1))  # カンマを取ると n 個ちょうどになる
    while True:
        m = reg.search(s)
        if not m:
            break
        yield m.group(0)
        s = s[m.end():]
a=list(nchars(s, 2))
b=0
for i in a:
    b+=len(i)//2


if len(set(s))==1:
    print(len(s)*k//2)
elif s[0]!=s[-1]:
    print(b*k)
else:
    print(b*k-(chain_hajime//2+chain_owa//2-(chain_hajime+chain_owa)//2)*(k-1))
# coding:utf-8
N = int(input())
a = input().split()
a_ = list(map(int, a))

#back_a = list(map(lambda x:x*0, list(range(N))))

back_i = 0
back_i2 = 0
for i in range(N):
    a_count = a[i-back_i]
    if a_count > int(a[i-back_i]):
        del a[i-back_i]
        back_i += 1
        back_i2 += 
    if a_count < int(a[i-back_i]):
        del a[i-back_i]
        back_i += 1

print(back_i)


### FIXED CODE ###

# coding:utf-8
a, b = list(map(float, input().split()))
c = (a + b)/2
c_int = int(c)
if c > c_int:
    print(c_int+1)
else:
    print(c_int)
import numpy as np





n = int(input())
arr = list(map(int,input().split()))
arr = np.array(arr)
A = np.zeros((n,n))

for i in range(n-1):
    A[i][i] = 0.5
    A[i][i+1] = 0.5
A[n-1][n-1] = 0.5
A[n-1][0] = 0.5

# print(A)
ans = np.linalg.solve(A, arr)

for i in range(n-1):
    print(int(ans[i]),end=" ")

print(int(ans[n-1]))





### FIXED CODE ###

import numpy as np





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


#
# if n <= 3:
#     ans = np.linalg.solve(A, arr)
#
#     for i in range(n - 1):
#         print(int(ans[i]), end=" ")
#
#     print(int(ans[n - 1]))
# else:

odd = 0
eq = 0
all = [0,0]

for i in range(n):
    if i % 2 == 0:
        eq += arr[i]
        all.append(eq)
    else:
        odd += arr[i]
        all.append(odd)


ans = [0 for i in range(n)]

base = eq-odd
base2 = odd-eq+2*arr[0]
for i in range(n):
    if i %2 ==  0:
        ans[i] = base
        if i == n-1:
            break
        base -= 2*arr[i]
        base += 2* arr[i+1]


    if i %2 ==  1:
        ans[i] =base2
        base2 -= 2*arr[i]
        base2 += 2*arr[i+1]



for i in range(n-1):
    print(ans[i],end=" ")
print(ans[-1])
def f(n,ais):
	ma,mi = max(ais), min(ais)
	res = []
	if ma + mi > 0:
		j = [j for j in range(len(ais)) if ais[j] == ma][0]
		for i in range(len(ais)):
			if ais[i] != ma:
				ais[i] += ais[j]
				res.append([j+1,i+1])

				a >b
		for i in range(1,len(ais)):
			if ais[i-1] > ais[i]:
				ais[i] += ais[i-1]
				res.append([i-1+1, i+1])
	else:
		j = [j for j in range(len(ais)) if ais[j] == mi][0]
		for i in range(len(ais)):
			if ais[i] != mi:
				ais[i] += ais[j]
				res.append([j+1, i+1])
		for i in range(len(ais)-1, 0, -1):
			if not(ais[i - 1] <= ais[i ]):
				ais[i-1] += ais[i]
				res.append([i+1, i-1+1])
	print len(res)
	for u,v in res:
		print u,v
f(int(raw_input()),map(int, raw_input().split()))


### FIXED CODE ###


def f(n,ais):
	ma,mi = max(ais), min(ais)
	res = []
	if ma + mi > 0:
		j = [j for j in range(len(ais)) if ais[j] == ma][0]
		for i in range(len(ais)):
			if ais[i] != ma:
				ais[i] += ais[j]
				res.append([j+1,i+1])

		for i in range(1,len(ais)):
			if ais[i-1] > ais[i]:
				ais[i] += ais[i-1]
				res.append([i-1+1, i+1])
	else:
		j = [j for j in range(len(ais)) if ais[j] == mi][0]
		for i in range(len(ais)):
			if ais[i] != mi:
				ais[i] += ais[j]
				res.append([j+1, i+1])
		for i in range(len(ais)-1, 0, -1):
			if not(ais[i - 1] <= ais[i ]):
				ais[i-1] += ais[i]
				res.append([i+1, i-1+1])
	print len(res)
	for u,v in res:
		print u,v
f(int(raw_input()),map(int, raw_input().split()))
S = input()

S[3] = 8
print(S)


### FIXED CODE ###

S = input()

S = S.replace('7','8',1)
print(S)
from collections import Counter
N = int(input())
ans = 0
evidence = [[] for n in range(N)]

for n in range(N):
    A = int(input())
    for a in range(A):
        lis = list(map(int, input().split()))
        evidence[n].append(lis)

for n in range(1 << N):
    bits = [(n >> i) & 1 for i in range(N)]
    boolean = True
    for i in range(N):
        if (n >> i) & 1 == 0:
            continue
        for x, y in evidence[i]:
            if bits[x-1] == y:
                continue
            flag = False
    if flag:
        ans = max(ans, sum(bits))
print(ans)

### FIXED CODE ###

from collections import Counter
N = int(input())
ans = 0
evidence = [[] for n in range(N)]

for n in range(N):
    A = int(input())
    for a in range(A):
        lis = list(map(int, input().split()))
        evidence[n].append(lis)

for n in range(1 << N):
    bits = [(n >> i) & 1 for i in range(N)]
    flag = True
    boolean = True
    for i in range(N):
        if (n >> i) & 1 == 0:
            continue
        for x, y in evidence[i]:
            if bits[x-1] == y:
                continue
            flag = False
    if flag:
        ans = max(ans, sum(bits))
print(ans)
s=input();min=1000
for i in range(len(s)-2):min=min(abs(int(s[i]+s[i+1]+s[i+2])-753),min)
print(min)

### FIXED CODE ###

s=input();minn=1000
for i in range(len(s)-2):minn=min(abs(int(s[i:i+3])-753),minn)
print(minn)
N=int(input())
a=list(map(int,input().split()))
b=[0]*N
ans=[]
for i in range(N):
    n=N-i
    syou=N//n
    c=0
    for l in range(1,syou):
        aa=n*(l+1)-1
        c=(c+b[aa])%2
    if a[n-1]==0:
        if c==0:
            b[n-1]=0
        else:
            b[n-1]=1
            ans.append(n)
    if a[n-1]==1:
        if c==0:
            b[n-1]=1
            ans.append(n)
        else:
            b[n-1]=0
print(len(ans))
if len(ans)>1:
    print(' '.join(ans))
if len(ans)==1:
    print(1)


### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=[0]*N
ans=[]
for i in range(N):
    n=N-i
    syou=N//n
    c=0
    for l in range(1,syou):
        aa=n*(l+1)-1
        c=(c+b[aa])%2
    if a[n-1]==0:
        if c==0:
            b[n-1]=0
        else:
            b[n-1]=1
            ans.append(str(n))
    if a[n-1]==1:
        if c==0:
            b[n-1]=1
            ans.append(str(n))
        else:
            b[n-1]=0
print(len(ans))
if len(ans)>1:
    print(' '.join(ans))
if len(ans)==1:
    print(1)
n = int(input())
test = []
count = 0
for i in range(0, n):
    num_test = int(input())
    for j in range(0, num_test):
        answer = input().split()
        a = answer[1]
        if a == '1':
            count += 1
        else:
            continue
            return 1
print(count)


### FIXED CODE ###

n = int(input())
s_dict = {}
for i in range(n):
  add_dict = {}
  a = int(input())
  for j in range(a):
    b = list(map(int, input().split()))
    add_dict[b[0]-1] = b[1]
  s_dict[i] = add_dict
max_num = 0

def rec_get_list(i, tmp_num_list, tmp_honest, tmp_unkind):
  add_dict = s_dict[i]
  tmp_num_list.add(i)
  tmp_honest.add(i)
  for k, v in add_dict.items():
      if v:
        if k not in tmp_num_list:
        	tmp_num_list, tmp_honest, tmp_unkind = rec_get_list(k, tmp_num_list, tmp_honest, tmp_unkind)
        tmp_honest.add(k)
      else:
        tmp_unkind.add(k)
  return tmp_num_list, tmp_honest, tmp_unkind

def rec_check(i, tmp_num_list, tmp_honest, tmp_unkind):
  global max_num
  global n
  for j in range(i, n):
    if j in tmp_num_list:
      continue
    use_num_list = tmp_num_list.copy()
    use_honest = tmp_honest.copy()
    use_unkind = tmp_unkind.copy()
    use_num_list, use_honest, use_unkind = rec_get_list(j, use_num_list, use_honest, use_unkind)
    check_flg = len(use_honest & use_unkind)
    if check_flg:
      continue
    else:
      if len(use_num_list) > max_num:
        max_num = len(use_num_list)
    if j+1 < n:
      rec_check(j+1, use_num_list, use_honest, use_unkind)
  
rec_check(0, set(), set(), set()) 
    
print(max_num)
import math
n = int(input())
a = list(map(int, input().split()))

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    a_0 = numbers.pop()
    for i in numbers:
        a_0 = lcm_base(a_0, i)
    return a_0

b = a.copy()
m = lcm_list(b)-1
sum = 0
for j in a:
    sum += m%j

print(sum)

### FIXED CODE ###

a = list(map(int, input().split()))
a.sort()
sub = abs(a[0]-a[1])+abs(a[1]-a[2])
print(sub)
if __name__ == "__main__":
  n = int(input())
  x,y,z = [0]*n,[0]*n,[0]*n
  # ３点h>=に点があれば一意に求まる
  count = 0
  xyh = [[],[],[]]
  #print(xyh)
  for i in range(n):
    x[i],y[i],z[i] = map(int,input().split())
    if z[i] != 0 and count < 3:
      xyh[count].append(x[i])
      xyh[count].append(y[i])
      xyh[count].append(z[i])
      #print(xyh)
      count += 1
  #print(xyh)
  x,y,h = 0,0,0
  pass_ = 0
  for i in range(101):
    for j in range(101): # x,y の座標を定める
      h = abs(i-xyh[0][0])+abs(j-xyh[0][1]) + xyh[0][2]
      if count == 3:
        if h - abs(i-xyh[1][0])-abs(j-xyh[1][1]) - xyh[1][2] == 0 and h - abs(i-xyh[2][0])-abs(j-xyh[2][1]) - xyh[2][2] == 0:
          pass_ = 1
          x,y = i,j
          break
      
      if count == 2:
        if h - abs(i-xyh[1][0])-abs(j-xyh[1][1]) - xyh[1][2] == 0 :
          pass_ = 1
          x,y = i,j
          break
	  if count == 1:
        pass_ = 1
    if pass_ == 1:
      break 
  print(x,y,h)


### FIXED CODE ###

#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(readline())
xyh = [input() for _ in range(n)]
#print(xyh)
for x_ in range(101):
    for y_ in range(101):
        cur_h = 0 #flga の場所をループの中に入れない
        for i in range(n):
            x = int(xyh[i].split()[0])
            y = int(xyh[i].split()[1])
            h = int(xyh[i].split()[2])
            h_ = h + (abs(x_ - x) + abs(y_ - y))
            if cur_h == 0 and h > 0:
                cur_h = h_  #決め打ちの高さ        
            else:
                if h > 0:
                    if cur_h != h_: break
                elif cur_h -(abs(x_ - x) + abs(y_ - y)) > 0: break
        for i in range(n):
            x = int(xyh[i].split()[0])
            y = int(xyh[i].split()[1])
            h = int(xyh[i].split()[2])
            h_ = h + (abs(x_ - x) + abs(y_ - y))
            if cur_h == 0 and h > 0:
                cur_h = h_  #決め打ちの高さ        
            else:
                if h > 0:
                    if cur_h != h_: break
                elif cur_h -(abs(x_ - x) + abs(y_ - y)) > 0: break   
                if i == n-1: 
                    print(x_,y_,cur_h)
                    #print("hello")
                    exit(0)