Harryxun/stf_run huggingface dataset:
import heapq

N = int(input())

color = [[] for _ in range(N)]
ans = [None]*(N-1)


for i in range(N):
    heapq.heapify(color[i])

for i in range(N-1):
    a,b = map(int,input().split())
    
    if i == 0:
        color[a-1].append(1)
        color[b-1].append(1)
        ans[i] = 1

    else:
        if color[a-1]:
            if color[a-1][0] != 1:
                mim = heapq.heappop(color[a-1])
                heapq.heappush(color[a-1],mim)
                heapq.heappush(color[a-1],mim-1)
                heapq.heappush(color[b-1],mim-1)
                ans[i] = mim-1
            else:
                nax = color[a-1][-1]
                heapq.heappush(color[a-1],nax+1)
                heapq.heappush(color[b-1],nax+1)
                ans[i] = nax+1
        else:
            if color[b-1][0]!= 1:
                mim = heapq.heappop(color[b-1])
                heapq.heappush(color[b-1],mim)
                heapq.heappush(color[b-1],mim-1)
                heapq.heappush(color[a-1],mim-1)
                ans[i] = mim-1
            else:
                nax = color[b-1][-1]
                heapq.heappush(color[b-1],nax+1)
                heapq.heappush(color[a-1],nax+1)
                ans[i] = nax+1

print(max(ans))
for i in range(N-1):
    print(ans[i])

### FIXED CODE ###

from collections import deque

N = int(input())

g = [[] for _ in range(N)]
color = [[] for _ in range(N)]
mi = [[] for _ in range(N)]
MA = [[] for _ in range(N)]
edge = {}
ans = [0]*(N-1)
M = 0

for i in range(N-1):
    a,b = map(int,input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
    ans[i] = (a,b)

stack = deque([0])
not_visit = [True]*N
not_visit[0] = False
while stack:
    now = stack.popleft()
    for i in g[now]:
        if not_visit[i]:
            stack.append(i)
            if not mi[now]:
                mi[now] = 1
                MA[now] = 1
                mi[i] = 1
                MA[i] = 1
                M = 1
                color[now].append(mi[now])
                color[i].append(mi[now])
                edge[(now+1,i+1)] = mi[now]
                edge[(i+1,now+1)] = mi[now]
            else:
                if mi[now] != 1:
                    mi[now] -= 1
                    color[now].append(mi[now])
                    color[i].append(mi[now])
                    edge[(now+1,i+1)] = mi[now]
                    edge[(i+1,now+1)] = mi[now]
                    if mi[i]:
                        mi[i] = min(mi[i],mi[now])
                    else:
                        mi[i] = mi[now]
                        MA[i] = mi[now]
                else:
                    MA[now] += 1
                    color[now].append(MA[now])
                    color[i].append(MA[now])
                    edge[(now+1,i+1)] = MA[now]
                    edge[(i+1,now+1)] = MA[now]
                    M = max(M,MA[now])
                    if MA[i]:
                        MA[i] = max(MA[i],MA[now])
                    else:
                        MA[i] = MA[now]
                        mi[i] = MA[now]

            not_visit[i] = False

print(M)
for i in range(N-1):
    print(edge[ans[i]])
N = int(input())

a_n=list(map(int,input().split()))
import sys

i=1
count=0
for k in range(N):
    if a_n[i-1]==2:
        count+=1
        print(count)
        sys.exit()
    else:
        i=a_n[i-1]
        count+=1

print(-1)

### FIXED CODE ###

N = int(input())

a_n=[int(input()) for i in range(N)]
import sys

i=1
count=0
for k in range(N):
    if a_n[i-1]==2:
        count+=1
        print(count)
        sys.exit()
    else:
        i=a_n[i-1]
        count+=1

print(-1)
import math
a = int(input()
print(2*a*math.pi)

### FIXED CODE ###

import math
a = int(input())
print(2*a*math.pi)
a = input()

if a[2] == "+":
    answer = int(a[0]) + int(a[4])
elif a[2] == "-":
    answer = int(a[0]) - int(a[4])
else:
    print('該当しない')

print(answer)

### FIXED CODE ###

a = eval(input())
print(a)
from bisect import bisect_left
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
b =[]
for i in range(M):
    B,C = map(int, input().split())
    b.extend([C for _ in range(B)])
bisec = bisect_left
ex = A.extend
b.sort()
b.reverse()
for i in range(N):
    if A[i]<b[-1]:
        l = bisec(b,A[i])
        print(b[l])
        A[i] = b[l]
        del b[l]
    else:
        break
print(sum(A))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]
BC = sorted(BC,key= lambda x: x[1],reverse=True)
A.sort()
n = 0
i = 0
m = 0
while A[i]<BC[n][1]:
    A[i] = BC[n][1]
    m = m+1
    if m >=BC[n][0]:
        m = 0
        n = n+1
    i += 1
    if n==M:
      break
    if i == N:
      break
print(sum(A))
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass

n = i()
s = s()
cnt = 0
l = s.split("ABC")
if len(l) == 1:
    print(0)
else:
    print(len(l)-1)

### FIXED CODE ###

import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass

k ,x = i2()
if 500*k >= x:
    print("Yes")
else:
    print("No")
import math
x=int(input())
ans=[1]
for i in range(2,x+1):
    #print(i)
    k=math.floor(math.ceil(x,i))
    ans.append(i**k)
print(max(ans))
#print(ans)


### FIXED CODE ###

import math
x=int(input())
if x<4:
    print(1)
else:
    k=0
    for i in range(int(math.sqrt(x))-1):
        l=0
        for j in range(x):
            if (i+2)**j>x:
                break
            else:
                l=(i+2)**j
        if l>k:
            k=l
    print(k)
li = input().split()

if li[0]>=li[1]:
  print(li[1]＊int(li[0]))
else:
  print(li[0]＊int(li[1]))


### FIXED CODE ###

li = input().split()

if li[0]>=li[1]:
  print(li[1] *int(li[0]))
else:
  print(li[0] *int(li[1]))
N,M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
L = []
for i in range(1,M):
    L.append(X[i]-X[i-1])
L.sort()
L.reverse()
res = sum(L)
for i in range(N-1):
    res -= L[i]
print(res)

### FIXED CODE ###

N,M = map(int, input().split())
X = list(map(int, input().split()))
if M <= N:
    print(0)
    exit()
X.sort()
L = []
for i in range(1,M):
    L.append(X[i]-X[i-1])
L.sort()
L.reverse()
res = sum(L)
for i in range(N-1):
    res -= L[i]
print(res)
import math
n,d=map(int,input().split())
za=[list(map(int,input().split())) for i in range(n)]
ans=0
lon=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            lon+=(za[i][d]-za[j][d])**2
            lon=math.sqrt(lon)
        else:
            if lon==int(lon):
                ans+=1
            lon=0
print(ans)

### FIXED CODE ###

import math
n,d=map(int,input().split())
za=[list(map(int,input().split())) for i in range(n)]
ans=0
lon=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            lon+=(za[i][k]-za[j][k])**2
        else:
            lon=math.sqrt(lon)
            if lon==int(lon):
                ans+=1
            lon=0
print(ans)
N, M = map(int, input().split())
x = []
y = []
for i in range(1,M+1):
	z = list(map(int,input().split()))
	x.append(z[0])
	y.append(z[1])
a = [0]
b = [1]*N
for i in range(M):
	b[x[i]-1] -= 1
	b[y[i]-1] += 1
	if x[i]-1 in a:
		a.append(y[i]-1)
		if b[x[i]-1] == 0:
			a.remove(x[i]-1)
c = 0
for i in range(len(a)):
	if b[a[i]] != 0:
		c += 1
print(c)

### FIXED CODE ###

N, L = map(int, input().split())
a = list(map(int, input().split()))
b = 0
c = 0
for i in range(N-1):
	if a[i] + a[i+1] >= L:
		print("Possible")
		b = 1
		c = i
		break
else:
	print("Impossible")
if b == 1:
	for i in range(1,c+1):
		print(i)
	for i in range(N-1, c, -1):
		print(i)
L = []
for i in range(5):
    L.append(int(input()))

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

ans -= 10 - min(tmp)

print(ans)


### FIXED CODE ###

L = []
for i in range(5):
    L.append(int(input()))

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

if(len(tmp) > 0):
    ans -= 10 - min(tmp)

print(ans)
from itertools import permutations

n, m = map(int, input().split())
ans = 0

path = [[False]*n for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    path[a][b] = True
    path[b][a] = True

for i in permutations(range(n), n):
    if i[0] == 0:
        for j in range(n):
            if not path[i[j]][i[j+1]]:
                break
            if j == n-1:
                ans += 1
                break
print(ans)


### FIXED CODE ###

from itertools import permutations

n, m = map(int, input().split())
ans = 0

path = [[False]*n for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    path[a][b] = True
    path[b][a] = True

for i in permutations(range(n), n):
    if i[0] == 0:
        for j in range(n):
            if j == n - 1:
                ans += 1
                break
            if not path[i[j]][i[j+1]]:
                break
print(ans)
import fractions

mod = 1e9 + 7;

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

l = A[0]
for i in range(1, N):
  l = l * A[i] // fractions.gcd(l, A[i])

sum = 0
for i in A:
  sum += l / i

print(int(sum % mod))




### FIXED CODE ###

import fractions

mod = 10**9 + 7;

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

l = 1
for i in A:
  l = l * i // fractions.gcd(l, i)

sum = 0
for i in A:
  sum += l // i

print(sum % mod)
import math
r=int(input())
a=r*r*math.pi
b=2*r*math.pi
print(a,b)

### FIXED CODE ###

import math
r = float(input())
m = r ** 2 * math.pi
l = r * 2 * math.pi
print('{:.6f} {:.6f}'.format(m, l))
def f(n):
  return (n*(n-1))//2
N=int(input())
A=list(map(int,input().split()))
d=dict()
ans=0
#それぞれが何個あるかを辞書に登録
for i in range(len(A)):
  if A[i] not in d:
    d[i]=0
  d[i]+=1
for i in d:
  ans+=f(d[i])
for i in range(len(A)):
  print(ans-d[A[i]]-1)

### FIXED CODE ###

def f(n):#nC2の関数
    if n==0:
        return 0
    return n*(n-1)/2
N=int(input())
A=list(map(int,input().split()))
d=dict()
e=dict()
ans=0
for i in range(N):#辞書を作る
    if A[i] not in d:
        d[A[i]]=0
    d[A[i]]+=1

for j in d:#それぞれのキーの個数をnC2として保存
    e[j]=f(d[j])
    ans+=e[j]#nC2の総和をとる

for i in A:
    print(int(ans-d[i]+1))
A, B, C, K = map(int, input().split())

if K<=A:
  print(K)
elif k<=A+B:
  print(A)
else:
  print(A-(C-(k-(A+B)))


### FIXED CODE ###

A,B,C,K = map(int,input().split())
 
if K <= A:
    print(str(K))
elif K <= A + B:
    print(str(A))
else:
    print(str(A - (C - (A + B + C - K))))
a, b = map(int, input().split())
ave = (a + b) / 2

if ave - int(ave) > 0:
    ave = int(ave) + 1
else
    ave = int(ave)

print(ave)


### FIXED CODE ###

a, b = map(int, input().split())
ave = (a + b) / 2

if ave - int(ave) > 0:
    ave = int(ave) + 1
else:
    ave = int(ave)

print(ave)
import sys
from collections import defaultdict

readline = sys.stdin.buffer.readline


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


sys.setrecursionlimit(10**5)


def main():
    h, n = geta(int)
    a, b = [0] * (n + 1), [0] * (n + 1)
    for i in range(n):
        a[i + 1], b[i + 1] = geta(int)

    INF = 10**9
    dp = [[INF] * (h + 1) for _ in range(n + 1)]

    for i in range(1, n + 1):
        for j in range(0, a[i] + 1):
            dp[i][j] = min(b[i], dp[i - 1][j])

        for j in range(a[i] + 1, h + 1):
            dp[i][j] = min(dp[i][j - a[i]] + b[i], dp[i - 1][j])

    print(dp[n][h])


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
from collections import defaultdict

readline = sys.stdin.buffer.readline


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


sys.setrecursionlimit(10**5)


def main():
    h, n = geta(int)
    a, b = [0] * (n + 1), [0] * (n + 1)
    for i in range(n):
        a[i + 1], b[i + 1] = geta(int)

    INF = 10**9
    dp = [[INF] * (h + 1) for _ in range(n + 1)]

    for i in range(1, n + 1):
        for j in range(0, h + 1):
            if j <= a[i]:
                dp[i][j] = min(b[i], dp[i - 1][j])
            else:
                dp[i][j] = min(dp[i][j - a[i]] + b[i], dp[i - 1][j])

    print(dp[n][h])


if __name__ == "__main__":
    main()
kami = list()
N = int(input())
for x in range(N):
  i = int(input())
  if i in kami:
    kami.discard(i)
  else:
    kami.append(i)
print(len(kami))


### FIXED CODE ###

kami = set()
N = int(input())
for x in range(N):
  i = int(input())
  if i in kami:
    kami.remove(i)
  else:
    kami.add(i)
print(len(kami))
while True:
    n = int(input())
    if n == 0:break
    a = [input() for _ in range(n)]
    while True:
        if len(a) == 1:break
        c = 0
        s = 0
        for i in range(len(a)):
            if a[i].count('.') > c:
                c = a[i].count('.')
                s = i
        e = s
        while e < len(a) and a[e].count('.') == a[s].count('.'):
            e += 1
        k = a[s - 1]
        k.remove('.')
        b = [a[i] for i in range(s, e)]
        for i in len(b):
            b[i].remove('.')
            b[i] = int(b[i])
        if k == '+':
            a[s] = '.'*a[s].count('.')+str(sum(b))
            del a[s + 1:e]
        else:
            m = 1
            for i in b:
                m *= i
            a[s] = '.'*a[s].count('.')+str(m)
            del a[s + 1:e]
    print(a[0])
    


### FIXED CODE ###

while True:
    n = int(input())
    if n == 0:break
    a = [input() for _ in range(n)]
    while True:
        if len(a) == 1:break
        c = 0
        s = 0
        for i in range(len(a)):
            if a[i].count('.') > c:
                c = a[i].count('.')
                s = i
        e = s
        while e < len(a) and a[e].count('.') == a[s].count('.'):
            e += 1
        k = a[s - 1].replace('.', '')
        b = [a[i] for i in range(s, e)]
        for i in range(len(b)):
            b[i] = int(b[i].replace('.', ''))
        if k == '+':
            a[s - 1] = '.'*a[s - 1].count('.')+str(sum(b))
            del a[s:e]
        else:
            m = 1
            for i in b:
                m *= i
            a[s - 1] = '.'*a[s - 1].count('.')+str(m)
            del a[s:e]
    print(a[0])
import numpy as np

a,b,x=[int(x) for x in input().split()]
if x*2<=a**2*b:
    y=2*x
    theta=np.arctan2(y,b*a*b)
else:
    theta=np.arctan2(a**3, 2*(b*a**2-x) )
print(90-theta*180/np.pi)
    

### FIXED CODE ###

import math

a,b,x=[int(x) for x in input().split()]
if x*2<=a**2*b:
    y=2*x
    theta=math.atan2(y,b*a*b)
else:
    theta=math.atan2(a**3, 2*(b*a**2-x) )
print(90-theta*180/math.pi)
import math
x,y,z = map(long, input().split())

a=math.sqrt(x)
b=math.sqrt(y)
ab=2*a*b

if z-x-y-ab>0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math
a,b,c = map(int, input().split())
x=a**2+b**2+c**2+2*a*b-2*b*c-2*a*c
y=4*a*b

if c-b-a>0 and x-y>0 :
    print("Yes")
else:
    print("No")
### https://atcoder.jp/contests/dp/tasks/dp_d
N,W = map(int,input().split())
Goods_List=[]
for i in range(N):
    Goods_List.append(list(map(int,input().split())))

dp={0:0}
for i in range(N):
    Current_Weight,Current_Value = map(int,input().split())
    if (i == 0) & (Current_Weight <= W) :
        dp[Current_Weight] = Current_Value
    elif i > 0:
        Last_Search_List = list(dp.keys())
        Current_Search_List = list(map(lambda x:x+Current_Weight,Last_Search_List))
        for j in range(len(Current_Search_List)):
            Last_Search_Weight = Last_Search_List[j]
            Current_Search_Weight = Current_Search_List[j]
            if Current_Search_Weight in dp:
                dp[Current_Search_Weight] = max(dp[Current_Search_Weight],
                                                dp[Last_Search_Weight] + Current_Value)
            elif Current_Search_Weight <= W :
                dp[Current_Search_Weight] = dp[Last_Search_Weight] + Current_Value

print(max(dp.values()))

### FIXED CODE ###

#https://atcoder.jp/contests/dp/tasks/dp_e
import copy
N,W = map(int,input().split())
Goods_List=[]
for i in range(N):
    Goods_List.append(list(map(int,input().split())))
 
Sum_Value = sum(map(lambda x:x[1],Goods_List))
dp = [[0] * (Sum_Value + 1) for i in range(N)]

for i in range(N):
    if i == 0:
        dp[i][Goods_List[i][1]] = Goods_List[i][0]
    else:
        dp[i] = copy.copy(dp[i-1])
        Valid_List = [k for k, x in enumerate(dp[i]) if x != 0]
        Valid_List.append(0)
        for j in Valid_List:
            if dp[i][j + Goods_List[i][1]] == 0:
                dp[i][j + Goods_List[i][1]] = dp[i-1][j] + Goods_List[i][0]
            else:
                dp[i][j + Goods_List[i][1]] = min(dp[i-1][j] + Goods_List[i][0],dp[i][j + Goods_List[i][1]])
        

for k in range(len(dp[-1])-1,0,-1):
    if (dp[-1][k] != 0) & (dp[-1][k] <= W):
        print(k)
        break
N=int(input())
H=list(map(int,input().split()))

countlist=[]
count=0

for i in range(N-1):
    if  H[i]>=H[i+1]:
      count+=1
    else:
      countlist.append(count)
      count=0
print(max(countlist))

### FIXED CODE ###

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

count_list = []
count = 0

for i in range(N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    count_list.append(count)
    count = 0
else:
  count_list.append(count)
    
print(max(count_list))
n,k=map(int,input().split())
x=list(map(int,input().split()))

if x[n-1]<0 :
    t=x[-k]
    print(t)
elif x[n-1]==0 :
    t=x[-k+1]
    print(t)

elif x[0]>0:
    t=x[k-1]
    print(t)
elif x[0]==0:
    t=x[k-1]
    print(t)

else:
    for i in range(n):
        if x[i]<0 and x[i+1]>=0 :
            i0=i+1
            break
#    print(i0)
    tmin=10**9
    for i in range(i0,k):
        kt=i
        t=x[kt]*2-x[kt-k+1]
#        print("1",kt,kt-k+1,t,x[kt],x[kt-k+1])
        if t<tmin:
            tmin=t
    for i in range(i0-1,i0+1-k-1,-1):
        kt=i
        t=-x[kt]*2+x[kt+k-1]
#        print("2",kt,kt+k-1,t,x[kt],x[kt+k-1])
        if t<tmin:
            tmin=t
    print(tmin)

### FIXED CODE ###

from bisect import bisect_right
from bisect import bisect_left

n,k=map(int,input().split())
#n=100000
#k=100000

#n=100000
#k=100000
x=list(map(int,input().split()))

if x[n-1]<0 :
    t=-x[-k]
#    print(1)
    print(t)
elif x[n-1]==0 :
    t=-x[-k+1]
#    print(2)
    print(t)

elif x[0]>0:
    t=x[k-1]
#    print(3)
    print(t)
elif x[0]==0:
    t=x[k-1-1]
#    print(4)
    print(t)

else:
    iz=bisect_left(x,0)
    if x[iz+1]==0:
        k=k-1
        tmin=10**9
#        print((iz-(k-1)+1),iz,n-1-(k-1))
        for i in range(max(0,iz-(k-1)+1),min(iz,n-1-(k-1)+1)):
            kt=i
            t1=-x[kt]+x[kt+(k-1)]*2
            t2=-x[kt]*2+x[kt+(k-1)]
#        print("2",kt,kt+k-1,t,x[kt],x[kt+k-1])
#            print(tmin,t1,t2)
            if t1<tmin:
                tmin=t1
            if t2<tmin:
                tmin=t2
    else:
        tmin=10**9
#        print((iz-(k-1)+1),iz,n-1-(k-1))
        for i in range(max(0,iz-(k-1)+1),min(iz,n-1-(k-1)+1)):
            kt=i
            t1=-x[kt]+x[kt+(k-1)]*2
            t2=-x[kt]*2+x[kt+(k-1)]
#        print("2",kt,kt+k-1,t,x[kt],x[kt+k-1])
#            print(tmin,t1,t2)
            if t1<tmin:
                tmin=t1
            if t2<tmin:
                tmin=t2
    print(tmin)
    
#  299993628 
# 1000000000        
#   99990701
import sys
import numpy as np

def main(N, S):
    dp = np.zeros((N + 1, N + 1), dtype=int)
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i][j] = min(j - i, dp[i - 1][j - 1] + 1) if S[i] == S[j] else 0
    return dp.max()

if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i8 = numba.int64
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc_export(main, (i8, i8[:]))
    cc.compile()

from my_module import main

N = int(read())
S = [ord(_) for _ in input()]
print(main(N, S))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
def resolve():
    n=int(input())
    A=list(map(int,input().split()))

    cnt=0
    while all(i%2==0 for i in A):
        A = A//2
        cnt+=1
    print(cnt)



resolve()


### FIXED CODE ###

# import bisect
# import copy
# import fractions
# import math
import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    n=int(input())
    A=np.array(list(map(int,input().split())))

    cnt=0
    while all(i%2==0 for i in A):
        A = A//2
        cnt+=1
    print(cnt)



resolve()
N = int(input())
points = []
for i in range(N):
    x, y = map(int, input().split())
    if (x, y) == (0, 0): continue
    points.append((x,y))

PI = 3.14

import math
points.sort(key=lambda x : math.atan2(x[0], x[1]))

def calc(points):
    l = 0
    h = 1

    xsum = points[0][0]
    ysum = points[0][1]

    highest = xsum ** 2 + ysum ** 2
    while h < len(points):
        nx, ny = xsum - points[l][0], ysum - points[l][1]
        if (not l >= h) and nx ** 2 + ny ** 2 > xsum ** 2 + ysum ** 2 or h - l >= N:
            xsum, ysum = nx, ny
            l += 1
        else:
            xsum += points[h][0]
            ysum += points[h][1]
            h += 1
        highest = max(highest, xsum ** 2 + ysum ** 2)
    return highest

print(calc(points + points) ** 0.5)


### FIXED CODE ###

N = int(input())
points = []
for i in range(N):
    x, y = map(int, input().split())
    if (x, y) == (0, 0): N -= 1; continue
    points.append((x,y))

if not points:
    print(0)
    quit()
    
PI = 3.14

import math
points.sort(key=lambda x : math.atan2(x[0], x[1]))

def calc(points):
    # Greedy optimality
    l = 0
    h = 1

    xsum = points[0][0]
    ysum = points[0][1]

    highest = xsum ** 2 + ysum ** 2
    while h < len(points):
        nx, ny = xsum - points[l][0], ysum - points[l][1]
        if (not l >= h) and nx ** 2 + ny ** 2 > xsum ** 2 + ysum ** 2 or h - l >= N:
            xsum, ysum = nx, ny
            l += 1
        else:
            xsum += points[h][0]
            ysum += points[h][1]
            h += 1
        highest = max(highest, xsum ** 2 + ysum ** 2)
    return highest

def calc2(points):
    hi = 0
    
    for s in range(N):
        for j in range(1,N+1):
            xt = yt = 0
            for x in range(j):
                xt += points[s+x][0]
                yt += points[s+x][1]
            hi = max(hi, xt ** 2 + yt ** 2)

    return hi ** 0.5

print(calc2(points + points))
N = int(input())
A = list(map(int,input().split()))
min = N + 1
AC = 0
for i in range(N):
  if min < A[i]:
     AC += 1
input(AC)

### FIXED CODE ###

N,M = list(map(int,input().split()))
if N == M:
  print('Yes')
else:
  print('No')
a, b = map(int,input().split())

if b > 12:
  print(b)
elif: b > 5:
  print(int(b/2))
else:
  print(0)

### FIXED CODE ###

a, b = map(int,input().split())
 
if a > 12:
  print(b)
elif a > 5:
  print(int(b/2))
else:
  print(0)