Harryxun/stf_run huggingface dataset:
N,T=map(int,input().split())
li = [list(map(int,input().split())) for i in range(N)]
t_cost=[T - li[i][1] for i in range(N)]
if(all(x < 0 for x in t_cost)):
  print('TLE')
else:
  t_cost_1=[]
  for i in range(N):
    if(t_cost[i]>=0):
      t_cost_1.append(i)
    else:
  print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))

### FIXED CODE ###

N,T=map(int,input().split())
li = [list(map(int,input().split())) for i in range(N)]
#print(li)
t_cost=[T - li[i][1] for i in range(N)]
#print(t_cost)
if(all(x < 0 for x in t_cost)):#時間内Tに帰宅不可能な場合
  print('TLE')
else:#時間内に帰宅できる場合に最小コストのものを出力
  t_cost_1=[]
  for i in range(N):
    if(t_cost[i]>=0):
      t_cost_1.append(i)
    else:continue
  #print(t_cost_1)
  print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))
n = int(input())
s = [map(int,input().split()) for i in range(n)]
t,x,y = (0,0,0)
for next_pos in s:
    t_next,x_next,y_next = next_pos
    dist = abs(x_next - x) + abs(y_next - y)
    dt = t_next - t
    if dist > t_next - t:
        print('No')
        break
    elif dt % 2 == dist % 2:
        t,x,y = t_next,x_next,y_next
    else:
        print('No')
        break
else:
    print('Yes')

### FIXED CODE ###

a,b = map(int,input().split())
if (a*b) % 2 == 0:
  print('Even')
else:
  print('Odd')
def solve():
    n = int(input())
    ans = [-1] * (n + 1)
    li = [[] for _ in range(n + 1)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        li[u].append((v, w))
        li[v].append((u, w))
    def f(i, ans, c):
        if li[i] == []:
            return
        for u, w in li[i]:
            if ans[u] == -1:
                if w % 2 == 0:
                    ans[u] = c
                    f(u, ans, c)
                else:
                    ans[u] = c ^ 1
                    f(u, ans, c ^ 1)
    for i in range(1, n):
        if li[i] != [] and ans[i] == -1:
            ans[i] = 0
            f(i, ans, 0)
    print(*ans[1:], sep="\n")
solve()


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
def solve():
    n = int(input())
    ans = [-1] * (n + 1)
    li = [[] for _ in range(n + 1)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        li[u].append((v, w))
        li[v].append((u, w))
    def f(i, ans, c):
        if li[i] == []:
            return
        for u, w in li[i]:
            if ans[u] == -1:
                if w % 2 == 0:
                    ans[u] = c
                    f(u, ans, c)
                else:
                    ans[u] = c ^ 1
                    f(u, ans, c ^ 1)
    for i in range(1, n):
        if li[i] != [] and ans[i] == -1:
            ans[i] = 0
            f(i, ans, 0)
    print(*ans[1:], sep="\n")
solve()
#!/usr/bin/env pypy3


def get_line():
    return input()


def get_tokens():
    return get_line().split()


def get_ints():
    return [int(_) for _ in get_tokens()]


def main():

    n, = get_ints()
    A, = get_ints()
    B, = get_ints()
    print('Hello World' if n == 1 else A + B)

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env pypy3


def get_line():
    return input()


def get_tokens():
    return get_line().split()


def get_ints():
    return [int(_) for _ in get_tokens()]


def main():

    n, = get_ints()
    if n == 1:
        print('Hello World')
    else:    
        A, = get_ints()
        B, = get_ints()
        print(A+B)
        
if __name__ == '__main__':
    main()
a = int(input())
b = int(input())

if (a*b) % 2 == 0:
    print("Even")

else:
    print("Odd")


### FIXED CODE ###

x,y = map(int,input().split())

if (x*y) % 2 == 0:
    print("Even")

else:
    print("Odd")
import fractions

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

print(A * B // fractions.gcd(a, b))



### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
#include <stdio.h>
#include <iostream>
using namespace std;

int N;
int A[18];

long long rec(int l, int r, long long xl, long long xr) {
    if (r - l == 1) {
        return 0;
    }
    
    long long ret = (long long) 1e18;
    for (int i = l + 1; i < r; i++) {
        long long tmp = A[i] * (xl+xr) + rec(l, i, xl, xl+xr) + rec(i, r, xl+xr, xr);
        ret = min(ret, tmp);
    }
    return ret;
}

int main() {    
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    
    cout << rec(0, N - 1, 1, 1) + A[0] + A[N - 1];
    
}

### FIXED CODE ###

# ikatakosさんの提出を見てlru_cacheなるものを知った。
# まだまだ知らないことがたくさんありますね。

from functools import lru_cache

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

@lru_cache(maxsize=None)
def rec(l, r, xl, xr) :
    if l + 1 == r :
        return 0
    
    return min(rec(l, m, xl, xl+xr)+rec(m, r, xl+xr, xr)+A[m]*(xl+xr) for m in range(l+1, r))
    
print(A[0] + rec(0, N-1, 1, 1) + A[N-1])
N = int(input())
for i in range(N):
    n,k = map(int,input().split())
    L = list(map(int,input().split()))
    if n <= k:
        print(0)
    else:
        A = []
        for j in range(1,N):
            A.append(L[i]-L[i-1])
        A.sort()
        A.reverse()
        S = L[N-1]-L[0]
        for l in range(k-1):
            S -= A[l]
        print(S)


### FIXED CODE ###

N = int(input())
for i in range(N):
    n,k = map(int,input().split())
    L = list(map(int,input().split()))
    if n <= k:
        print(0)
    else:
        A = []
        for j in range(1,n):
            A.append(L[j]-L[j-1])
        A.sort()
        A.reverse()
        S = L[n-1]-L[0]
        for l in range(k-1):
            S -= A[l]
        print(S)
import sys
from itertools import product
readline = sys.stdin.readline

def check1(A):
    K = max(A)
    table = [-1]*(K+1)
    for i in range(Q):
        table[A[i]] = i
    
    if -1 in table:
        return False
    if any(t1-t2 < 0 for t1, t2 in zip(table, table[1:])):
        return False
    return True

INF = 10**9+7
def check2(A):
    stack = []
    used = set()
    for a in A[::-1] + list(range(M)):
        if a not in used:
            used.add(a)
            stack.append(a)
    
    C = dict()
    for i in range(M):
        C[stack[i]] = i
    
    table = [0]*N + [INF]
    for a in A[::-1]:
        if table[C[a]] < table[C[a]-1]:
            table[C[a]] += 1
    
    zero = stack.index(0)
    if all(t2 > t1 for t1, t2 in zip(stack[zero:], stack[zero+1:])):
        for a in stack[zero:]:
            table[C[a]] = N
    

    return  all(t >= N or t == 0 for t in table)

N, M = map(int, readline().split())
Q = int(readline())
A = list(map(lambda x: int(x)-1, readline().split()))

ans = 'Yes'
if not check1(A):
    A = [0]*N + A
    if not check2(A):
        ans = 'No'
print(ans)

### FIXED CODE ###

import sys
readline = sys.stdin.readline

import sys
from itertools import product
readline = sys.stdin.readline

def check1(A):
    K = max(A)
    table = [-1]*(K+1)
    for i in range(Q):
        table[A[i]] = i
    
    if -1 in table:
        return False
    if any(t1-t2 < 0 for t1, t2 in zip(table, table[1:])):
        return False
    return True

INF = 10**9+7
def check2(A):
    stack = []
    used = set()
    for a in A[::-1] + list(range(M)):
        if a not in used:
            used.add(a)
            stack.append(a)
    
    C = dict()
    for i in range(M):
        C[stack[i]] = i
    
    table = [0]*M + [INF]
    for a in A[::-1]:
        if table[C[a]] < table[C[a]-1]:
            table[C[a]] += 1
    
    used = set()
    ch = []
    for i in range(M):
        if table[i] < N:
            break
        ch.append(stack[i])
        used.add(stack[i])
    for i in range(M):
        if i not in used:
            used.add(i)
            ch.append(i)
    
    return stack == ch

N, M = map(int, readline().split())
Q = int(readline())
A = list(map(lambda x: int(x)-1, readline().split()))

ans = 'Yes'
if not check1(A):
    if not check2(A):
        ans = 'No'
print(ans)
r, c = map(int, input().split())
table = [[*cc, sum(cc)] for cc in (list(map(int, input().split())) for _ in range(r))]
table.append(list(map(sum, zip(*table))))
for line in table:
    print(*line)

### FIXED CODE ###

r, c = map(int, input().split())
table = [cc + [sum(cc)] for cc in (list(map(int, input().split())) for _ in range(r))]
table.append(list(map(sum, zip(*table))))
for line in table:
    print(*line)
a = input()
a = int(a)

print(a * a * pi, 2* a * pi)


### FIXED CODE ###

import math

a = float(input())

print(a*a*math.pi, 2*a*math.pi)
n = int(input())
A = [map(int,input().split())]
acm1 = 0
acm2 = 0
ans1 = 0
ans2 = 0
for i, a in enumerate(A):
  acm1 += a
  acm2 += a
  if(i%2==1):
    if(acm1>=0):
      ans1 += acm1 + 1
      acm1 = -1
    if(acm2<=0):
      ans2 += -acm2 + 1
      acm2 = 1
  else:
    if(acm1<=0):
      ans1 += -acm1 + 1
      acm1 = 1
    if(acm2>=0):
      ans2 += acm2 + 1
      acm2 = -1
print(min(ans1, ans2))
    
    
  

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
acm1 = 0
acm2 = 0
ans1 = 0
ans2 = 0
for i, a in enumerate(A):
  acm1 += a
  acm2 += a
  if(i%2==1):
    if(acm1>=0):
      ans1 += acm1 + 1
      acm1 = -1
    if(acm2<=0):
      ans2 += -acm2 + 1
      acm2 = 1
  else:
    if(acm1<=0):
      ans1 += -acm1 + 1
      acm1 = 1
    if(acm2>=0):
      ans2 += acm2 + 1
      acm2 = -1
print(min(ans1, ans2))
N = int(input())
X = str(input())
X10 = int(X,2)
one_num = X.count("1")



for i in range(N):
    target = int(X[i])
    if target == 0:
        ones = one_num + 1
        plus = pow(2,N-i-1,ones)
        
    else:
        ones = one_num-1
        plus = -pow(2,N-i-1,ones)
        
    Xnow = X10+plus
    count = 0
    if Xnow == 0:
        print(count)
        continue
    else:
        Xnow = Xnow%ones
        count+=1
        while Xnow > 0:
            Xnow2 = bin(Xnow)
            ones = Xnow2.count("1")
            Xnow = Xnow%ones
            count+=1
        print(count)


### FIXED CODE ###

N = int(input())
x2 = input()
x10 = int(x2, 2)
popc =  x2.count("1")
#print("x10", x10)
#print("popc", popc)
#popc: Nを2進数で表したときの1の個数

#以下で1つフリップさせた時の入力に対する余りを事前に計算
if popc <= 1:
    xp = x10%(popc+1)
    xm = 0
else:
    xp = x10%(popc+1)
    xm = x10%(popc-1)
#print("xp", xp)
#print("xm", xm)

#以下でフリップさせた場所のみを計算
for i in range(N):
    if x2[i] == "1":
        if popc == 1:
            print(0)
            continue
        tmp = (xm - pow(2, N-i-1, popc-1))%(popc-1)
    else:
        tmp = (xp + pow(2, N-i-1, popc+1))%(popc+1)
        
    #print("tmp", tmp)
    ans = 1
    while tmp > 0:
        tmp %= bin(tmp).count("1")
        ans += 1
    print(ans)
a, b = input(), input()
max(a + b, a - b, a * b)

### FIXED CODE ###

a, b = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b))
x=int(input())
y=int(input())
z=int(input())
print(z)
print(x)
print(y)

### FIXED CODE ###

n=list(input().split(" "))
print(n[2],end=" ")
print(n[0],end=" ")
print(n[1],end=" ")
a,b = map(int, input().split())

print(a*a -b )

### FIXED CODE ###

n = int(input())
k = int(input())

print(n*n -k)
# coding: utf-8
# Your code here!
n,k=map(int,input().rstrip().split())
p=list(map(int,input().rstrip().split()))
c=list(map(int,input().rstrip().split()))
def find(start,now,up,max,sum,count,flag):
    if start==now:
        flag+=1
    if start==now and flag==2:
        return [max,sum,count]
    elif count==up:
        return [max,sum,count]
    else:
        count+=1
        sum+=c[p[now-1]-1]
        if max<=sum:
            max=sum
        return find(start,p[now-1],up,max,sum,count,flag)
kara=[]
if n>k:
    for i in range(1,n+1):
        kara.append(find(i,i,k,c[p[i-1]-1],0,0,0)[0])
    result=max(kara)
else:
    for i in range(1,n+1):
        m=find(i,i,n,c[p[i-1]-1],0,0,0)
        if m[1]<=0:
            kara.append(m[0])
        else:
            w=k%m[2]
            if w==0:
                w=m[2]
            spe=find(i,i,w,c[p[i-1]-1],0,0,0)[0]
            if m[1]+spe>m[0]:
                kara.append(m[1]*(k-w)//m[2]+spe)
            else:
                kara.append(m[1]*((k-w)//m[2]-1)+m[0])
    result=max(kara)
print(result)


### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
c=list(map(int,input().split()))
now=-100000000000
for i in range(1,n+1):
    retu=[]
    sum1=0
    sum2=0
    sum3=0
    max1=-1000000000000
    max2=-1000000000000
    flag=0
    x=i
    while(flag==0):
        x=p[x-1]
        sum1+=c[x-1]
        retu.append(c[x-1])
        if x==i:
            flag=1
    if len(retu)>=k: #操作回数が周期未満
        for j in range(k):
            sum2+=retu[j]
            if sum2>max1:
                max1=sum2
        ans=max1
    elif sum1<=0: #周期和が負
        for j in range(len(retu)):
            sum3+=retu[j]
            if sum3>max2:
                max2=sum3
        ans=max2
    else:
        w=k%len(retu)
        
        if w==0:
            w=len(retu)
        for j in range(w):
            sum2+=retu[j]
            if sum2>max1:
                max1=sum2
        for j in range(len(retu)):
            sum3+=retu[j]
            if sum3>max2:
                max2=sum3
        if max1+sum1>max2:
            ans=sum1*(k-w)//len(retu)+max1
        else:
            ans=sum1*((k-w)//len(retu)-1)+max2
    now=max(now,ans)
print(now)
n=int(input())
if n<=6:
    print(1)
    exit()
if n<=11:
    print(2)
    exit()
ans=(n//11)*2
mod=n%11
if 6<=mod<=10 :
    print(an+2)
elif mod==0:
    print(ans)
else:
    print(ans+1)

### FIXED CODE ###

x=int(input())
if x%11>6:
    ans=(x//11)*2+2
elif x%11==0:
    ans=(x//11)*2
else:
    ans=(x//11)*2+1
print(ans)
N = int(input())
a = input().split()
for i in range(0,N):
	a[i] = int(a[i])
a.sort()
t = 0
flag = 1
sum_a = 0
for i in range(0,N):
	sum_a += a[i]
	if sum_a*2 < a[i+1]:
		t = i+1
		flag = 0
	if flag == 0:
		break
			
print(N-t)

### FIXED CODE ###

N = int(input())
a = input().split()
for i in range(0,N):
	a[i] = int(a[i])
a.sort()
t = 0
flag = 1
sum_a = 0
for i in range(0,N-1):
	sum_a += a[i]
	if sum_a*2 < a[i+1]:
		t = i+1

			
print(N-t)
nums = int(input().split())
nums.sort()
print(nums[0], nums[1], nums[2])

### FIXED CODE ###

(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
 
if a < b < c:
    print(a, b, c)
elif a < c < b:
    print(a, c, b)
elif b <= a <= c:
    print(b, a, c)
elif b <= c <= a:
    print(b, c, a)
elif c <= a <= b:
    print(c, a, b)
else:
    print(c, b, a)
n=int(input())
m=10**5+1
for j in range()
for i in range(n,m):
  for j in range(2,int(n**0.5//1+1)):
    i % i==0:
      print(i)
      break

### FIXED CODE ###

n=int(input()) 
m=10**5+4 
for i in range(n,m): 
	lst=[] 
	if all(( i % j) !=0 for  j in range(2,int(n**0.5//1+1))): 
		print(i) 
		break
import math

a,b,c,d = map(int,input().split())
t = 0
l = b-a+1

c_count = (b // c) - ((a-1) // c)

d_count = (b // d) - ((a-1) // d)

lc = (c*d) // math.gcd(c,d)
lc_count = (b // lc) - ((a-1) // lc)

print(l-c_count-d_count+lc_count)

### FIXED CODE ###

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

a,b,c,d = map(int,input().split())
t = 0
l = b-a+1

c_count = (b // c) - ((a-1) // c)

d_count = (b // d) - ((a-1) // d)

lc = (c*d) // gcd(c,d)
lc_count = (b // lc) - ((a-1) // lc)

print(l-c_count-d_count+lc_count)
import bisect

X, N = map(int, input().split())
P = set(map(int, input().split()))

A = {i for i in range(1,101)}

S = list(A - P)

T = bisect.bisect_left(S, X)

if T == 0:
    print(S[0])
elif X - S[T-1] > S[T] - X:
    print(S[T])
else:
    print(S[T-1])


### FIXED CODE ###

import bisect

X, N = map(int, input().split())
P = set(map(int, input().split()))

A = {i for i in range(102)}

S = list(A - P)

T = bisect.bisect_left(S, X)

if T == 0:
    print(S[0])
elif X - S[T-1] > S[T] - X:
    print(S[T])
else:
    print(S[T-1])
s = raw_input()
print (s.count("+") - s.count("-"))


### FIXED CODE ###

s = raw_input()
print (s.count("+") - s.count("-"))
def f(v, i):
    s,n,m = 4 * 2 ** v - 3, 2 * 2 ** v - 1, (s + 1) / 2
    return 0 if i < 1 or i > s else [0, f(v - 1, i - 1), n / 2 + 1, f(v - 1, i - s / 2 - 1) + n / 2 + 1, n, 1][(i > 1) + (i >= m) + (i > m) + (i >= s) + (v == 0) * 3]

print f(*map(int, raw_input().split()))

### FIXED CODE ###

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N, X = map(int, raw_input().split())

sz = [1] * (N + 1)
num = [1] * (N + 1)

for i in range(N):
    sz[i + 1] = sz[i] * 2 + 3
    num[i + 1] = num[i] * 2 + 1

def func(lv, id):
    mid = (sz[lv] + 1) / 2
    if lv == 0:
        return 1
    if id == 1:
        return 0
    if id == mid:
        return (num[lv] - 1) / 2 + 1
    if id == sz[lv]:
        return num[lv]
    if 1 < id < mid:
        return func(lv - 1, id - 1)
    if mid < id < sz[lv]:
        return func(lv - 1, id - sz[lv - 1] - 2) + num[lv - 1] + 1

print func(N, X)
a, b = map(int, input().split())

area = (a - 1) * (b - 1)
prin(area)

### FIXED CODE ###

a, b = map(int, input().split())

area = (a - 1) * (b - 1)
print(area)
X,Y=input().split()

print(X*Y//1)

### FIXED CODE ###

X,Y=input().split() 
Y=Y.replace(".","")
print(int(X)*int(Y)//100)
N = int(input().strip())
ar = [N*[] for _ in range(N)]
for row in range(N):
  ar[row] = list(input().strip())

count = N*[0]
missing = [N*[] for _ in range(N)]
fullestRow = -1
maxCount = 0
for row in range(N):
  for col in range(N):
    if ar[row][col] == '#':
      count[row] += 1
    else:
      missing[row].append(col)
  if count[row] > maxCount:
    maxCount = count[row]
    fullestRow = row

if maxCount == 0:
  print(-1)
else:
  req = 0
  for row in range(N):
    if ar[row][fullestRow] == '#':
      found = True
      break
  if not found:
    req += 1
  req += N - maxCount
  
  for col in range(N):
    for row in range(N):
      if ar[row][col] == '.':
        req+=1
        break
  print(req)

### FIXED CODE ###

N = int(input().strip())
ar = [N*[] for _ in range(N)]
for row in range(N):
  ar[row] = input().strip()

fullestRows = []
maxCount = 0
for row in range(N):
  count = 0
  for col in range(N):
    if ar[row][col] == '#':
      count += 1
  if count > maxCount:
    maxCount = count
    fullestRows = [row]
  elif count == maxCount:
    fullestRows.append(row)

if maxCount == 0:
  print(-1)
else:
  found = False
  req = 0
  for fr in fullestRows:
    for row in range(N):
      if ar[row][fr] == '#':
        found = True
        break
    if found:
      break
  if not found:
    req += 1
  req += N - maxCount
  
  for col in range(N):
    for row in range(N):
      if ar[row][col] == '.':
        req+=1
        break
  print(req)
def solve( p, t ):
	global isExist
	global n
	global A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )

isExist = [False]*2001 
n = int( raw_input() )
A = map( int, raw_input().split( " " ) )
q = int( raw_input() )
M = map( int, raw_input().split( " " ) )
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )

### FIXED CODE ###

def solve( p, t ):
	global isExist, n, A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )
	else:
		return

isExist = [False]*2001 
n = int( input() )
A = [ int( val ) for val in input().rstrip().split( ' ' ) ]
q = int( input() )
M = [ int( val ) for val in input().rstrip().split( ' ' ) ]
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )
int("A")
int("N")
if N%500<=A:
  print ("Yes")
else:
  print("No")

### FIXED CODE ###

a = int(input())
n = int(input())
if((a%500)<=n):
  print("Yes")
else:
  print("No")
size = int(input())
nums = list(map(int, input().split()))

# size = 3
# nums = [1, 2, 3]

numu = list(set(nums))
if len(numu) == 1 and numu[0] == 0:
  print("Yes")
  quit()

if len(numu) == 2 and nums.count(0) == 1 \
    and nums.count(0) * 3 == size:
  print("Yes")
  quit()

if not nums.count(numu[0]) == nums.count(numu[1]) == nums.count(numu[2]):
  print("No")
  quit()

if len(numu) == 3:
  if numu[0] ^ numu[2] == numu[1] \
      and numu[1] ^ numu[0] == numu[2] \
      and numu[2] ^ numu[1] == numu[0]:
    print("Yes")
    quit()

print("No")


### FIXED CODE ###

size = int(input())
nums = list(map(int, input().split()))
# 
# size = 6
# nums = [0, 2, 2, 0, 2, 2]

numu = list(set(nums))
if len(numu) == 1 and numu[0] == 0:
  print("Yes")
  quit()


if len(numu) == 2 \
    and nums.count(0) != 0 \
    and nums.count(0) * 3 == size:
  print("Yes")
  quit()

if len(numu) == 3:
  if nums.count(0) == 1:
    print("No")
    quit()

  if not nums.count(numu[0]) == nums.count(numu[1]) == nums.count(numu[2]):
    print("No")
    quit()

  if numu[0] ^ numu[2] == numu[1] \
      and numu[1] ^ numu[0] == numu[2] \
      and numu[2] ^ numu[1] == numu[0]:
    print("Yes")
    quit()

print("No")
import numpy as np
from numba import njit

N = int(input())

sushi_count = {1:0, 2:0, 3:0}
for a in map(int, input().split()):
    sushi_count[a] += 1

expv = np.array([[[-1.0] * (sushi_count[3]+1) for i in range(N-sushi_count[1]+1)] for i in range(N+1)])

expv[0][0][0] = 0.0

@njit
def get_expv(i, j, k):
    result = 0.0
    if expv[i][j][k] != -1:
        return expv[i][j][k]
    nonlp = 1.0 - (N-i-j-k) / N
    result += 1
    if i != 0:
        result += get_expv(i-1, j, k) * (i / N)
    if j != 0:
        result += get_expv(i+1, j-1, k) * (j / N)
    if k != 0:
        result += get_expv(i, j+1, k-1) * (k / N)
    result /= nonlp
    expv[i][j][k] = result
    return result

print(get_expv(sushi_count[1], sushi_count[2], sushi_count[3]))

### FIXED CODE ###

import numpy as np
from numba import njit


@njit('f8(i8,i8,i8,i8,f8[:,:,:])')
def get_expv(N, i, j, k, expv):
    result = 0.0
    if expv[i][j][k] != -1:
        return expv[i][j][k]
    nonlp = 1.0 - (N-i-j-k) / N
    result += 1
    if i != 0:
        result += get_expv(N, i-1, j, k, expv) * (i / N)
    if j != 0:
        result += get_expv(N, i+1, j-1, k, expv) * (j / N)
    if k != 0:
        result += get_expv(N, i, j+1, k-1, expv) * (k / N)
    result /= nonlp
    expv[i][j][k] = result
    return result

def main():
    N = int(input())

    sushi_count = {1:0, 2:0, 3:0}
    for a in map(int, input().split()):
        sushi_count[a] += 1
    sh = (N+1, N-sushi_count[1]+1, sushi_count[3]+1)
    expv = np.full(sh, -1.0)

    expv[0][0][0] = 0.0

    print(get_expv(N, sushi_count[1], sushi_count[2], sushi_count[3], expv))

if __name__ == '__main__':
    main()
n=int(input())
x=input()
if bin(x).count("1")==0:
  for i in x:
    print(1)
else:
  print(0)

### FIXED CODE ###

n=int(input())
x=input()
chk0=chk1=chk2=0
b=x.count("1")
if b==1 and x=="1":
    print(0)
    exit()
elif b==1:
    for i in range(n):
        if i==n-1: print(2)
        elif x[i]=="0": print(1)
        else: print(0)
    exit()
for i,j in enumerate(x[::-1]):
    if j=="1":
        chk1+=pow(2,i,b+1)
        if b>1: chk2+=pow(2,i,b-1)
        else: chk2=0
l=[]
for i,j in enumerate(x[::-1]):
    if b: a1=pow(2,i,b+1)
    else: a1=1
    if b>1: a2=pow(2,i,b-1)
    else: a2=1
    if j=="0":
        t=chk1+a1
    else:
        if b>1: t=chk2+b-1-a2
        else: t=0
    ans,f=0,1
    while t:
        if f:
            if j=="0": t%=(b+1)
            else: t%=(b-1)
            f=0
        else:
            t%=bin(t).count("1")
        ans+=1
    l.append(ans)
for i in l[::-1]:
    print(i)