Harryxun/stf_run huggingface dataset:
a,b = int(input().split())
if a <= 9 and b <= 9:
	print(a * b)
else:
	print('-1')	
	

### FIXED CODE ###

a, b = map(int, input().split())
if a <= 9 and b <= 9:
	c = a * b
	print(c)
else:
	print('-1')
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())
c = a * b 
amari = c % 2
if(amari == 1 ){
    print("Odd")
}
else(amari == 0){
    print("Even")
}

### FIXED CODE ###

# -*- coding: utf-8 -*-
a, b = map(int, input().split())
c = a * b 
amari = c % 2
if amari == 1 :
    print("Odd")

elif amari == 0 :
    print("Even")
a=int(input()) #aを整数aの変数として扱う
print(a+a*a+a**3)　#a+a*a+a**3の値を表示する


### FIXED CODE ###

a=int(input())
print(a+a*a+a**3)
numof500 = int(input())
numof100 = int(input())
numof50  = int(input())
moneyneeded = int(input())

counter = 0
for i in range(numof500):
  for j in range(numof100):
  	for k in range(numof50):
      if 500 * i + 100 * j + 50 * k == moneyneeded:
        counter += 1

print(counter)

### FIXED CODE ###

numof500 = int(input())
numof100 = int(input())
numof50  = int(input())
moneyneeded = int(input())
 
counter = 0
for i in range(numof500 + 1):
  for j in range(numof100 + 1):
    for k in range(numof50 + 1):
      if 500 * i + 100 * j + 50 * k == moneyneeded:
        counter += 1
 
print(counter)
o = input()
e = input()

n = len(o)
for i in range(n):
  print(o[i] + e[i], end='')


### FIXED CODE ###

o = list(input())
e = list(input()) + ['']

n = len(o)
for x, y in zip(o, e):
  print(x + y, end='')
#C
S=input()
K=int(input())
num='23456789'
if S[0]!='1':
    print(1)
else:
    n=1
    while True:
        if n==len(S):
            n-=1
            break
        elif S[n]!='1':
            break
        n+=1
if K-1<n:
    print(1)
else:
    print(S[n])

### FIXED CODE ###

#C
S=input()
K=int(input())
num='23456789'
if S[0]!='1':
    print(int(S[0]))
else:
    n=1
    while True:
        if n==len(S):
            n-=1
            break
        elif S[n]!='1':
            break
        n+=1
    if K-1<n:
        print(1)
    else:
        print(int(S[n]))
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A = input()
B = input()
if A>9 or B>9:
    print(":(")
else:
    print("Yay!")


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A, B = map(int, input().split())
if A>=9 or B>=9:
    print(":(")
else:
    print("Yay!")
s = input()
K = int(input())
alphabet = list("abcdefghijklmnopqrstuvwxyz")
result = []

for u in alphabet:
    for i in range(len(s)):
        if s[i] == u:
            for j in range(i + 1, min(i + K + 1, len(s) + 1)):
                result.append(s[i:j])
    if len(result) > K:
        break

result = list(set(result))
result.sort()
# print(result)
# print(len(result))
print(result[K - 1])


### FIXED CODE ###

s = input()
K = int(input())
subs = []
for i in range(0, len(s)):
    for j in range(i + 1, K + i + 1 if i + K <= len(s) else len(s) + 1):
        subs.append(s[i:j])


subs = list(set(subs))

subs.sort()
print(subs[K - 1])
import math

n = int(input())
di = dict()
answer = 0

for i in range(n):
    tmp = str(sorted(input()))
    if di.get(tmp, 0) == 0:
        di[tmp] = 1
    else:
        di[tmp] += 1

for v in di.values():
    if v > 1:
        answer += (math.factorial(v) / 2)
print(answer)




### FIXED CODE ###

import math

n = int(input())
di = dict()
answer = 0

for i in range(n):
    tmp = str(sorted(input()))
    if di.get(tmp, 0) == 0:
        di[tmp] = 1
    else:
        answer += di[tmp]
        di[tmp] += 1

print(answer)
x = int(raw_input())
for i in range(-120 , 120):
  for j in range(-120 , 120):
    if(math.pow(i , 5) - math.pow(j , 5) == x):
      print(i , " " , j)
      break

### FIXED CODE ###

import math
x = int(input())
foo = 0;
for i in range(-120 , 120):
  if foo == 1:
      break;
  for j in range(-120 , 120):
    if(math.pow(i , 5) - math.pow(j , 5) == x):
      print(i , " " , j)
      foo = 1;
      break;
x, y = list(input())

if x > y:
  print('>')
elif x < y:
  print('<')
else:
  print('=')

### FIXED CODE ###

x, y = list(input().split())

if x > y:
  print('>')
elif x < y:
  print('<')
else:
  print('=')
s=input()
t=input()
L=len(s)
l=len(t)
X=[]
for i in range(L-l):
    x=0
    for j in range(l):
        if s[i+j]!=t[j]:
            x+=1
    X.append(x)
print(min(X))

### FIXED CODE ###

s=input()
t=input()
L=len(s)
l=len(t)
X=[]
for i in range(L-l+1):
    x=0
    for j in range(l):
        if s[i+j]!=t[j]:
            x+=1
    X.append(x)
print(min(X))
N = int( input())
s = [ input() for i in range(N)]
M = int(input())
t = [ input() for j in rangwe(M)]

judge = 0
for l in range(N):
  money = s.count(s[l]) - t.count(s[l])
  
  if( judge < money):
    judge = money
  
  else:
    continue
    
print(judge)

### FIXED CODE ###

N = int( input())
s = list()

for i in range(N):
  S = input()
  s.append(S)
  
M = int( input())
t = list()

for j in range(M):
  T = input()
  t.append(T)

  judge = 0
for l in range(N):
  money = s.count(s[l]) - t.count(s[l])
  
  if( judge < money):
    judge = money
  else:
    continue
    
print(judge)
i = int(input())
    seen = set()
    seen.add(i)
    temp = i
    for x in range(0,1000000):
      if(temp%2 == 0):
        temp = temp/2
      else:
        temp = 3*temp+1
      if(temp in seen):
        print(x)
        break
      else:
        seen.add(temp)

### FIXED CODE ###

i = int(input())
seen = set()
seen.add(i)
temp = i
for x in range(2,1000000):
    if(temp%2 == 0):
        temp = temp/2
    else:
        temp = 3*temp+1
    if(temp in seen):
        print(x)
        break
    else:
        seen.add(temp)
n=int(input())

a="abcdefghijklmnopqrstuvwxyz"
aa=list(a)

stra=""
kk=n
for i in range(15):
    ki=kk%26
    if ki!=0:
        stra=aa[ki-1]+stra    
    else:
        stra=aa[26]+stra    
    kk=(kk-ki)//26
#    print(kk,ki,stra)
    if kk==0:
        break
    
print(stra)

### FIXED CODE ###

n=int(input())

a="abcdefghijklmnopqrstuvwxyz"
aa=list(a)

stra=""
kk=n
for i in range(15):
    ki=(kk-1)%26+1
    if ki!=0:
        stra=aa[ki-1]+stra    
    else:
        stra=aa[25]+stra    
    kk=(kk-ki)//26
#    print(kk,ki,stra)
    if kk==0:
        break
    
print(stra)
import math

n, k = map(int, input().split())
if n > k:
	if n+1 >= 2*k:
		for i in range(k):
			j = i+1
			c_blue = (math.factorial(n-k+1))//((math.factorial(j))*(math.factorial(n-k+1-j)))
			c_div = (math.factorial(k-1))//((math.factorial(j-1))*(math.factorial(k-1-j+1)))
			comb = c_blue * c_div
			print(comb % 1000000007)
			
	else :
		for i in range(n-k+1):
			j = i+1
			c_blue = (math.factorial(n-k+1))//((math.factorial(j))*(math.factorial(n-k+1-j)))
			c_div = (math.factorial(k-1))//((math.factorial(j-1))*(math.factorial(k-1-j+1)))
			comb = c_blue * c_div
			print(comb % 1000000007)
		for _ in range(2*k -n -1):
			print(0)
else:
	print(1)
	for i in range(n-1):
		print(0)

### FIXED CODE ###

import collections

s = input()
c = collections.Counter(s)

flag = 0
for i in range(4):
	word = s[i]
	if c[word] != 2:
		flag = 1
		break
	
if flag == 1:
	print("No")
else :
	print("Yes")
a,b,c,k = map(int, input().split())
cards = [1]*a + [0]*b + [-1]*c
print(sum(cards[:k]))

### FIXED CODE ###

a,b,c,k = map(int, input().split())
if k<=a:
    print(k)
elif a<k and k<=a+b:
    print(a)
else:
    print(a-(k-a-b))
import math
N = int(input())
M = int(math.sqrt(N))
i = 1
j = 1
for x in reversed(range(M)):
  if N % x == 0:
    i = x
    j = N // x
    break
print(i+j-2)


### FIXED CODE ###

import math
N = int(input())
M = int(math.sqrt(N))
i = 1
j = 1
for x in reversed(range(M+1)):
  if N % x == 0:
    i = x
    j = N // x
    break
print(i+j-2)
O=input()
E=input()
R=[:len(E)]
print(*[e+r for e,r in zip(E,R)],sep="",end="")
if len(O)!=len(E):
  print(O[-1])

### FIXED CODE ###

O=input()
E=input()
R=O[:len(E)]
print(*[r+e for r,e in zip(R,E)],sep="",end="")
if len(O)!=len(E):
  print(O[-1])
n=int(input())
c=list(map(int,input().split()))
c = collections.Counter(c)
count=0
for x in c:
    if x==c[x]:
        continue
    elif x>c[x]:
        count+=c[x]
    else:
        count=count+(c[x]-x)
print(count)

### FIXED CODE ###

import collections
n=int(input())
c=list(map(int,input().split()))
c = collections.Counter(c)
count=0
for x in c:
    if x==c[x]:
        continue
    elif x>c[x]:
        count+=c[x]
    else:
        count=count+(c[x]-x)
print(count)
a,b=map(int,input().split)
if (a*b)%2:
    print("Odd")
else:
    print("Even")


### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
N, K = map(int,input().split()) # 複数の数字を変数に格納

red = N - K
blue = K
division = 10 ** 9 + 7

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under % division
  
for i in range(K):
    if i > red:
        print("0")
    else:
        tmp_blue = cmb(blue-1,i) % division
        tmp_red = 1
        for j in range(i+1):
            tmp_red = tmp_red * (red+1-j) / (i+1-j) 
        result = int(tmp_blue * tmp_red % division)
        print("{}".format(result))


### FIXED CODE ###

N, K = map(int,input().split()) # 複数の数字を変数に格納

red = N - K
blue = K
division = 10 ** 9 + 7

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under % division
  
for i in range(K):
    if i > red:
        print("0")
    else:
        tmp_blue = cmb(blue-1,i) % division
        tmp_red = cmb(red+1,red-i)
        result = int(tmp_blue * tmp_red % division)
        print("{}".format(result))
N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(s.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
    card_list.append(["H",str(i)])
    card_list.append(["C",str(i)])
    card_list.append(["D",str(i)])
for i in taro_card:
    if i not in card_list:
        lost_list.append(i)
for i in lost_list:
    print("{} {}".format(i[0],i[1]))


### FIXED CODE ###

N=int(input())
s=[input() for i in range(N)]
lost_list=[]
taro_card=[]
card_list=[]
for i in s:
    taro_card.append(i.split())
for i in range(1,14):
    card_list.append(["S",str(i)])
for i in range(1,14):
    card_list.append(["H",str(i)])
for i in range(1,14):    
    card_list.append(["C",str(i)])
for i in range(1,14):    
    card_list.append(["D",str(i)])
for i in card_list:
    if i not in taro_card:
        lost_list.append(i)
for i in lost_list:
    print(i[0]+" "+i[1])
N=int(input())

def liu(i):
    if i==2:
        return 3
    if i==3:
        return 4
    else:
        return liu(i-1)+liu(i-2)

print(liu(N))

### FIXED CODE ###

N=int(input())
lst=[2,1]
for i in range(2,N+1):
    lst.append(lst[i-1]+lst[i-2])
print(lst[N])
a,b=map(int,input().split())
if (a+b)%2==0:
  print(ave(a+b))
  
else:
  print('IMPOSSIBLE')


### FIXED CODE ###

a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
  
else:
  print('IMPOSSIBLE')
import fractions
a,b,c,d=map(int,input().split())

s=c*d//fractions.gcd(c, d)
bk=0
ak=0
ans=0
bc=b//c
ac=a//c    
bd=b//d
ad=a//d
bsa=b//s
asa=a//s
bk=b-bc-bd+bsa
ak=a-ac-ad+asa
ans=bk-ak
if a%c!=0 or a%d!=0 or a%s!=0:
    ans+=1
elif:
  b%c==0 or b%d==0 or b%s==0
else:
  ans=ans
print(ans)

### FIXED CODE ###

import fractions
a,b,c,d=map(int,input().split())
 
s=c*d//fractions.gcd(c, d)
bk=0
ak=0
ans=0
bc=b//c
ac=a//c    
bd=b//d
ad=a//d
bsa=b//s
asa=a//s
bk=b-bc-bd+bsa
ak=a-ac-ad+asa
ans=bk-ak
if a%c==0 or a%d==0 or a%s==0:
    ans=ans
else:
    ans+=1
print(ans)
import numpy as np

N, Q = map(int, input().split())
Child = np.zeros((N, N), np.bool)
X = np.zeros(N, np.int64)
Y = np.zeros(N, np.int64)
for _ in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    Child[a, b] = True
for _ in range(Q):
    p, x = map(int, input().split())
    p -= 1
    X[p] += x


def dfs(u, k):
    Y[u] += k
    for v, flag in enumerate(Child[u, :]):
        if flag:
            dfs(v, k + X[v])


dfs(0, X[0])
print(' '.join(str(y) for y in Y))


### FIXED CODE ###

N, Q = map(int, input().split())
graph = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

C = [0] * (N + 1)
for _ in range(Q):
    p, x = map(int, input().split())
    C[p] += x

se = set([1])
stack = [1]
while stack:
    # print(C)
    x = stack.pop()
    for y in graph[x]:
        if y in se:
            continue
        stack.append(y)
        se.add(y)
        # 親x, 子y
        C[y] += C[x]

print(' '.join(str(i) for i in C[1:]))
from operator import itemgetter
import  numpy as np
import sys

input = sys.stdin.readline
n,m = map(int,input().split())

in_p = []
in_y = []
in_num = [0] * n

p = np.zeros((n,m))
print(p)

for i in range(m):
    a,b = map(int,input().split())
    in_p.append(a)
    in_y.append(b)
    p[a-1,i]= b
    in_num[a-1]+=1

p_sort=np.sort(p,axis=1)
in_num = np.array(in_num)
print(p_sort)
in_num = m - in_num
for i in range(m):
    year=str(in_p[i]).zfill(6)
    a =  np.where(p_sort == in_y[i])
    b = int(a[1] - in_num[int(a[0])]+1 )
    print("{0}{1}".format(year,str(b).zfill(6)))






### FIXED CODE ###

import copy

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

cnt = [0]*(10**5+4)

yy = []
yp = []
for _ in range(m):
    a,b = map(int,input().split())
    a,b = b,a
    yy.append([a,0])
    yp.append([a,b])

inlist = copy.deepcopy(yp)
yp.sort()
yy = dict(yy)

for i in range(m):
    cnt[yp[i][1]]+=1
    yy[yp[i][0]] = cnt[yp[i][1]]

for key,value in inlist:
    print("{:06}{:06}".format(value,yy[key]))
15 10000000000
400000000 1000000000
800000000 1000000000
1900000000 1000000000
2400000000 1000000000
2900000000 1000000000
3300000000 1000000000
3700000000 1000000000
3800000000 1000000000
4000000000 1000000000
4100000000 1000000000
5200000000 1000000000
6600000000 1000000000
8000000000 1000000000
9300000000 1000000000
9700000000 1000000000

### FIXED CODE ###

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

L=[]
for i in range(N):
    x,y=map(int,input().split())
    L.append([x,y])
    
l=L[::-1]
L=[[0,0]]+L
R=[]

for i in range(N):
    R.append([C-l[i][0],l[i][1]])
R=[[0,0]]+R


#print(L)
#print(R)
TS=[0]
TW=[0]
RS=[0]
RW=[0]

for i in range(N):
    TS.append(TS[i]-L[i+1][0]+L[i][0]+L[i+1][1])
    TW.append(TW[i]-2*(L[i+1][0]-L[i][0])+L[i+1][1])
    RS.append(RS[i]-R[i+1][0]+R[i][0]+R[i+1][1])
    RW.append(RW[i]-2*(R[i+1][0]-R[i][0])+R[i+1][1])
    
MTS=[0]
MRS=[0]
for i in range(1,N+1):
    MTS.append(max(MTS[i-1],TS[i]))
    MRS.append(max(MRS[i-1],RS[i]))

ans=0
for i in range(N+1):
    if i>0 and L[i-1][0]*2>C:
        break
    else:
        if ans<TW[i] + MRS[N-i]:
            ans=TW[i] + MRS[N-i]
            
for i in range(N+1):
    if i>0 and R[i-1][0]*2>C:
        break
    else:
        if ans<RW[i]+MTS[N-i]:
            ans=RW[i]+MTS[N-i]
print(ans)
import math

N, Ma, Mb = map(int,input().split())
rate = Ma / Mb
a = [0] * N
b = [0] * N
c = [0] * N
MA = 0
MB = 0
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())
    MA += a[i]
    MB += b[i]

dp = [[[math.inf for i in range(MB+1)] for j in range(MA+1)] for k in range(N+1)]
dp[0][0][0] = 0

for it_N in range(N):
    for it_MA in range(MA+1):
        for it_MB in range(MB+1):
            if it_MA >= a[it_N] and it_MB >= b[it_N]:
                if dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] != math.inf:
                    dp[it_N+1][it_MA][it_MB] = min(dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] + c[it_N], dp[it_N][it_MA][it_MB])
            else:
                dp[it_N+1][it_MA][it_MB]=dp[it_N][it_MA][it_MB]

#    for it_MA in range(MA+1):
#        for it_MB in range(MB+1):
#print(it_N+1,it_MA,it_MB,dp[it_N+1][it_MA][it_MB])

#中身確認
ans = -1
for a in range(1, MA+1):
    for b in range(1, MB+1):
        print(a,b,dp[N][a][b])
        if a/b == rate and dp[N][a][b] != math.inf:
            if ans == -1:
                ans = dp[N][a][b]
            else:
                ans = min([dp[N][a][b], ans])
print(ans)


### FIXED CODE ###

a, b = map(int,input().split())
v = ""
if a == b:
    v = "Draw"
elif a == 1:
    v = "Alice"
elif b == 1:
    v = "Bob"
elif a > b:
    v = "Alice"
else:
    v = "Bob"

print(v)
import math
def combinations_count(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))
 
# 整数の入力
N = int(input())
r = 2
 
print(combinations_count(N, r) * 10**(N-r) % (10**9 +7))

### FIXED CODE ###

# 整数の入力
N = int(input())
 
print((10 ** N - 2* 9 ** N + 8 ** N) % (10 ** 9 + 7))
n, a, b = map(int, input().split())
s = list(input())

result = []
cnt = 0
cnt_b = 0
limit = a + b

for student in s:
    if student == c:
        result.append("No")
    elif (student == "a") & (cnt < limit):
        result.append("Yes")
        cnt += 1
    elif (student == "b") & (cnt < limit) & (cnt_b < b):
        result.append("Yes")
        cnt += 1
        cnt_b += 1
    else:
        result.append("No")
print("\n".join(result))

### FIXED CODE ###

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

result = []
cnt = 0
cnt_b = 0
limit = a + b

for student in s:
    if student == "c":
        result.append("No")
    elif (student == "a") & (cnt < limit):
        result.append("Yes")
        cnt += 1
    elif (student == "b") & (cnt < limit) & (cnt_b < b):
        result.append("Yes")
        cnt += 1
        cnt_b += 1
    else:
        result.append("No")
print("\n".join(result))
N, Q = map(int, input().split())

ab_list = [list(map(int,list(input().split()))) for _ in range(N-1)]  
px_list = [list(map(int,list(input().split()))) for _ in range(Q)]  

graph = [[] for _ in range(N+1)]
point_list = [0] * (N+1)

for a, b in ab_list:
    graph[a].append(b)
    graph[b].append(a)
    
for p, x in px_list:
    point_list[p] += x
    
def add_point(num, root, point):    
    point_list[num] += point   
    for g in graph[num]:
        if g == root:
            continue
        add_point(g, num, point_list[num])

add_point(1, 0, 0)
 
print(*(point_list[1:]))

### FIXED CODE ###

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

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

ab_list = [[] for _ in range(N)]

for _ in range(N-1):
    a, b = map(int, input().split())
    ab_list[a-1].append(b-1)
    ab_list[b-1].append(a-1)
    
px_list = [list(map(int,input().split())) for _ in range(Q)]
ans = [0] * N

for q, x in px_list:
    ans[q-1] += x

def add_point(num, root=-1):
    for c in ab_list[num]:
        if root == c:
            continue
        ans[c] += ans[num]
        add_point(c, num)
        
add_point(0, -1)

print(*ans)
print(x*x*x)


### FIXED CODE ###

x = int(input(''))
print(x*x*x)
N = int(input())
As = [int(input()) for _ in range(N)]
from bisect import bisect_right

def LIS(L):
    dp = [L[0]]
    length = len(L)
    for i in range(1, length):
        print(dp)
        a = L[i]
        if a >= dp[-1]:
            dp.append(a)
        else:
            dp[bisect_right(dp, a)] = a
    return dp

print(len(LIS(As[::-1])))

### FIXED CODE ###

N = int(input())
As = [int(input()) for _ in range(N)]
from bisect import bisect_right
from collections import deque

def LIS(L):
    dp = deque([L[0]])
    length = len(L)
    for i in range(1, length):
        a = L[i]
        if a >= dp[-1]:
            dp.append(a)
        else:
            dp[bisect_right(dp, a)] = a
    return dp

print(len(LIS(As[::-1])))
h,w=[int(i) for i in input().split()]
print(ceil(h/2)*ceil(w/2)+floor(h/2)*floor(w/2))

### FIXED CODE ###

from math import ceil,floor
h,w=[int(i) for i in input().split()]
if h==1 or w==1:
    print(1)
else:
    print(ceil(h*w/4)+floor(h*w/4))
N = int(input())
X = input()
popcount_X = X.count('1')
numX = int(X, 2)
a, b = numX % (popcount_X + 1), numX % (popcount_X - 1)
for i, x in enumerate(X, 1):
    if x == '1' and popcount_X == 1:
        print(0); continue
    ans = 1
    if x == '1':
        temp = b - pow(2, N-i, popcount_X - 1)
    else:
        temp = a + pow(2, N-i, popcount_X + 1)
    while temp:
        p = bin(temp)[2:].count('1')
        temp %= p
        ans += 1
    print(ans)

### FIXED CODE ###

N = int(input())
X = input()
popcount_X = X.count('1')
numX = int(X, 2)
a, b = numX % (popcount_X + 1), numX % (popcount_X - 1) if popcount_X != 1 else 0
for i, x in enumerate(X, 1):
    if x == '1' and popcount_X == 1:
        print(0); continue
    ans = 1
    if x == '1':
        temp = (b - pow(2, N - i, popcount_X - 1)) % (popcount_X - 1)
    else:
        temp = (a + pow(2, N - i, popcount_X + 1)) % (popcount_X + 1)
    while temp:
        p = format(temp, 'b').count('1')
        temp %= p
        ans += 1
    print(ans)
import copy
from collections import deque
from collections import defaultdict

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

line=defaultdict(list)
q=deque
next=deque()

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

#print(line)
    
next.append(1)
a=1
while len(next)!=0:
  q=copy.copy(next)
  next.clear()
  for i in range(len(q)):
    for j in range(len(line[q[i]])):
      if ans[line[q[i]][j]]==-1:
        ans[line[q[i]][j]]=q[i]
      for k in range(len(line[line[q[i]][j]])):
        #print('k',line[line[q[i]][j]][k])
        if ans[line[line[q[i]][j]][k]]==-1:
          #print('append',ans[line[line[q[i]][j]][k]])
          next.append(line[line[q[i]][j]][k])
      
  a+=1
  #print(next)
#print(ans)
if -1 in ans:print('No')
else:print('Yes')

for i in range(2,N+1):  
	print(ans[i])
    

### FIXED CODE ###

import copy
from collections import deque
from collections import defaultdict

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

line=defaultdict(list)
q=deque
next=deque()

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

#print(line)
    
next.append(1)
a=1
while len(next)>0:
  q=copy.copy(next)
  #print(q)
  next.clear()
  while len(q)>0:
    chk=q.popleft()
    #print('qpop',q)
    for i in range(len(line[chk])):
      #print('chk',chk)
      #print('line[chk][i]',line[chk][i])
      if ans[line[chk][i]]==-1:
        ans[line[chk][i]]=chk
        next.append(line[chk][i]) 
  if -1 not in ans:break
  #print('next',next)
#print(ans)
if -1 in ans:print('No')
else:
  print('Yes')
  for i in range(2,N+1):  
    print(ans[i])
N,M,C=map(int,input().split()) 
B=list(map(int,input().split()))
A =[list(map(int,input().split()))for i in range(N)]
ans=0
for i in range(N):
    for j in range(M):
        X+=(A[i][j]*B[j])+C
    if  0 < X:
        ans = ans+1
    else:
        ans = ans
print(ans)
    


### FIXED CODE ###

n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int,input().split()))for i in range(n)]
cnt=0
for i in range(n):
    total=0
    for j in range(m):
        total+=B[j]*A[i][j]
    total+=c
    if 0<total:
        cnt+=1
print(cnt)