Harryxun/stf_run huggingface dataset:
N = int(input())
ls = []
for i in range(N):
  s,p = input().spiit()
  p = int(p)
  ls.append([s,-p,i+1])
ls.sort()
for i in range(len(ls)):
  print(ls[2])

### FIXED CODE ###

N = int(input())
ls = []
for i in range(N):
  s,p = input().split()
  p = int(p)
  ls.append([s,-p,i+1])
ls.sort()
for i in range(len(ls)):
  print(ls[i][2])
n=int(input())
for _ in range(n):
    p=[float(i) for i in input().split()]
    if round((p[3]-p[1])/(p[2]-p[0]),5)==round((p[7]-p[5])/(p[6]-p[4]),5):print("YES")
    else:print("NO")


### FIXED CODE ###

n=int(input())
for j in range(n):
    p=[float(i) for i in input().split()]
    if round((p[2]-p[0])*(p[7]-p[5])-(p[3]-p[1])*(p[6]-p[4]),10)==0:
        print("YES")
    else:
        print("NO")
x,y=map(int,raw_input().split())
a=[map(int,raw_input().split()) for i in range(x)]
for i in range(x):
	a[i].append(sum(a[i]))
	for j in range(y+1):
		print a[i][j],
	print
for i in range(???+1):
	print sum([row[i] for row in a]),

### FIXED CODE ###

x,y=map(int,raw_input().split())
a=[map(int,raw_input().split()) for i in range(x)]
for i in range(x):
	a[i].append(sum(a[i]))
	for j in range(y+1):
		print a[i][j],
	print
for i in range(y+1):
	print sum([row[i] for row in a]),
N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))

ma = -np.inf
for i in range(N-1):
  if sum(A1[:i+1]) + sum(A2[i:]) > ma:
    ma = sum(A1[:i+1]) + sum(A2[i:])
    
if N == 1:
  ma = A1[0] + A2[0]
  
print(ma)

### FIXED CODE ###

import numpy as np

N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
 
ma = -np.inf
for i in range(N-1):
  if sum(A1[:i+1]) + sum(A2[i:]) > ma:
    ma = sum(A1[:i+1]) + sum(A2[i:])
    
if N == 1:
  ma = A1[0] + A2[0]
  
print(ma)
import sympy
n=int(input())
k=sympy.divisors(n)
c=0
for i in range(len(k)):
    if i==0:pass
    else:
        if n%k[i]==0:
            n//=k[i]
            c+=1
print(c)

### FIXED CODE ###

n=int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])

    return arr

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

k=make_divisors(n)
c=0
for i in range(len(k)):
    if i==0:pass
    else:
        l1=factorization(k[i])
        seigo=is_prime(l1[0][0])
        if len(l1)==1 and seigo==True and n%k[i]==0:
            n//=k[i]
            c+=1
        
print(c)
def euclid(a, b):
    if b < a:
        tmp = a
        a = b
        b = tmp

    ret = b % a
    if ret == 0:
        return a
    else:
        return euclid(ret, a)


if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))

    if N == 1:
        print(T[0])
    else:
        gcd = (T[0] * T[1] / euclid(T[0], T[1]))
        for i in range(2, N):
            gcd = (gcd * T[i] / euclid(gcd, T[i]))

        print(int(gcd))


### FIXED CODE ###

import decimal


def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


def lcm(a, b):
    g = euclid(a, b)
    # print(g)
    # print(a * b)

    return a * b // g


if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(N):
        T = int(input())
        ans = lcm(ans, T)

    print(ans)
N,T = map(int,input().split())
T = list(map(int,input().split()))
tot = 0
for i in range(1,N):
    d = T[i]-T[i-1]
    if d>T:
        tot += T
    else:
        tot += d
print(tot+T)

### FIXED CODE ###

N,T = map(int,input().split())
A = list(map(int,input().split()))
tot = 0
for i in range(1,N):
    d = A[i]-A[i-1]
    if d>T:
        tot += T
    else:
        tot += d
print(tot+T)
N, M = list(map(int, input().split()))
D = list(map(int, input().split()))
UB = [list(map(int, input().split())) for _ in range(M)]

R = {}
for i in range(M):
  a, b = UB[i]
  a -= 1
  b -= 1
  if a not in R: R[a] = [[b, i]]
  else: R[a].append([b, i])
  if b not in R: R[b] = [[a, i]]
  else: R[b].append([a, i])

DD = [[0] * 2 for _ in range(N)]
for i in range(N):
  DD[i][0] = D[i]
  DD[i][1] = i
DD.sort()
L = [0] * N
H = [0] * M
LL = [-1] * N
for i in range(N):
  h, x = DD[i]
  if L[x] == 0:
    if LL[x] == -1:
      if x not in R: exit()
      for n, m in R[x]:
        LL[n] = x
        if D[n] == D[x] or L[n] != 0:
          H[m] = h
          if L[n] == 1:
            L[n] = 1
            L[x] = 2
          else:
            L[n] = 2
            L[x] = 1
          break
      else:
        print(-1)
        exit()
    else:
      n, m = R[x][LL[x]]
      H[m] = h
      if L[n] == 1:
        L[n] = 1
        L[x] = 2
      else:
        L[n] = 2
        L[x] = 1

t = ""
for i in range(N):
  if L[i] == 1:
    t += "B"
  else:
    t += "W"
print(t)
for i in range(M):
  if H[i] == 0:
    print(10 ** 9)
  else:
    print(H[i])


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))
D = list(map(int, input().split()))
UB = [list(map(int, input().split())) for _ in range(M)]

LL = [[-1] * 2 for _ in range(N)]
for i in range(M):
  a, b = UB[i]
  a -= 1
  b -= 1
  if D[a] < D[b]:
    LL[b] = [a, i]
  elif D[a] > D[b]:
    LL[a] = [b, i]
  else:
    LL[a] = [b, i]
    LL[b] = [a, i]

DD = [[0] * 2 for _ in range(N)]
for i in range(N):
  DD[i][0] = D[i]
  DD[i][1] = i
DD.sort()
L = [0] * N
H = [0] * M

for i in range(N):
  h, x = DD[i]
  if L[x] == 0:
    if LL[x][0] == -1:
      print(-1)
      exit()
    else:
      n, m = LL[x]
      H[m] = h
      if L[n] == 1:
        L[n] = 1
        L[x] = 2
      else:
        L[n] = 2
        L[x] = 1

for i in range(N):
  if L[i] == 1:
    L[i] = "B"
  else:
    L[i] = "W"
print("".join(list(map(str, L))))
for i in range(M):
  if H[i] == 0:
    print(10 ** 9)
  else:
    print(H[i])
A = input()
B = input()
 
if A > B:
  max = A + A - 1
  print(max)
elif B > A:
  max = B + B - 1
  print(max)
elif A == B:
  max = A + B
  print(max)

### FIXED CODE ###

A,B = map(int,input().split())
 
if A > B:
  max = A + A - 1
  print(max)
elif B > A:
  max = B + B - 1
  print(max)
elif A == B:
  max = A + B
  print(max)
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1

### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
arr.sort()
ans = arr[n//2] - arr[n//2-1]
print(ans)
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,m=map(int,input().split())
    L=-INF; R=INF
    for _ in range(m):
        l,r=map(int,input().split())
        L=max(L,l)
        R=min(R,r)
    print(max(R-L+1),0)
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,m=map(int,input().split())
    L=-INF; R=INF
    for _ in range(m):
        l,r=map(int,input().split())
        L=max(L,l)
        R=min(R,r)
    print(max(R-L+1,0))
resolve()
n,m=map(int,input().split())
lst=[list(map(int,input().split()))]
for i in range(n-1):
    a=list(map(int,input().split()))
    x=0
    for j in range(len(lst)):
        if x > m :break
        if lst[j][0] > a[0]:
            lst.insert(j,a)
            break
        x+=lst[j][1]
        
ans=0
num=0
for i in lst:
    if i[1]+num>=m:
        ans+=i[0]*(m-num)
        break
    ans+=i[0]*i[1]
    num+=i[1]
print(ans)

### FIXED CODE ###

H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-H*w-h*W+h*w)
n,m=map(int,input().split())
ans=0
ch=list(map(int,input().split()))
ch.sort()
sum=0
i=0
while sum<m:
  sum+=ch[ans]
  ans+=1
  if sum > m:
    ans-=1
    break
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
ans=0
ch=list(map(int,input().split()))
ch.sort()
if m>sum(ch):
  print(n-1)
else:
  sum=0
  i=0
  while sum<m and ans!=n:
    sum+=ch[ans]
    ans+=1
    if sum > m:
      ans-=1
      break
  print(ans)
N,M=map(int,input().split())
if N>=2:
    n=(N*(N-1))/2
if M>=2:
    m=(M*(M-1))/2
a=n+m
print(a)

### FIXED CODE ###

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

s=N*M
m=N+M

d=(m*(m-1))/2

print(int(d-s))
import sys
sys.setrecursionlimit(sys.getrecursionlimit()*100)
n = int(input())
g = [[] for _ in range(n+1)]
for _ in range(n-1):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)
a = []
def f(i, p):
    a.append(i)
    if i == n:
        return True
    for j in g[i]:
        if j != p:
            if f(j, i):
                return True
    a.pop()
f(1,0)
m = (len(a)+1) // 2
def h(i, j, p):
    if i == j:
        return 1
    return 1 + sum(h(k, j, i) for k in g[i] if k != p)
if h(1, a[m], 0) > h(n, a[m-1], 0):
    print("Fennec")
else:
    print("Snuke")


### FIXED CODE ###

import sys
sys.setrecursionlimit(sys.getrecursionlimit()*1000)
n = int(input())
g = [[] for _ in range(n+1)]
for _ in range(n-1):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)
a = []
def f(i, p):
    a.append(i)
    if i == n:
        return True
    for j in g[i]:
        if j != p:
            if f(j, i):
                return True
    a.pop()
f(1,0)
m = (len(a)+1) // 2
def h(i, j, p):
    if i == j:
        return 1
    return 1 + sum(h(k, j, i) for k in g[i] if k != p)
if h(1, a[m], 0) > h(n, a[m-1], 0):
    print("Fennec")
else:
    print("Snuke")
ab = input().split()
a = ab[0]
b = ab[1]

if (a + b) % 2 == 0:
  print (a + b) // 2
else:
  "IMPOSSIBLE"

### FIXED CODE ###

ab = input().split()
a = int(ab[0])
b = int(ab[1])
 
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")
a=input()
b=input()
print(b+a)

### FIXED CODE ###

a,b=map(str,input().split())
print(b+a)
n=int(input())
l=list(set([int(input()) for d in range(n)]))  
a=l[0]
sd=0
for i in l[1:]:
  for h in range(min(i,a)+1)[:0:-1]:
    if (a%h,i%h)==(0,0):sd=h,break
  a=a*i//sd
print(a)

### FIXED CODE ###

n=int(input())
l=list(set([int(input()) for d in range(n)]))  
a=l[0]
def gcd(a,s):
  a,s=min(a,s),max(a,s)
  if a==0:return s
  else:return gcd(s%a,a)

for i in l[1:]:
  a=a*i//gcd(a,i)
print(a)
n = int(input())
a = [int(i) - 1 for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

result = 0
for i in range(n):
  result += b[a[i]]
  if i > 1 and a[i-1] + 1 = a[i]:
    result += c[a[i-1]]
    
print(result)

### FIXED CODE ###

n = int(input())
a = [int(i) - 1 for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

result = 0
for i in range(n):
  result += b[a[i]]
  if i > 0 and a[i-1] + 1 == a[i]:
    result += c[a[i-1]]
    
print(result)
N,K=map(int,input().split())
H=list(map(int,input().split()))
dp=[0 for i in range(N)]
def calcmin(n,d):
  dp=dp[n-d]+abs(H[n-d]-H[n])
  for q in range(d):
    if dp>dp[n-(d-q)]+abs(H[n-(d-q)]-H[n]):
      dp=dp[n-(d-q)]+abs(H[n-(d-q)]-H[n])
  return dp
for i in range(K):
  dp[i]=dp[0]+abs(H[0]-H[i])
  for j in range(i-1):
    if dp[i]>dp[j]+abs(H[j]-H[i]):
      dp[i]=dp[j]+abs(H[j]-H[i])
for i in range(K,N):
  dp[i]=calcmin(i,K)
print(dp[N-1])

### FIXED CODE ###

N,K=map(int,input().split())
H=list(map(int,input().split()))
dp=[0 for i in range(N)]
def calcmin(n,d):#インデックスがnのノードまでいくための最小コスト（最大移動距離はd）
  p=dp[n-d]+abs(H[n-d]-H[n])
  for q in range(d):
    if p>dp[n-(d-q)]+abs(H[n-(d-q)]-H[n]):
      p=dp[n-(d-q)]+abs(H[n-(d-q)]-H[n])
  return p
for i in range(min(K,N)):
  dp[i]=calcmin(i,i)
for i in range(K,N):
  dp[i]=calcmin(i,K)
print(dp[N-1])
n = int(input())
k = int(input())
if n>=10:
  print(k)
else:
  print(k-(100*(10-n)))

### FIXED CODE ###

n,k = map(int,input().split())
if n >= 10:
    print(k)
else:
    print(k+(100*(10-n)))
import collections
w = list(input())
c = collections.Counter(w)
print("Yes") if all([i % 2 == 0 for i in list(c)]) else print("No")

### FIXED CODE ###

import collections
w = list(input())
c = collections.Counter(w)
print("Yes") if all([i % 2 == 0 for i in c.values()]) else print("No")
N, M = map(int, input().split())
a = [int(i) for i in input().split()]

dic = {}
dic[1] = 2
dic[2] = 5
dic[3] = 5
dic[4] = 4
dic[5] = 5
dic[6] = 6
dic[7] = 3
dic[8] = 7
dic[9] = 6

ls = [-1]*8
dp = [-1]*(N+1)
dp[0] = 0
for i in a:
  j = dic[i]
  if ls[j]<i:
    ls[j] = i

tag = []
for i in range(len(ls)):
  if ls[i]!=-1:
    tag += [i]
for i in range(N+1):
  for j in tag:
    s = max(dp[i+j]*10+ls[j], dp[i+j])

print(dp[N])

### FIXED CODE ###

n,m=map(int,input().split())
A=list(map(int,input().split()))
L=[0,2,5,5,4,5,6,3,7,6]
dp=[0]+[-1]*n
for i in range(n+1):
  for a in A:
    if i+L[a]<=n:
      dp[i+L[a]]=max(dp[i+L[a]],dp[i]*10+a)
print(dp[n])
a = input()
b = input()

print(int(a) * int(b))

### FIXED CODE ###

[a, b] = [int(x) for x in input().split()]
print(a * b ,(a + b) * 2)
n,m,x = map(int,input().split())
books = [list(map(int, input().split())) for _ in range(n)]

ans = []

for i in range( 2 ** n):
    total = [0] * (m + 1)
    for j in range(n):
        if (i >> j) & 1:
            total = [total[k] + books[j][k] for k in range(m+1)]

    over = True
    for j in range(1, m+1):
        if total[j] < x:
            over = False
    if over:
        ans.append(total[0])

if len(ans) > 0:
    print(min(ans))
else:
    print('-1')


### FIXED CODE ###

s=input()
t=input()

print('Yes' if s==t[:-1] else 'No')
N,M = map(int,input().split())
if N<10:
  print(a+(100*(10-N)))
 else:
  print(M)

### FIXED CODE ###

N,M = map(int,input().split(" "))
if N<10:
  print(M+(100*(10-N)))
else:
  print(M)
import sys

input = sys.stdin.readline

N, M = map(int, input().split())
L, R, D = [None] * M, [None] * M, [None] * M
for i in range(M):
    L[i], R[i], D[i] = map(int, input().split())

x = {}
if M > 0:
    x[L[0]] = 0
ans = 'Yes'
for l, r, d in zip(L, R, D):
    if l in x and r in x:
        if x[r] - x[l] != d:
            ans = 'No'
            break
    elif l in x:
        x[r] = x[l] + d
    elif r in x:
        x[l] = x[r] - d
    else:
        raise Exception
print(ans, x)


### FIXED CODE ###

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


class WeightedUnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.diff_weight = [0 for i in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            root = self.find(self.par[x])
            self.diff_weight[x] += self.diff_weight[self.par[x]]
            self.par[x] = root
            return root

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def union(self, x, y, w):
        w += self.weight(x)
        w -= self.weight(y)
        x = self.find(x)
        y = self.find(y)
        if x != y:
            self.par[y] = x
            self.diff_weight[y] = w

    def weight(self, x):
        self.find(x)
        return self.diff_weight[x]

    def diff(self, x, y):
        return self.weight(y) - self.weight(x)


uf = WeightedUnionFind(N)
ans = 'Yes'
for _ in range(M):
    L, R, D = map(int, input().split())
    L -= 1
    R -= 1
    if uf.is_same(L, R):
        if uf.diff(L, R) != D:
            ans = 'No'
            break
    else:
        uf.union(L, R, D)
print(ans)
import numpy as np

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

diff = np.diff(h)
max_list = []
min_list = []

sign = 1
for i, d in enumerate(diff):
    if d > 0 and sign == -1:
        sign = 1
        min_list.append(h[i])

    if d < 0 and sign == 1:
        sign = -1
        max_list.append(h[i])
if diff[-1] > 0:
    max_list.append(h[-1])


def add(val, max_list, min_list):
    if len(max_list) > 1:
        min_val = min(min_list)
        split_index = min_list.index(min_val)+1
        return min_val-val + \
            add(min_val, max_list[:split_index], min_list[:split_index-1]) + \
            add(min_val, max_list[split_index:], min_list[split_index:])
    else:
        return max_list[0]-val


print(add(0, max_list, min_list))


### FIXED CODE ###

import numpy as np

N = int(input())
h = [0]+list(map(int, input().split()))+[0]

diff = np.diff(h).tolist()
max_list = []
min_list = []

sign = 1
for i, d in enumerate(diff):
    if d > 0 and sign < 0:
        sign = d
        min_list.append(h[i])

    if d < 0 and sign > 0:
        sign = d
        max_list.append(h[i])


def add(val, max_list, min_list):
    if len(max_list) > 1:
        min_val = min(min_list)
        split_index = min_list.index(min_val)+1
        return min_val-val + \
            add(min_val, max_list[:split_index], min_list[:split_index-1]) + \
            add(min_val, max_list[split_index:], min_list[split_index:])
    else:
        return max_list[0]-val


if max(h) == 0:
    print(0)
else:
    print(add(0, max_list, min_list))
H,W = map(int,input().split())
L = []


for _ in range(H):
    s=input()
    l=[]
    for x in s:
        l.append(x)
    for x in l:
        if x == ".":
            pass
        else:
            L.append(l)
            break
delete=[]
for i in range(W):
    cnt = 0
    for j in range(len(L)):
        if L[j][i]  == '.':
            cnt += 1
        else:
            cnt = 0
    if cnt == len(L):
        delete.append(i)
for i in delete:
    for j in range(len(L)):
        del L[j][i]
for x in L:
    for y in x:
        print(y,end="")
    print()


### FIXED CODE ###

H,W = map(int,input().split())
L = []


for _ in range(H):
    s=input()
    l=[]
    for x in s:
        l.append(x)
    for x in l:
        if x == ".":
            pass
        else:
            L.append(l)
            break
delete=[]
cou=0
for i in range(W):
    cnt = 0
    for j in range(len(L)):
        if L[j][i]  == '.':
            cnt += 1
        else:
            cnt = 0
    if cnt == len(L):
        delete.append(i-cou)
        cou+=1
for i in delete:
    for j in range(len(L)):
        del L[j][i]

for x in L:
    for y in x:
        print(y,end="")
    print()
N=int(input())
S=input()
A=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','t','u','v','w','x','y','z']
A=[i.upper() for i in A]
print(A)
S=list(S)
for i, a in enumerate(S):
    S[i]=A.index(a)+N
    if S[i]>26:
        S[i]=S[i]-26
    S[i]=A[S[i]]

print("".join(S))

### FIXED CODE ###

N=int(input())
S=input()
A=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
A=[i.upper() for i in A]
##print(A)
S=list(S)
for i, a in enumerate(S):
    S[i]=A.index(a)+N
    if S[i]>25:
        S[i]=S[i]-26
    S[i]=A[S[i]]

print("".join(S))
import sys
input = sys.stdin.readline


def dfs(v, x, G, X, visited, ans):
    visited[v] = True
    ans[v] = x
    # print(visited)

    for nv in G[v]:
        if visited[nv]:
            continue
        dfs(nv, x+X[nv], G, X, visited, ans)


def main():
    N, Q = map(int, input().split())
    G = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        G[a-1].append(b-1)
        G[b-1].append(a-1)
    X = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        X[p-1] += x
    # print(G)
    # print(X)
    
    visited = [False]*N
    ans = [0]*N
    dfs(0, X[0], G, X, visited, ans)
    print(' '.join(list(map(str, ans))))
    

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(300000)


def dfs(v, x, G, X, visited, ans):
    visited[v] = True
    ans[v] = x
    # print(visited)

    for nv in G[v]:
        if visited[nv]:
            continue
        dfs(nv, x+X[nv], G, X, visited, ans)


def main():
    N, Q = map(int, input().split())
    G = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        G[a-1].append(b-1)
        G[b-1].append(a-1)
    X = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        X[p-1] += x
    # print(G)
    # print(X)
    
    visited = [False]*N
    ans = [0]*N
    dfs(0, X[0], G, X, visited, ans)
    print(' '.join(list(map(str, ans))))
    

if __name__ == '__main__':
    main()
n=int(input())
dat = list(map(int, input().split()))

boolean flag=True
int count = 0

while flag==True:
     for i in range(n):
         if dat[i]%2==1:
             flag=False
              break
          else:
              dat[i] = dat[i]/2
       count = count+1

print(count)
         


 
      
      
             


    
    
     
                

         
           




### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
import sys

print(sys.arg[1])

### FIXED CODE ###

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

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, H = LI()
    ab = []
    for i, _ in enumerate(range(N)):
        _ab = LI()
        ab.append((*_ab, i))
    a_max, b_max, a_max_i = sorted(ab, key=lambda x:x[0])[-1]
    ab = sorted(ab, key=lambda x:x[1])[::-1]
    cnt = 0
    # bが強い順
    for a, b, i in ab:
        if b < a_max:
            # 投げない
            break
        if i == a_max_i:
            # 最強の剣はとっとく
            continue
        else:
            H -= b
            cnt += 1
    # aが最強の剣で倒してから投げる
    cnt += (math.ceil((H - b_max) / a_max) + 1)
    print(cnt)
main()



### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, H = LI()
    ab = []
    for i, _ in enumerate(range(N)):
        _ab = LI()
        ab.append((_ab[0], _ab[1], i))
    a_max, b_max, a_max_i = sorted(ab, key=lambda x:x[0])[-1]
    ab = sorted(ab, key=lambda x:x[1])[::-1]
    cnt = 0
    i = 0

    while i < N and H > 0:
        a, b, ken_i = ab[i]
        if b < a_max:
            break
        H -= b
        cnt += 1
        i += 1

    if H > 0:
        cnt += (math.ceil(H / a_max))

    print(cnt)
    
main()
a, b = map(int. input().split())
s = list(input())
if s[a] == '-' and len(s) == (a+b):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b = map(int, input().split())
s = list(input())
num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
if s[a] == '-' and len(s) == (a+b+1) and s.count('-')==1:
    print('Yes')
else:
    print('No')
A, B = int(input().split())
if 2*B >= A:
  print(0)
else:
  print(A-(2*B))

### FIXED CODE ###

A, B = list(map(int, input().split())) 
if 2*B >= A:
  print(0)
else:
  print(A-(2*B))