Harryxun/stf_run huggingface dataset:
import sys

def cross(a, b):
	return (a.conjugate() * b).real
def dot(a, b):
	return (a.conjugate() * b).imag

def ccw(a, b, c):
	x = b - a
	y = c - a;
	if cross(x, y) > 0: return 1
	if cross(x, y) < 0: return -1
	if dot(x, y) < 0: return 2
	if abs(x) < abs(y): return -2
	return 0

def solve(l, p):
	x = ccw(l[0][0], l[0][1], p)
	if x != 0:
		x = int(x / abs(x))
	for i in l[1:]:
		y = ccw(i[0], i[1], p)
		if y != 0:
			y = int(y / abs(y))
		if x != y:
			print "NO"
			return
	print 'YES'

for line in sys.stdin:
	ax, ay, bx, by, cx, cy, px, py = map(float, line.split())
	a = complex(ax, ay)
	b = complex(bx, by)
	c = complex(cx, cy)
	p = complex(px, py)
	solve([(a, b), (b, c), (c, a)], p)

### FIXED CODE ###

import sys
def cross(a, b):
	return (a.conjugate() * b).imag
def dot(a, b):
	return (a.conjugate() * b).real
def ccw(a, b, c):
	x = b - a
	y = c - a;
	cr = cross(x, y)
	if cr != 0: return cr
	if dot(x, y) < 0: return 2
	if abs(x) < abs(y): return -2
	return 0
for line in sys.stdin:
	t = map(float, line.split())
	if len(t) == 0: continue
	a, b, c, p = map(complex, t[0::2], t[1::2])
	l = [(a, b), (b, c), (c, a)]
	x = cmp(ccw(l[0][0], l[0][1], p), 0)
	if all(cmp(ccw(i[0], i[1], p), 0) == x for i in l[1:]):
		print "YES"
	else:
		print "NO"
s = list(input().split()[1])[0]

print(f'A{s}C')

### FIXED CODE ###

s = input().split()[1]

print('A' + s[0] + 'C')
a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")
import collections
n = int(input())
s=input()
l=list(collections.Counter(s).values())
ans=l[0]*l[1]*l[2]
for i in range(n):
    for j in range(i+1,n):
        k = 2*j-i
        if n <= k:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ans-=1
print(ans)

### FIXED CODE ###

import collections
n = int(input())
s=input()
l=list(collections.Counter(s).values())
if len(l) == 3:
    ans=l[0]*l[1]*l[2]
    for i in range(n):
        for j in range(i+1,n):
            k = 2*j-i
            if n <= k:
                break
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                ans-=1
    print(ans)
else:
    print(0)
import os
import sys

N = int(sys.stdin.readline().strip())
cost_list = list(map(int, sys.stdin.readline().strip()))
dp = [10**9 for _ in range(N)]
dp[0] = 0
dp[1] = abs(cost_list[1] - cost_list[0])

for i in range(2, N):
    dp[i] = min(dp[i-2] + abs(cost_list[i] - cost_list[i-2]), dp[i-1] + abs(cost_list[i] - cost_list[i-1]))

print(dp[N-1])

### FIXED CODE ###

import sys

N = int(sys.stdin.readline().strip())
cost_list = list(map(int, sys.stdin.readline().strip().split(" ")))
dp = [10**9 for _ in range(N)]
dp[0] = 0
dp[1] = abs(cost_list[1] - cost_list[0])

for i in range(2, N):
    dp[i] = min(dp[i-2] + abs(cost_list[i] - cost_list[i-2]), dp[i-1] + abs(cost_list[i] - cost_list[i-1]))

print(dp[N-1])
h, w = map(int, input().split())
data = ''
for i in range(h):
    data += input()

array = list(data)

for i, x in enumerate(array):
    if x == '.':
        continue
    cnt = 0
    # 上の確認
    if not i < w:
        if array[i - w] == '#':
            cnt += 1
    # 下の確認
    if i + w < h * w:
        if array[i + w] == '#':
            cnt += 1
    # 左の確認
    if i % w != 0:
        if array[i - 1] == '#':
            cnt += 1
    # 右の確認
    if i + 1 % w != 0:
        if array[i + 1] == '#':
            cnt += 1

    if cnt == 0:
        print('No')
        break
else:
    print('Yes')

### FIXED CODE ###

h, w = map(int, input().split())
data = ''
for i in range(h):
    data += input()

array = list(data)
#print(array)

for i, x in enumerate(array):
    if x == '.':
        continue
    cnt = 0
    # 上の確認
    if not i < w:
        if array[i - w] == '#':
            cnt += 1
    # 下の確認
    if i + w < h * w:
        if array[i + w] == '#':
            cnt += 1
    # 左の確認
    if i % w != 0:
        if array[i - 1] == '#':
            cnt += 1
    # 右の確認
    if i % w != w - 1:
        if array[i + 1] == '#':
            cnt += 1

    if cnt == 0:
        print('No')
        break
else:
    print('Yes')
import collections

N = int(input())
A = collections.deque(sorted(map(int,input().split())))


def func1(a, r, rnext):
    p = A.popleft()
    q = A.pop()
    ans = 0
    a1 = collections.deque()
    while True:
        if p + q == r:
            ans += 1
            try:
                p = a.popleft()
            except:
                break
            try:
                q = a.pop()
            except:
                if p < rnext:
                    a1.append(p)
                break
        elif p + q > r:
            try:
                q = a.pop()
            except:
                if p < rnext:
                    a1.append(p)
                break
        else:
            a1.append(p)
            try:
                p = a.popleft()
            except:
                if q < rnext:
                    a1.append(q)
                break
    return ans, a1

t = int.bit_length(A[-1])
r = 2 ** t
rnext = 2 ** (t - 1)
anser = 0
a = A

while True:
    ans, a1 = func1(a, r, rnext)
    anser += ans
    if len(a1) < 2:
        break
    a = a1
    t -= 1
    r = rnext
    rnext = 2 ** (t - 1)

print(anser)

### FIXED CODE ###

import collections

N = int(input())
A = collections.deque(sorted(map(int,input().split())))


def func1(a, r, rnext):
    p = a.popleft()
    q = a.pop()
    ans = 0
    a1 = collections.deque()
    while True:
        if p + q == r:
            ans += 1
            try:
                p = a.popleft()
            except:
                break
            try:
                q = a.pop()
            except:
                if p < rnext:
                    a1.append(p)
                break
        elif p + q > r:
            try:
                q = a.pop()
            except:
                if p < rnext:
                    a1.append(p)
                break
        else:
            a1.append(p)
            try:
                p = a.popleft()
            except:
                if q < rnext:
                    a1.append(q)
                break
    return ans, a1


if N == 1:
    print(0)
    exit(0)
t = int.bit_length(A[-1] + A[-2])
r = 2 ** t
rnext = 2 ** (t - 1)
anser = 0
a = A

while True:
    ans, a1 = func1(a, r, rnext)
    anser += ans
    if len(a1) < 2:
        break
    a = a1
    t -= 1
    r = rnext
    rnext = 2 ** (t - 1)

print(anser)
N,M=map(int,input().split())
A=[]
a=[]
a.append(0)
x=0
d=1
A.append(1)
A.append(2)
for j in range(2,N):
    A.append(A[j-1]+A[j-2])
for i in range(1,M+1):
    a.append(int(input()))
    x=A[a[i]-a[i-1]-2]
    d=d*x
    if i>1:
        if a[i]-a[i-1]==1:
            d=0
x=A[N-a[M]-2]
d=d*x
print(A[21],A[11])
print(d%(10**9+7))

### FIXED CODE ###

N,M=map(int,input().split())
A=[]
B=[]
a=[]
a.append(0)
x=0
d=1
A.append(1)
A.append(2)
B.append(1)
B.append(1)
for j in range(2,N):
    A.append(A[j-1]+A[j-2])
    B.append(B[j-1]+B[j-2])
for i in range(1,M+1):
    a.append(int(input()))
    if a[i-1]==0:
        if a[i]==1:
            d=1
        else:
            x=A[a[i]-a[i-1]-2]
            d=d*x%(10**9+7)
    else:
        x=B[a[i]-a[i-1]-2]
        d=d*x%(10**9+7)
    if i>1:
        if a[i]-a[i-1]==1:
            d=0
c=N-a[M]
if c==1:
    print(d)
elif c==N:
    x=A[c-1]
    d=d*x%(10**9+7)
    print(d)
else:
    x=A[N-a[M]-2]
    d=d*x%(10**9+7)
    print(d)
a,b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print " ".join([str(d), str(r), str('%.5f'.f)])

### FIXED CODE ###

a,b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print " ".join([str(d), str(r), str('%.5f' % f)])
input_str = input()
input_list = input_str.split(' ')
a = input_list[0]
b = input_list[1]
c = input_list[2]
if a <= x:
    if x <= a + b:
        print('YES')
    else:
        print('NO')
else:
    print('NO')


### FIXED CODE ###

input_str = input()
input_list = input_str.split(' ')
a = int(input_list[0])
b = int(input_list[1])
x = int(input_list[2])
if a <= x:
    if x <= a + b:
        print('YES')
    else:
        print('NO')
else:
    print('NO')
S = []
ans = 0
for c in input():
    if c != S[-1] & len(S) > 0:
        S.pop()
        ans += 2
    else:
        S.append(c)
print(ans)

### FIXED CODE ###

S = []
ans = 0
for c in input():
    if len(S) > 0 and c != S[-1]:
        S.pop()
        ans += 2
    else:
        S.append(c)
print(ans)
#http://abc078.contest.atcoder.jp/
# -*- coding: utf-8 -*-
n, z, w = map(int,input().split())
a = list(map(int,input().split()))

ans = []
ans.append( abs( a[-1] - w ) )
ans.append( abs( a[-1] - a[-2] ) )
print(max(ans))

### FIXED CODE ###

#http://abc078.contest.atcoder.jp/
# -*- coding: utf-8 -*-
n, z, w = map(int,input().split())
a = list(map(int,input().split()))

ans = []
ans.append( abs( a[-1] - w ) )
if len(a) > 1: ans.append( abs( a[-1] - a[-2] ) )

print(max(ans))
X,A,B=map(int,input().split())
if C-B>A:
    print('dangerous')
elif C-B==A:
    print('safe')
else:
    print('delicious')

### FIXED CODE ###

X,A,B=map(int,input().split())
if B<=A:
    print('delicious')
elif (B-A)<=X:
    print('safe')
else:
    print('dangerous')
def calc_price(bit):
	# 値段の合計
	price_total = 0
  # 理解度
	learn_total = [0] * m 
	
	for i in range(n):
		# i桁目が0か1か見て、i冊目を買うか買わないか判定します
		if (bit >> i) & 1;
			# 買うので、i冊目の値段を加算します
			price_total += c[i]
			# 「i冊目の参考書を読んで増える、各アルゴリズムの理解度」のリストです
			learn = a[i]
			# 理解度を加算、
      # enumerateを使うと、range(n)よりスマートです
      # 引数にリストなどのイテラブルオブジェクトを指定する。
			for j, la in enumerate(learn):
				learn_total[j] += la

			#条件を満たすかどうかcheck関数で確認
			if check(learn_total):
			# 条件を満たすので、値段を返します
				return price_total
			else:
			# 条件を満たさないので、INFを返します
				return INF

def check(learn_total):
    for i in range(m):
        if learn_total[i] < x:
            return False  # 1個でもx未満ならFalse
    return True # 全部x以上ならTrue

if __name__ == '__main__':
	n, m, x = list(map(int, input().split()))
	
	#からのリストを作ってappendで追加していく
	c = [] #参考書の値段
	a = [] #書く参考書に入る理解度
	
	for i in range(n):
		c_temp, a_temp = list(map(int, input().split()))
		c.append(c_temp)
	  a.append(a_temp)
	
	INF = float("inf")
	ans = INF
	
	for bit in range(1 << n):
		# 条件を満たすならそのときの値段、満たさないならINFが返ってきます
		price = calc_price(bit)
	  # 答えを更新
		ans = min(ans, price)
	
	if ans == INF:
		price(-1)
	else:
	  price(ans)

### FIXED CODE ###


N, M, X = map(int, input().split())
C = []
A = []
for  i in range(N):
    t = list(map(int, input().split()))
    C.append(t[0])
    A.append(t[1:])
    
result = -1
"""
<< bit演算に関する演算子
左辺の値を右辺の値だけ左へシフトすることを意味する

https://www.javadrive.jp/python/num/index4.html

下記の場合、1からNまで2真数でシフトしていく感じ
"""

for i in range(1 << N):
    #初期化
    t = [0] * M
    c = 0
    #print(i)
    for j in range(N):
        #print(j)
        if(i >> j ) & 1 == 0 :
            continue
        c += C[j]
        for k in range(M):
            t[k] += A[j][k]
    if all(x >= X for x in t):
        if result == -1:
            result = c
        else:
            result = min(result, c)
print(result)
n=int(input())
s=0
if 1<=n<10:
  print("Yes")
  exit()
else:
  while n>10:
    s+=n%10
    n//=10
  if n%s==0:
    print("Yes")
    exit()

print("No")

### FIXED CODE ###

n=str(input())
s=0
for i in range(len(n)):
  s+=int(n[i])

n=int(n)
if n%s==0:
  print("Yes")
else:
  print("No")
'''
211 5
31 41 59 26 53
'''
power, moves = [int(x) for x in input().split()]
powers = sum([int(x) for x in input().split()])
print(["No","Yes"][powers >= power])

### FIXED CODE ###

H, A = [int(x) for x in input().split()]
print( (H // A ) + (H % A > 0))
k,n=map(int,input.split())
l=list(map(int,input.split()))
v=[k-l[-1]+l[0]]
for i in range(n-1):
  v.append(l[i+1]-l[i])
v.sort()
print(k-v[-1])

### FIXED CODE ###

k,n=map(int,input().split())
l=list(map(int,input().split()))
v=[k-l[-1]+l[0]]
for i in range(n-1):
  v.append(l[i+1]-l[i])
v.sort()
print(k-v[-1])
import math
a,b,C=map(int,input().split())
C_rad=math.pi*C/180
S=(1/2)*a*b*math.sin(C_rad)
L=a+b+math.sqrt(a**2+b**2-2*a*b*cos(C_rad))
h=2*S/a
print("{0:.8f}".format(S))
print("{0:.8f}".format(L))
print("{0:.8f}".format(h))

### FIXED CODE ###

import math
a,b,C=map(int,input().split())
C_rad=math.pi*C/180
S=(1/2)*a*b*math.sin(C_rad)
L=a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(C_rad))
h=2*S/a
print("{0:.8f}".format(S))
print("{0:.8f}".format(L))
print("{0:.8f}".format(h))
a,b = int(input().split())

print(int(a*b))

### FIXED CODE ###

l = input().split()
 
a = l[0]
b = l[1]
 
a = int(a)
b = float(b) * 1000
b = int(b)
ks = a * b 
print(int(ks // 1000))
print(input()*2*3.14)

### FIXED CODE ###

print(int(input())*2*3.14)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
k = 0
s = 0
m = []
l = 0
if sum(B)<=sum(A):
    for i in range(N):
        if A[i] < B[i]:
            k += 1
            s += (B[i]- A[i])
        elif A[i] > B[i]+1:
            m.append(A[i]- B[i])
        elif A[i] == B[i]+1:
            l += (A[i]- B[i])
    n = soeted(m,reverse = True)
    for j in range(len(m)):
        if s > 0:
            s -= n[j]
            k += 1
        if s <0:
            break
    if (s > 0) and(k > 0):
         k += s
else:
    print(-1)
print(k)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
k = 0
s = 0
m = []
l = 0
if sum(B)<=sum(A):
    for i in range(N):
        if A[i] < B[i]:
            k += 1
            s += (B[i]- A[i])
        elif A[i] > B[i]+1:
            m.append(A[i]- B[i])
        elif A[i] == B[i]+1:
            l += (A[i]- B[i])
    if len(m)>1:
        n = sorted(m,reverse = True)
    else:
        n = m
    for j in range(len(m)):
        if s > 0:
            s -= n[j]
            k += 1
        if s <0:
            break
    if (s > 0) and(k > 0):
         k += s
else:
    k = -1
print(k)
#!/usr/bin/env python3

h,n = map(int,input().split())
a = list(map(int,input().split()))
print("Yes" else "No" if sum(a) >= h)

### FIXED CODE ###

#!/usr/bin/env python3

h,n = map(int,input().split())
a = list(map(int,input().split()))
print('Yes' if sum(a) >= h else "No")
n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  lists.append(list)
num=[0]*n
for list in lists:
  for __ in range(len(list)):
    num[list[__]-1]+=1
count=0
for nn in num:
  if nn==0:
    count+=1
print(count)

### FIXED CODE ###

n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  lis=list(map(int,input().split()))
  lists.append(lis)
ans=[0]*n
for list in lists:
  for i in range(len(list)):
    ans[list[i]-1]+=1
count=0
for h in ans:
  if h==0:
    count+=1
print(count)
S = raw_input()
w = int(raw_input())
print "".join(S[i] for i in xrange(0, len(S), w))

### FIXED CODE ###

a,b = map(int, raw_input().split())
print "+" if a + b == 15 else "*" if a*b == 15 else "x"
input()
num_list = list(map(int, input().split()))
min_cnt = 0
for num in num_list:
  min_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt < min_cnt: min_cnt = num_cnt
      break
    else:
      num = num / 2
      min_cnt += 1
print(min_cnt)

### FIXED CODE ###

input()
num_list = list(map(int, input().split()))
min_cnt = 999
for num in num_list:
  num_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt < min_cnt: min_cnt = num_cnt
      break
    else:
      num = num / 2
      num_cnt += 1
print(min_cnt)
# 入力
a = int(input("a:"))
b = int(input("b:"))

# 処理
if a * b % 2 == 0:
    answer = "Even"
else:
    answer = "Odd"

print(answer)


### FIXED CODE ###

# 086A
# 入力値の積が偶数か奇数か


# 入力
a, b = map(int, input().split())

# 処理
x = a * b % 2

if x == 0:
    print("Even")
else:
    print("Odd")
input = int(input())
a = []
while(i <= input):
    if i%3 == 0 or i%5 == 0:
        pass
    else:
        a.append(i)
    i += 1

print(sum(a))



### FIXED CODE ###

input = input()
a = []
i = 1
while(i <= int(input)):
    if i%3 == 0 or i%5 == 0:
        pass
    else:
        a.append(i)
    i += 1
res = 0
for j in a:
  res = res + j
print(res)
ress = [[(10 ** i * j) % 13 for j in range(10)] for i in range(6)]

mod = 10 ** 9 + 7

keta = 0
res = 5
state = [1] + [0] * 12
for s in reversed(input()):
    if s == "?":
        new_state = [0] * 13
        for i in range(13):
            for r in ress[keta]:
                new_state[i] += state[(i - r) % 13]

        state = new_state
    else:
        res -= ress[keta][int(s)]

    if keta == 5:
        keta = 0
        for i in range(13):
            new_state[i] %= mod
    else:
        keta += 1


print(state[res % 13] % mod)


### FIXED CODE ###

import numpy as np
from numpy.fft import fft, ifft

mod = 10 ** 9 + 7
S = input()

mat = []
for i in range(6):
    w = np.zeros(13)
    for j in range(10):
        w[(10 ** i * j) % 13] += 1
    mat.append(fft(w))

ress = [[(10 ** i * j) % 13 for j in range(10)] for i in range(6)]


state = np.zeros(13)
state[0] = 1
state = fft(state)

keta = 0
res = 5
for s in reversed(S):
    if s == "?":
        state = state * mat[keta]
    else:
        res -= ress[keta][int(s)]

    if keta == 5:
        keta = 0
        state = fft(np.remainder(np.round(np.real(ifft(state))), mod))
    else:
        keta += 1


state = ifft(state)
print(int(np.round(np.real(state[res % 13]))) % mod)
N, K = map(int, input().split())
S = str(input())
if S[K - 1] == "A":
    S[K - 1] = "a"
    print(S)
elif S[K - 1] == "B":
    S[K - 1] = "b"
    print(S)
else:
    S[K - 1] = "c"
    print(S)

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
if S[K - 1] == "A":
    S[K - 1] = "a"
    print("".join(S))
elif S[K - 1] == "B":
    S[K - 1] = "b"
    print("".join(S))
else:
    S[K - 1] = "c"
    print("".join(S))
import sys
import fractions

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

kouho = []
n = ni()
li = na()
flag = 0
if len(li) == 2:
    print(max(li[0], li[1]))
else:
    kouho.append(fractions.gcd(li[0], li[1]))
    kouho.append(fractions.gcd(li[1], li[2]))
    kouho.append(fractions.gcd(li[2], li[0]))
    for i in range(3,n):
        if len(kouho) == 0:
            print(i)
            break
        for num in kouho:
            if li[i] % num != 0:
                kouho.remove(num)
    print(max(kouho))
    






### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect
from operator import itemgetter
#from heapq import heappush, heappop
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nb = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ni()
A = na()
b = [0] * N
c = [0] * N
b[0] = A[0]
c[-1] = A[-1]
for i in range(N-1):
    b[i+1] = math.gcd(b[i], A[i+1])
    c[-(i+2)] = math.gcd(c[-(i+1)], A[-(i+2)])

ans = 1
ans = max(c[1], ans)
ans = max(b[-2], ans)
for i in range(1, N-1):
    ans = max(math.gcd(b[i-1], c[i+1]), ans)
print(ans)
import math
a = input()
b = input()
c = input()
d = input()
e = input()
l = []
if a[-1] != '0': l.append(a[-1])
if b[-1] != '0': l.append(b[-1])
if c[-1] != '0': l.append(c[-1])
if d[-1] != '0': l.append(d[-1])
if e[-1] != '0': l.append(e[-1])
min_l = min(l)
p = [ a,b,c,d,e ]
o = []
len_p = len(p)
tmp_p = ''
for i in range(0, len_p):
  if p[i][-1] == min_l:
    tmp_p = int(p.pop(i))
    break
new_p = 0
for i in p:
  new_p += math.ceil(int(i)/10)*10
print(new_p+tmp_p)

### FIXED CODE ###

import math
a = input()
b = input()
c = input()
d = input()
e = input()
l = []
if a[-1] != '0': l.append(a[-1])
if b[-1] != '0': l.append(b[-1])
if c[-1] != '0': l.append(c[-1])
if d[-1] != '0': l.append(d[-1])
if e[-1] != '0': l.append(e[-1])
if l == []:
  print(int(a)+int(b)+int(c)+int(d)+int(e))
else:
  min_l = min(l)
  p = [ a,b,c,d,e ]
  o = []
  len_p = len(p)
  tmp_p = ''
  for i in range(0, len_p):
    if p[i][-1] == min_l:
      tmp_p = int(p.pop(i))
      break
  new_p = 0
  for i in p:
    new_p += math.ceil(int(i)/10)*10
  print(new_p+tmp_p)
read = input
n = int(read())
v = [[] for i in range(n+1)] # 邻接
used = [0 for i in range(n+1)] # 节点 1~n
def add(f,t,w):
    v[f].append((t, w))
    
for i in range(n-1):
    f,t,w = map(int, read().split())
    add(f,t,w)
    add(t,f,w)
# 从1出发，贪心即可，1画1，理论不会有回环
def dfs(f, s, fa=-1):
    if s % 2 == 0: 
        used[f] = 1
    for t, w in v[f]:
#         print('%d->%d->%d'%(fa, f, t,), s, w)
        if t == fa:continue
        dfs(t, w + s, f)
dfs(1,0)
for i in used[1:]:
    print(used[i])

### FIXED CODE ###

read = input
n = int(read())
v = [[] for i in range(n+1)] # 邻接
used = [0 for i in range(n+1)] # 节点 1~n
def add(f,t,w):
    v[f].append((t, w))
for i in range(n-1):
    f,t,w = map(int, read().split())
    add(f,t,w)
    add(t,f,w)
# 从1出发，贪心即可，1画1，理论不会有回环
# def dfs(f, s, fa=-1):
#     if s % 2 == 0: 
#         used[f] = 1
#     for t, w in v[f]:
# #         print('%d->%d->%d'%(fa, f, t,), s, w)
#         if t == fa:continue
#         dfs(t, w + s, f)
from queue import Queue
q = Queue()
#def dfs(f, s, fa=-1):
#    if s % 2 == 0: 
#        used[f] = 1
#    for t, w in v[f]:
##         print('%d->%d->%d'%(fa, f, t,), s, w)
#        if t == fa:continue
#        dfs(t, w + s, f)
#
#
#dfs(1,0)
q.put_nowait((1, 0, -1))
while not q.empty():
    f, s, fa = q.get_nowait()
    if s % 2 == 0: 
        used[f] = 1
    for t, w in v[f]:
#         print('%d->%d->%d'%(fa, f, t,), s, w)
        if t == fa:continue
        q.put_nowait(
            (t, w + s, f)
        )
    
for i in used[1:]:
    print(used[i])
import sys

def input_num():
    num = input().split()
    return num

def num_serch(num):
    penki_num = len(num)
    for j, i in enumerate(num):
        if i == num[j+1]:
            penki_num = penki_num - 1
        if j == penki_num - 1:
            break

    print(penki_num)

if __name__ == '__main__':
    num = input_num()
    num_serch(num)

### FIXED CODE ###

import sys

def input_num():
    num = input().split()
    return num

def num_serch(num):
    penki_num = len(num)
    if num[0] == num[1]:
        penki_num = penki_num - 1
    if num[0] == num[2]:
        penki_num = penki_num - 1
    if num[1] == num[2]:
        penki_num = penki_num - 1

    if penki_num == 0:
        penki_num = penki_num + 1

    print(penki_num)

if __name__ == '__main__':
    num = input_num()
    num_serch(num)
import numpy as np
import bisect
#input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
sumA = sum(A)
ans = 0
if sumA%2 != 0:
    ans += 1
cumsum = np.cumsum(A)
half = sumA//2
id = bisect.bisect_left(cumsum,half)
mini = min(abs(half-cumsum[id]),abs(cumsum[id+1]-half))
ans += mini
print(ans)

### FIXED CODE ###

import numpy as np
import bisect
N = int(input())
A = list(map(int,input().split()))
sumA = sum(A)
cumsum = np.cumsum(A)
ans = 2020202020
for a in cumsum:
    ans = min(ans,abs(2*a-sumA))
print(ans)