Harryxun/stf_run huggingface dataset:
n = int(input())
alist = list(map(int,input().split()))
anslist =[]
def act(i,nowlist):
    now = i+1
    ai =alist[i]
    s = 1
    multisum =0
    while now * s <= n:
        multisum += nowlist[now*s-1]
        s +=1
    if multisum%2 ==ai:
        anslist.append(0)
    if multisum%2 !=ai:
        anslist.append(1)
    if i == n-1:
        return 
    act(i+1,nowlist)
    
numlist = [0 for i in range(n)]
act(0,numlist)
print(anslist.count(1))
if anslist.count(1)>0:
    indexes = [i+1 for i, x in enumerate(anslist) if x == 1]
    [print(i,end=" ") for i in indexes]
        

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
ans =[0 for _ in range(n)]
count=0
for i in range(n-1,-1,-1):
    if sum([ans[j]for j in range(i,n,i+1)])%2!=l[i]:
        ans[i]=1
        count +=1

print(count)
[print(i+1,end=" ") for i,x in enumerate(ans) if x==1]
n,k = map(int,input().split())
a = list(map(int,input().split()))
d2 = []
hist=[-1]*n
hist[0] = 0
cur = 1
d2.append(1)
st_idx = 0
rp_lgt = 0
for i in range(n):
  cur = a[cur-1]
  if hist[cur-1] >= 0 :
     d2.append(cur)
     st_idx = hist[cur-1] 
     rp_lgt = i - st_idx
     break
  else:
    d2.append(cur)
    hist[cur-1] = i
wk = k - st_idx
md = wk % rp_lgt
if k <= st_idx:
  ans = d2[k]
else:
  ans = d2[md+st_idx]
print(ans)


### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
d2 = []
hist=[-1]*(n+1)
hist[0] = 0
cur = 1
d2.append(1)
st_idx = 0
rp_lgt = 1
for i in range(n):
  cur = a[cur-1]
  if hist[cur-1] >= 0 :
     d2.append(cur)
     st_idx = hist[cur-1]
     rp_lgt = i - st_idx + 1 
     break
  else:
    d2.append(cur)
    hist[cur-1] = i + 1
wk = k - st_idx
md = wk % rp_lgt
if k < st_idx:
  ans = d2[k]
else:
  ans = d2[md+st_idx]
print(ans)
x1, y1, x2, y2, = map(int, input().split())
abs_x = abs(x2-x1)
abs_y = abs(y2-y1)


if x1 >= x2 and y2 > y1:
    x3 = x2-abs_x-1
    x4 = x1-abs_x-1
    y3 = y2+abs_y-1
    y4 = y1+abs_y-1

elif x1 >= x2 and y1 > y2:
    x3 = x2-abs_x+1
    x4 = x1-abs_x+1
    y3 = y2+abs_y-1
    y4 = y1+abs_y-1

elif x2 >= x1 and y2 > y1:
    x3 = x2-abs_x+1
    x4 = x1-abs_x+1
    y3 = y2+abs_y+1
    y4 = y1+abs_y+1

elif x2 >= x1 and y1 > y2:
    x3 = x2-abs_x-1
    x4 = x1-abs_x-1
    y3 = y2+abs_y+1
    y4 = y1+abs_y+1
print(x3, y3, x4, y4)

### FIXED CODE ###

x1, y1, x2, y2, = map(int, input().split())
x = x2-x1
y = y2-y1

x3 = x2-y
y3 = y2+x
x4 = x1-y
y4 = y1+x

print(x3, y3, x4, y4)
def calculate(num,i):
		num.sort(reverse=True)
		if num[0] == num[3]:
			return "NA"
		L = num[0] * 1000 + num[1] * 100 + num[2] * 10 + num[3]
		S = num[3] * 1000 + num[2] * 100 + num[1] * 10 + num[0]
		new_N = L - S
		if new_N == 6174:
			return i + 1
		return calculate(map(int,str(new_N)),i+1)
ans = []
while(1):
	input_str = raw_input()
	if input_str == '0000':
		break
	elif input_str == '6174':
		ans.append(0)
	else:
		num = map(int,input_str)
		ans.append(calculate(num,0))
for value in ans:
	print value

### FIXED CODE ###

def calculate(num,i):
		num.sort(reverse=True)
		if num[0] == num[3]:
			return "NA"
		L = num[0] * 1000 + num[1] * 100 + num[2] * 10 + num[3]
		S = num[3] * 1000 + num[2] * 100 + num[1] * 10 + num[0]
		new_N = L - S
		if new_N == 6174:
			return i + 1
		input_str = "%04d" % new_N
		return calculate(map(int,input_str),i+1)
ans = []
while(1):
	input_str = raw_input()
	if input_str == '0000':
		break
	elif input_str == '6174':
		ans.append(0)
	else:
		num = map(int,input_str)
		ans.append(calculate(num,0))
for value in ans:
	print value
n,k = map(int,input().split())
ai = [int(i) for i in input().split()]

tmp = format(k, 'b')

lng = len(tmp)

li = [0]*(lng)
ai_li = [0]*lng

for i in range(n):
    ai_li[i] = format(ai[i], '0'+str(lng)+'b')

add_enb_flag = False

for i in range(lng):
    cnt = 0
    for j in range(n):
        if ai_li[j][i] == '1':
            cnt += 1
    #print(cnt,i)
    if cnt >= (n+1) // 2:
        if tmp[i] == "1":
            add_enb_flag = True
        li[i] = 0
    elif tmp[i] == '1' or add_enb_flag == True:
        li[i] = 1
    else:
        li[i] = 0
k_m = 0
bai = 1

for i in range(lng):
    k_m += li[n-i-1] *bai
    bai *= 2

#print(k_m,ai_li,tmp,li)
        
ans = 0
for i in range(n):
    ans += k_m^ai[i]
    
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
ai = [int(i) for i in input().split()]

tmp = format(max(k,max(ai)), 'b')

lng = len(tmp)
tmp = format(k, '0'+str(lng)+'b')

li = [0]*(lng)
ai_li = [0]*(n)

for i in range(n):
    #print(i)
    #print(ai[i])
    #print(format(ai[i], '0'+str(lng)+'b'))
    ai_li[i] = format(ai[i], '0'+str(lng)+'b')

add_enb_flag = False

for i in range(lng):
    cnt = 0
    for j in range(n):
        if ai_li[j][i] == '1':
            cnt += 1
    #print(cnt,i)
    if cnt >= (n+1) // 2:
        if tmp[i] == "1":
            add_enb_flag = True
        li[i] = 0
    elif tmp[i] == '1' or add_enb_flag == True:
        li[i] = 1
    else:
        li[i] = 0
k_m = 0
bai = 1

for i in range(lng):
    k_m += li[lng-i-1] *bai
    bai *= 2

#print(k_m,ai_li,tmp,li)
        
ans = 0
for i in range(n):
    ans += k_m^ai[i]
    
print(ans)
import math
N = int(input())
D = [int(x) for x in input().split()]

num = [0] * 10000

maxd = 0
for d in D:
    num[d] += 1
    maxd = max(d, maxd)

if D[0] != 0 or num[0] != 1:
    ans = 0
else:
    ans = 1
    for i in range(1, maxd):
        for _ in range(num[i+1]):
            ans *= num[i]%998244353
        ans %= 998244353
        if ans == 0:
            break
print(ans%998244353)


### FIXED CODE ###

import math
N = int(input())
D = [int(x) for x in input().split()]

num = [0] * 100000

maxd = 0
for d in D:
    num[d] += 1
    maxd = max(d, maxd)

if D[0] != 0 or num[0] != 1:
    ans = 0
else:
    ans = 1
    for i in range(1, maxd):
        for _ in range(num[i+1]):
            ans *= num[i]%998244353
        ans %= 998244353
        if ans == 0:
            break
print(ans%998244353)
n,k,x,y=[int(input()) for i in range(4)]
print(k*x+y*(n-k))

### FIXED CODE ###

s=str(input())
n=str(len(s)-2)
print(s[0]+str(n)+s[-1])
n=int(input())
A=list(map(int,input().split()))
ans="APPROVED"
for i in A:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            ans="DENIED"
           
            break
print(ans)
            


### FIXED CODE ###

l=set(map(int,input().split()))
if len(l)==2:
    print("Yes")
else:
    print("No")
a = int(input())

    print(a + a*a + a*a*a)

### FIXED CODE ###

a = int(input())
print(a + a * a + a * a * a)
n=int(input())

for i in range(n):
    if i+i**2>=2*n:
        check=i
        break

total=(1+check)*check//2
out=total-n

for i in range(1,check+1):
    if i!=out:
        print(i)


### FIXED CODE ###

n=int(input())


if n==1:
    print(1)
    exit()
    
if n==2:
    print(2)
    exit()
    
for i in range(n):
    if i+i**2>=2*n:
        check=i

        break

total=(1+check)*check//2
out=total-n

for i in range(1,check+1):
    if i!=out:
        print(i)
H,W,N = tuple(map(int,input().split()))

r,c = tuple(map(int,input().split()))

Ta = input()
Ao = input()

def convert(ch):
    if ch=="R":
        return (0,1)
    elif ch=="L":
        return (0,-1)
    elif ch=="U":
        return (1,0)
    else:
        return (-1,0)
# 青木くんのターンになったらやばいマップを逆方向に1動かして重ねた部分がやばくなる
import numpy as np
yabaiMap = np.zeros((H+2,W+2))
yabaiMap[1:-1,1:-1] = np.ones((H,W))

for idx,(t,a) in enumerate(zip(reversed(Ta),reversed(Ao))):
    if idx != 0:
        
        dy,dx = convert(a)
        # 動かした方向にやばくない場所があれば復帰する
        # つまり フィルタをかけてしまえばいいので，元の場所が0かつ動かした先が1であればよい，その場所を1にする
        yabaiMap[1:-1,1:-1] += (1-yabaiMap)[1:-1,1:-1] * yabaiMap[1+dy:H+1+dy,1+dx:W+1+dx]
        #print("A",a,yabaiMap)
    dy,dx = convert(t)
    yabaiMap[1:-1,1:-1] *= yabaiMap[1+dy:H+1+dy,1+dx:W+1+dx]
    
    #print("T",t,yabaiMap)
print("YES" if yabaiMap[r,c] ==1 else "NO")

### FIXED CODE ###

H, W, N = tuple(map(int, input().split()))
r, c = tuple(map(int, input().split()))
r-=1
c-=1
Ta = input()
Ao = input()
L, R, U, D = -1, W, -1, H
for idx, (t, a) in enumerate(zip(reversed(Ta), reversed(Ao))):
    if idx != 0:
        if(a == "R"):
            L = max(L-1,-1)
        elif(a == "L"):
            R = min(R+1,W)
        elif(a == "U"):
            D = min(D+1,H)
        else:
            U = max(U-1,-1)
            
    #print("A{} L{} c{} R{} U{} r{} D{}".format(a,L,c,R,U,r,D))
    if(t == "R"):
        R = max(R-1,-1)
    elif(t == "L"):
        L = min(L+1,W)
    elif(t == "U"):
        U = min(U+1,H)
    else:
        D = max(D-1,-1)
    #print("T{} L{} c{} R{} U{} r{} D{}".format(t,L,c,R,U,r,D))
    if (R-L-1)*(D-U-1) <= 0:
        print("NO")
        quit()
print("YES" if L < c < R and U < r < D else "NO")
import math
A, B = map(int, input().split())
float_var = A*B
print(math.floor(float_var))

### FIXED CODE ###

def resolve():
    A, B = input().split()
    ans = int(A)*int(B[0])*100+int(A)*int(B[2:])
    print(str(ans)[:-2] if len(str(ans)) >= 3 else "0")
resolve()
while True:
    a = input()
    a = a.split(" ")
    b = []
    for i in a:
        b.append(int(i))
    if b[0] == 0 and b[1] == 0 and b[2] == 0 and b[3] == 0 and b[4] == 0:
        break
    c = input()
    c = c.split(" ")
    d = []
    for i in c:
        d.append(int(i))
    if b[4] == d[0]:
        print(0)
        continue
    ans = 2
    for i in d:
        for e in range(10000):
            x = (b[1] * b[4] + b[2]) % b[3]
            if x == i:
                b[4] = x
                break
            b[4] = x
            ans = ans + 1
    if ans >= 10001:
        ans = -1
    print(ans)



### FIXED CODE ###

while True:

    n, a, b, c, x = map(int, input().split(" "))

    if n == 0 and a == 0 and b == 0 and c == 0 and x == 0:
        break

    y = list(map(int, input().split(" ")))

    ans = 0
    i = 0
    
    while ans <= 10000:
        if x == y[i]:
            i += 1

        if i == n:
            break
        x = (a * x + b) % c
        ans += 1
    if ans >= 10001:
        ans = -1
    print(ans)
N = int(input())
cards = list(map(int, input().split()))
l.sort(reverse=True)
print(sum(cards[0::2]) - sum(cards[1::2]))

### FIXED CODE ###

N = int(input())
cards = list(map(int, input().split()))
cards.sort(reverse=True)
print(sum(cards[0::2]) - sum(cards[1::2]))
s = input()
k = int(input())

print(s[1])

### FIXED CODE ###

s = input()
k = int(input()) - 1


for i in range(len(s)):
    if s[i] != "1" or i == k:
        break

print(s[i])
n=int(input())
a = list(map(int,input().split()))
q=int(input())
bc = [list(map(int, input().split())) for l in range(q)]
cnt=[0]*(n+1)
Sum=0
for i in range(n):
  cnt[a[i]]+=1
  Sum+=a[i]
for i in range(q):
  Sum+=(bc[i][1]-bc[i][0])*cnt[bc[i][1]]                           
  cnt[bc[i][1]]+=cnt[bc[i][0]]
  cnt[bc[i][0]]=0
  print(Sum)

### FIXED CODE ###

n=int(input())
a = list(map(int,input().split()))
q=int(input())
bc = [list(map(int, input().split())) for l in range(q)]
cnt=[0]*100001
Sum=0
for i in range(n):
  cnt[a[i]]+=1
  Sum+=a[i]
for i in range(q):
  Sum+=(bc[i][1]-bc[i][0])*cnt[bc[i][0]]                           
  cnt[bc[i][1]]+=cnt[bc[i][0]]
  cnt[bc[i][0]]=0
  print(Sum)
import math
import heapq
import sys
from collections import Counter
import numpy as np
import datetime

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

a=1/N*((1/2)**math.ceil(math.log2(K)))
sum=0
for n in range(1,N+1):
    if n<K:
        sum+=a*(2**(n-1))
    else:
        sum+=1/N
print(sum)
    

### FIXED CODE ###

import math
import heapq
import sys
from collections import Counter
import numpy as np
import datetime

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

sum=0
for n in range(1,N+1):
    if n<K:
        sum+=1/N*((1/2)**math.ceil(math.log2(K/n)))
    else:
        sum+=1/N
print(sum)
A = int(input())
B = int(input())
C = int(input())
X = int(input())

for a in range(A + 1):
    
    for b in range(B + 1):
        
        for c in range(C + 1):
            
            if(a * 500 + b * 100 + c * 50 == X):
                cnt += 1

print(cnt)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0

for a in range(A + 1):
    
    for b in range(B + 1):
        
        for c in range(C + 1):
            
            if(a * 500 + b * 100 + c * 50 == X):
                cnt += 1

print(cnt)
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
BC = [list(map(int, input().split())) for i in range(M)]
BC = sorted(BC, key=lambda x: -x[1])
i = 0
for B, C in BC:
    for _ in range(B):
        if A[i] < C:
            A[i] = C
            i += 1
        else:
            print(sum(A))
            exit()
print(sum(A))


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
BC = [list(map(int, input().split())) for i in range(M)]
BC = sorted(BC, key=lambda x: -x[1])
i = 0
for B, C in BC:
    for _ in range(B):
        if i < N and A[i] < C:
            A[i] = C
            i += 1
        else:
            print(sum(A))
            exit()
print(sum(A))
while 1:
	x,y = list(map(int,input().split()))
	if x == 0:
		break

	pp = [1,-1,0,0]
	qq = [0,0,1,-1]
	m = []
	for i in range(y):
		m.append(list(input()))
		if '@' in m[-1]:
			ss = m[-1].index('@')
			tt = i
	cnt = 0

	def move (cx,cy):
		global cnt
		if cy >= y or cy < 0 or cx >= x or cx < 0:
			return
		if m[cy][cx] == '.'v or  m[cy][cx] == '@'
			cnt += 1
			m[cy][cx] = '0'
			for i in range(4):
				move(cx + pp[i],cy + qq[i])
	move(ss,tt)
	print(cnt)



### FIXED CODE ###

while 1:
	x,y = list(map(int,input().split()))
	if x == 0:
		break

	pp = [1,-1,0,0]
	qq = [0,0,1,-1]
	m = []
	for i in range(y):
		m.append(list(input()))
		if '@' in m[-1]:
			ss = m[-1].index('@')
			tt = i
	cnt = 0

	def move (cx,cy):
		global cnt
		if cy >= y or cy < 0 or cx >= x or cx < 0:
			return
		if m[cy][cx] == '.' or  m[cy][cx] == '@':
			cnt += 1
			m[cy][cx] = '0'
			for i in range(4):
				move(cx + pp[i],cy + qq[i])
	move(ss,tt)
	print(cnt)
import sys
N,M=map(int,input().split())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
pre = []
pos = []
for ships in grid:
  if ships[0] == 1:
    pre.append(ships[1])
  if ships[1] == N:
    pos.append(ships[0])
pre.sort()
for islands in pre:
  if islands in pos:
    print('POSSIBLE')
    sys.exit()
print('IMPOSSIBLE')


### FIXED CODE ###

import sys
import bisect
N,M=map(int,input().split())
grid = []
for i in range(M):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
pre = []
pos = []
for ships in grid:
  if ships[0] == 1:
    pre.append(ships[1])
  if ships[1] == N:
    pos.append(ships[0])
if pre == [] or pos == []:
  print('IMPOSSIBLE')
  sys.exit()
pre.sort()
pos.sort()
def index(a, x):
    'Locate the leftmost value exactly equal to x'
    i = bisect.bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return 1
    return 0
for nums in pre:
  if index(pos,nums) == 1:
    print('POSSIBLE')
    sys.exit()
print('IMPOSSIBLE')
import sys
import numpy as np
input=sys.stdin.readline
N,K,Q=map(int,input().split())
J=[int(input()) for _ in range(Q)]
for i in range(1,N+1):
    print("Yes" if K-Q+J.count(i)>0 else "No")


### FIXED CODE ###

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

N,K,Q = map(int,input().split())
A = (int(x) for x in sys.stdin.read().split())

score = [K-Q] * (N+1) 
for x in A:
    score[x] += 1

answer = '\n'.join('No' if x <= 0 else 'Yes' for x in score[1:])
print(answer)
import sys
import math
from collections import deque
import copy

N, W = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(N)]
INF = 10 ** 9 + 7
dp = [[INF for _ in range(N * 300 + 1)] for _ in range(N + 1)]

for i in dp:
    i[0] = 0
for i in range(1, wv[0][1]+1):
    dp[1][i] = wv[0][0]

for i in range(2, N + 1):
    for l in range(1, N * 300 + 1):
        if l - wv[i - 1][1] >= 0:
            dp[i][l] = min(dp[i - 1][l], dp[i - 1][l - wv[i - 1][1]] + wv[i - 1][0])
        elif dp[i][l] == 10**9+7:
            dp[i][l] = min(wv[i-1][0], dp[i-1][l])
        else:
            dp[i][l] = dp[i - 1][l]
for i in range(N*300+1):
    if dp[-1][i] <= W < dp[-1][i+1]:
        print(i)
        break


### FIXED CODE ###

import sys
import math
from collections import deque
import copy

INF = 10 ** 9 + 7
N, W = map(int, input().split())
weight = []
value = []
for i in range(N):
    tempW, tempV = map(int, input().split())
    weight.append(tempW)
    value.append(tempV)

dp = [[INF for _ in range(N * 1000 + 1)] for _ in range(N + 1)]
dp[0][0] = 0

for i in range(1, N + 1):
    for l in range(N * 1000 + 1):
        if l - value[i - 1] >= 0:
            dp[i][l] = min(dp[i - 1][l], dp[i - 1][l - value[i - 1]] + weight[i - 1])
        else:
            dp[i][l] = dp[i - 1][l]
for i in range(N * 1000 + 1):
    if dp[N][i] <= W:
        ans = i
print(ans)
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


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

memo = sum(a)

a=a[0]
b=memo-a[0]

ans = abs(a-b)
for i in range(1,n-1):
    a += a[i]
    b -= a[i]

    ans = min(ans,abs(a-b))
    
print(ans)

### FIXED CODE ###

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


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

memo = sum(a)



q=a[0]
b=memo-a[0]

ans = abs(q-b)
for i in range(1,n-1):
    q += a[i]
    b -= a[i]

    ans = min(ans,abs(q-b))
    
print(ans)
n,k=map(int,input().split())
p=list(map(int,input().split()))
ans=[]
for i in range(n-k):
  ans.append(sum(p[i:i+k]))
max_value=max(ans)
max_index=ans.index(max_value)

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
ans=[sum(p[0:k])]
for i in range(1,n-k+1):
  ans.append(ans[i-1]+p[i+k-1]-p[i-1])
max_value=max(ans)
max_index=ans.index(max_value)
total=0
for i in p[max_index:max_index+k]:
  total+=(i+1)/2
print(total)
n = list(input().split())
if n in '9':
	print('Yes')
else:
	print('No')

### FIXED CODE ###

n = input()
if '9' in n:
	print('Yes')
else:
	print('No')
s=input()
s.sort()
if s[0]==s[1] and s[1]!=s[2] and s[2]==s[3]:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

s=input()
t=sorted(s)
u=''.join(t)
if u[0]==u[1] and u[1]!=u[2] and u[2]==u[3]:
  print("Yes")
else:
  print("No")
n = int(input())
x = input()

num_of_1 = x.count("1")

first = int(x, 2)

def f(x):
    if x == 0:
        return 0
    return 1 + f(x % bin(x).count('1'))

if num_of_1 == 1:
    for i in range(n):
        if x[i] == '1':
            print(0)
        elif i == n-1:
            print(2)
        else:
            print(1)
    exit()

first_one, first_zero = first % (num_of_1 - 1), first % (num_of_1 + 1)

for i in range(n):
    if x[i] == "0":
        print(1 + f(first_zero + pow(2, n-i-1, num_of_1 + 1)))
    else:
        print(1 + f(first_one - pow(2, n-i-1, num_of_1 - 1))

### FIXED CODE ###

n = int(input())
x = input()

num_of_1 = x.count("1")

first = int(x, 2)

def f(x):
    if x == 0:
        return 0
    return 1 + f(x % bin(x).count('1'))

if num_of_1 == 1:
    for i in range(n):
        if x[i] == '1':
            print(0)
        elif i == n-1:
            print(2)
        else:
            print(1)
    exit()

first_one, first_zero = first % (num_of_1 - 1), first % (num_of_1 + 1)

for i in range(n):
    if x[i] == "0":
        print(1 + f((first_zero + pow(2, n-i-1, num_of_1 + 1)) % (num_of_1 + 1)))
    else:
        print(1 + f((first_one - pow(2, n-i-1, num_of_1 - 1)) % (num_of_1 - 1)))
n = int(input())
xds = [tuple(map(int, input().split())) for _ in range(n)]
xds.sort()

xds.insert(0, (-1000000001, 2000000004))
n += 1

def make_blocks(i):
    x, d = xds[i]
    right = x + d
    res = []
    nexti = i + 1
    while(nexti < n):
        xn, dn = xds[nexti]
        if xn < right:
            l, lasti = make_blocks(nexti)
            res.append(l)
            nexti = lasti + 1
        else:
            return res, nexti - 1
    return res, n - 1

l, _ = make_blocks(0)

def count(l):
    ans = 1
    for ll in l:
        ans = ans * (1 + count(ll)) % 998244353
    return ans

print(count(l))


### FIXED CODE ###

# hmm...
from sys import setrecursionlimit
setrecursionlimit(10000000)

n = int(input())
xds = [tuple(map(int, input().split())) for _ in range(n)]
xds.sort()

xds.insert(0, (-1000000001, 2000000004))
n += 1

def make_blocks(i):
    x, d = xds[i]
    right = x + d
    res = []
    nexti = i + 1
    while(nexti < n):
        xn, dn = xds[nexti]
        if xn < right:
            l, lasti = make_blocks(nexti)
            res.append(l)
            nexti = lasti + 1
        else:
            return res, nexti - 1
    return res, n - 1

l, _ = make_blocks(0)

def count(l):
    ans = 1
    for ll in l:
        ans = ans * (1 + count(ll)) % 998244353
    return ans

print(count(l))
A,B,C,D = map(int(input().split()))
while A>0 and C>0:
  C-=B
  if C <= 0:
    print("Yes")
  else:
    A-=D
    if A <= 0:
      print("No")


### FIXED CODE ###

A,B,C,D = map(int,input().split())
while A > 0 and C > 0:
    C -= B
    if C <= 0:
        print("Yes")
    else:
        A -= D
        if A <= 0:
            print("No")
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    print(a-1)
else:
    pritn(b-1)

### FIXED CODE ###

s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    a-=1
else:
    b-=1
print(a,b)
# 計算量O(N2M)

N = int(input())

d = list(map(int,input().split()))
d_cnt = [0]*max(d)

for v in d:
    d_cnt[v-1] += 1

M = int(input())

t = list(map(int,input().split()))
t_cnt = [0]*max(t)

for v in t:
    t_cnt[v-1] += 1

if N < M:
    print('NO')
    exit()

for i in range(min(len(d_cnt),len(t_cnt))):
    if t_cnt[i] != 0:
        if d_cnt[i] < t_cnt[i]:
            print('NO')
            exit()

print('YES')


### FIXED CODE ###

# 計算量O(N2M)
import collections
N = int(input())

d = collections.Counter(list(map(int,input().split())))

M = int(input())
t = list(map(int,input().split()))
t_num = t.copy()
t_num = set(list(t_num))
t = collections.Counter(t)

if N < M:
    print('NO')
    exit()

for key in t_num:
    if d[key] < t[key]:
        print('NO')
        exit()
print('YES')