Harryxun/stf_run huggingface dataset:
n = int(input()))
for i in range(n):
    M = [0] * n
    u = list(map(int, input().split()))
    v = u[0]
    for j in u[2:]:
        M[v - 1][j - 1] = 1

for i in M:
    print(*i)

### FIXED CODE ###

n = int(input())
M = [[0] * n for i in range (n)]
for i in range(n):
    u = list(map(int, input().split()))
    v = u[0]
    for j in u[2:]:
        M[v - 1][j - 1] = 1

for i in M:
    print(*i)
import sys
from collections import defaultdict
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
import numpy as np

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum
def main():
    n = int(input())
    a = list(map(int, input().split()))
    dic = defaultdict(int)
    a.sort()
    f = seachPrimeNum(max(a))
    ans = 0
    for i in range(n):
        x = a[i]
        if i < n-1 and a[i] == a[i+1]:
            dic[a[i]] = 1
            continue
        flag = 1
        for check in f:
            if check >= int(x**0.5)+1:
                break
            if(x%check==0):
                if dic[check]:
                    flag = 0
                    break
                if dic[x//check]:
                    flag = 0
                    break
        if flag:
            ans += 1
        dic[a[i]] = 1
    print(ans)
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
 
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    ans = 0
    N = max(a)+1
    tab = [1 for _ in range(N)]
    for i in range(n):
        x = a[i]
        if i < n-1 and a[i] == a[i+1]:
            tab[a[i]] = 0
        if tab[x]:
            ans += 1
        for i in range(N):
            if x*i >= N:
                break
            tab[x*i] = 0        
    print(ans)
    
if __name__ == "__main__":
    main()
num = [int(n) for n in input().split()] 
    
s = sum(num[1:num[0]+1])/num[0]
s = round(s)
r = 0
for i in range(1,num[0]+1):
    r += pow(num[i]-s,2)
print(r)

### FIXED CODE ###

import sys

num = []

while True:
    try:
        num.extend([int(n) for n in input().split()])
    except EOFError:
        break
    
s = sum(num[1:num[0]+1])/num[0]
s = round(s)
r = 0
for i in range(1,num[0]+1):
    r += pow(num[i]-s,2)
print(r)
def Amondai(A, B):
	newArray = {1, 2, 3}
    newArray.clear(A)
    newArray.clear(B)
    retern newArray

### FIXED CODE ###

a = int(input())
b = int(input())
print (6 - a - b)
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

satisfaction=0

for i in range(N-1):
    if  A[i]+1==A[i+1]:
        satisfaction+=C[A[i]]+B[i]
 
    
    else:
        satisfaction+=B[i]

print(satisfaction)

### FIXED CODE ###

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

satisfaction=0

for i in range(N):
  satisfaction+=B[A[i]-1]
    
  if  i<=N-2:
      if  A[i]+1==A[i+1]:
          satisfaction+=C[A[i]-1] 
  else:
      pass

print(satisfaction)
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
n = a[0]
Is = []
for i in range(n):
    Ds = list(map(int, a[i+1].split()))
    if Ds[0] == Ds[1]:
        Is.append(i)

Boooo = False
for i in range(len(Is)-2):
    if Is[i] == Is[i+1] and Is[i+1] == Is[i+2]:
        Boooo = True

if Boooo:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

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

Is = []
for i in range(N):
    Ds = a[i]
    if Ds[0] == Ds[1]:
        Is.append(i)

Boooo = False
for i in range(len(Is)-2):
    if Is[i]+1 == Is[i+1] and Is[i+1]+1 == Is[i+2]:
        Boooo = True

if Boooo:
    print("Yes")
else:
    print("No")
# coding: utf-8
# hello worldと表示する
import sys
import numpy
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
pairs=[LI() for i in range(n)]
def pair_revise(x,y,a,b):
    global p
    global q
    #print(x,y,a,b)
    for i in range(max(1,min(floor(x/a),floor(y/b))),max(ceil(x/a),ceil(y/b))+1):
        p,q=a*i,b*i
        if p>=x and q>=y:
            break
    return [p,q]
    #return [x*max(ceil(x/a),ceil(y/b)),y*max(ceil(x/a),ceil(y/b))]
    #for i in range(max(ceil(x/a),ceil(y/b)),):
u,v=pairs[0]
for i in range(n-1):
    u,v=pair_revise(u,v,pairs[i+1][0],pairs[i+1][1])
print(u+v)

### FIXED CODE ###

# coding: utf-8
# hello worldと表示する
import sys
#import numpy
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor,pi,factorial
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

def ceil(x,y):
    return (-1)*((-x)//y)
    
n=I()
pairs=[LI() for i in range(n)]
x,y=1,1
for i in range(n):
    a=pairs[i][0]
    b=pairs[i][1]
    k=max(ceil(x,a),ceil(y,b))
    x,y=a*k,b*k
print(x+y)





'''def pair_revise(x,y,a,b):
    global p
    global q
    i=max(ceil(x/a),ceil(y/b))
    p,q=a*i,b*i
    return p,q
u,v=1,1
for i in range(n):
    u,v=pair_revise(u,v,pairs[i][0],pairs[i][1])
    print(u,v)
print(u+v)'''
n=int(input())
count=0
while n>0:
  count=count+1
  n=n//10
if n=2 or n=4 or n=5 or n=7 or n=9:
  print ("hon")
if n=0 or n=1 or n=6 or n=8:
  print ("pon")
else:
  print("bon")
  

### FIXED CODE ###

n = int(input())
l = int(repr(n)[-1])
if l ==2 or l==4 or l==5 or l==7 or l==9:
    print('hon')
if l==0 or l==1 or l==6 or l==8:
    print('pon')
if l ==3:
    print('bon')
N,M = map(int,input().split())
L = []
R = []
LR = [list(map(int,input().split())) for _ in range(M)]
for i in range(M):
    L.append(LR[i][0])
countL = 0
countL = max(L)
for j in range(M):
    R.append(LR[j][1])
countR = 0
countR = min(R)
if countR >= countL:
    print(0)
else:
    print(countR-countL+1)
    


    



### FIXED CODE ###

A,B = map(int,input().split())
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(int(B/2))
else:
    print("0")
n=int(input())
for i in range(5):
  x.append(int(input()))
a=max(x)
print(n//a+5)


### FIXED CODE ###

import math
n=int(input())
x=[]
for i in range(5):
  x.append(int(input()))
a=min(x)
print(math.ceil(n/a)+4)
#!/usr/bin/env python
import numpy as np

def main():
    N = int(input().strip())
    arr = np.zeros(N, np.int32)
    for i in range(N):
        arr[i] = int(input().strip())
    for i in range(N):
        arr2 = np.copy(arr)
        arr2[i] = 0
        print(arr2.max())


main()


### FIXED CODE ###

#!/usr/bin/env python
import numpy as np

def main():
    N = int(input().strip())
    arr = np.zeros(N, np.int32)
    for i in range(N):
        arr[i] = int(input().strip())
    arr2 = np.sort(arr)[::-1]
    max1, max2 = arr2[0], arr2[1]

    for i in range(N):
        print(max1) if arr[i] != max1 else print(max2)

if __name__ == '__main__':
    main()
import heapq
xs,yx,xt,yt = map(int,input().split())
N = int(input())
l = [[],[xs,yx,0],[xt,yt,0]]
for i in range(N):
  l.append(list(map(int,input().split())))
##距離リスト
d = [[0]*(N+3) for _ in range(N+3)]
for i in range(1,N+3):
  d[i][i] = 0
#O(10**6)
for i in range(1,N+3):
  for j in range(i+1,N+3):
    sa = (l[i][0]-l[j][0])**2 + (l[i][1]-l[j][1])**2
    kyori = max(0,sa**(1/2)-l[i][2]-l[j][2])
    d[i][j] = kyori
    d[j][i] = kyori

md = [float("inf")]*(N+3)
heap = [[d[1][i],i] for i in range(2,N+3)]
heapq.heapify(heap)
for i in range(1,N+3):
  md[i]=d[1][i]
cnt = 0
seen = [False]*(N+3)
seen[1] = True
while cnt != N+1:
  v = heapq.heappop(heap) 
  if seen[v[1]] == False:
    for i in range(1,N+3):
      if md[i] > md[v[1]]+d[i][v[1]]:
        md[i] = md[v[1]]+d[i][v[1]]
        seen[v[1]] = True
        cnt += 1
        heapq.heappush(heap,[md[i],i])
print(md[2])      

### FIXED CODE ###

xs,yx,xt,yt = map(int,input().split())
N = int(input())
l = [[],[xs,yx,0],[xt,yt,0]]
for i in range(N):
  l.append(list(map(int,input().split())))
##距離リスト
d = [[0]*(N+3) for _ in range(N+3)]
for i in range(1,N+3):
  d[i][i] = 0
#O(10**6)
for i in range(1,N+3):
  for j in range(i+1,N+3):
    sa = (l[i][0]-l[j][0])**2 + (l[i][1]-l[j][1])**2
    kyori = max(0,sa**(1/2)-l[i][2]-l[j][2])
    d[i][j] = kyori
    d[j][i] = kyori

md = [float("inf")]*(N+3)
h = [i for i in range(1,N+3)]
for i in range(1,N+3):
  md[i]=d[1][i]
seen = [False]*(N+3)
seen[1] = True
while True:
  #vを出す
  v = -1
  for i in h:
    if seen[i] == False and v == -1:
      v = i
    elif seen[i] == False and md[i] < md[v]:
      v = i
  if v == -1:
    break
  seen[v] = True
  for j in range(1,N+3):
    md[j] = min(md[j],md[v]+d[v][j])
print(md[2])
def read():
    return raw_input()


def write(message):
    import sys
    print(message)
    sys.stdout.flush()


if __name__ == '__main__':
    N = int(read())
    write("ABD" if N > 999 else "ABC")


### FIXED CODE ###

def read():
    return raw_input()


def write(message):
    import sys
    print message
    sys.stdout.flush()


if __name__ == '__main__':
    N = int(read())
    write("ABD" if N > 999 else "ABC")
n = int(input())
A = list(map(int,input().split()))
a = 0
b = 0
for i in range(n):
    if A[i] %2 = 0:
        a +=1
        if A[i] %3= 0 or A[i]%5=0:
            b +=1
if a == b:
    print('APPROVED')
else:
    print('DENIED')

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
a = 0
b = 0
for i in range(n):
    if A[i] %2 == 0:
        a +=1
        if A[i] %3== 0 or A[i]%5==0:
            b +=1
if a == b:
    print('APPROVED')
else:
    print('DENIED')
param = sys.argv

if( len(param) > 1 ):
        print( int(param[1]) ** 3 )
else:
        print("")

### FIXED CODE ###

import sys
p = sys.stdin.readline()
p = int(p)
o = p ** 3
print o
b = []
for i in range(3): 
    a= int(input())
    b.append(a)
print(b[::-1])

### FIXED CODE ###

x , y, z = map(int,input().split())
print('{} {} {}'.format(z,x,y))
from math import factorial
n,k = map(int,input().split())
mod = 10**9 + 7

def a(n,k):
  return factorial(n)//factorial(k)//factorial(n-k)

for i in range(k):
  print(a(n-k+1,i+1)*a(k-1,i)%mod)

### FIXED CODE ###

from math import factorial

def comb(a,b):
    return factorial(a) // factorial(b) // factorial(abs(a-b))

n, k = map(int, input().split())
for i in range(k):
    print(comb(k-1, i) * comb(n-k+1, i+1) % 1000000007)
import sys
input = sys.stdin.readline
import bisect
sys.setrecursionlimit(10**8)

N,Q=map(int,input().split())
S=input().strip()
M=[input().split() for i in range(Q)]

#逆からシミューレション

PLACE=0
flag=0

for now in range(Q-1,-1,-1):
    if M[now][0]==S[PLACE] and M[now][1]=="L":
        PLACE+=1

PLACE2=N-1

for now in range(Q-1,-1,-1):
    if M[now][0]==S[PLACE2] and M[now][1]=="R":
        PLACE2-=1


if PLACE-1>PLACE2+1:
    print(N)
else:
    print(N-(PLACE+(N-1-PLACE2)))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N,Q=map(int,input().split())
S=input().strip()
M=[input().split() for i in range(Q)]

PLACE=-1

for i in range(Q-1,-1,-1):

    if PLACE+1<N and M[i][0]==S[PLACE+1] and M[i][1]=="L":
        PLACE+=1

    elif PLACE>=0 and M[i][0]==S[PLACE] and M[i][1]=="R":
        PLACE-=1

    if PLACE==N:
        print(0)
        sys.exit()

PLACE2=N

for i in range(Q-1,-1,-1):

    if PLACE2-1>=0 and M[i][0]==S[PLACE2-1] and M[i][1]=="R":
        PLACE2-=1

    elif PLACE2<=N-1 and M[i][0]==S[PLACE2] and M[i][1]=="L":
        PLACE2+=1

    if PLACE==-1:
        print(0)
        sys.exit()

print(max(0,N-(PLACE+1+(N-PLACE2))))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:21:33 +0900
#
from collections import deque


def main():
    s_a = input()
    s_b = input()
    s_c = input()
    s_a = [s for s in s_a if s != 'a']
    s_b = [s for s in s_b if s != 'b']
    s_c = [s for s in s_c if s != 'c']
    s_a = deque(s_a)
    s_b = deque(s_b)
    s_c = deque(s_c)
    turn = s_a.popleft()
    ans = -1
    while 1:
        if turn == 'a' and s_a:
            turn = s_a.popleft()
        elif turn == 'b' and s_b:
            turn = s_b.popleft()
        elif turn == 'c' and s_c:
            turn = s_c.popleft()
        elif turn == 'a' and not s_a:
            ans = 0
            break
        elif turn == 'b' and not s_b:
            ans = 1
            break
        elif turn == 'c' and not s_c:
            ans = 2
            break
    if ans == 0:
        print("A")
    elif ans == 1:
        print("B")
    else:
        print("C")




if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:23:14 +0900
#
from collections import deque


def main():
    s_a = input()
    s_b = input()
    s_c = input()
    s_a = [s for s in s_a if s != 'a']
    s_b = [s for s in s_b if s != 'b']
    s_c = [s for s in s_c if s != 'c']
    s_a = deque(s_a)
    s_b = deque(s_b)
    s_c = deque(s_c)
    if not s_a:
        print("A")
        return
    turn = s_a.popleft()
    ans = -1
    while 1:
        if turn == 'a' and s_a:
            turn = s_a.popleft()
        elif turn == 'b' and s_b:
            turn = s_b.popleft()
        elif turn == 'c' and s_c:
            turn = s_c.popleft()
        elif turn == 'a' and not s_a:
            ans = 0
            break
        elif turn == 'b' and not s_b:
            ans = 1
            break
        elif turn == 'c' and not s_c:
            ans = 2
            break
    if ans == 0:
        print("A")
    elif ans == 1:
        print("B")
    else:
        print("C")
    return




if __name__ == "__main__":
    main()
# -*- coding: utf-8 -*-
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(A, B))

### FIXED CODE ###

# -*- coding: utf-8 -*-
# lcm & gcd not math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

print(lcm(A, B))
n=int(input())
a=[int(i) for i in input.split()]
s=0
for i in range(n-1):
    for j in range(i, n):
        s+=a[i]^a[j]
print(s%1000000007)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(60):
  tmp = sum([1 for j in a if (j>>i)&1])
  ans += tmp*(n-tmp)*(2**i)
  ans %= 10**9+7
print(ans)
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")

### FIXED CODE ###

buf = input()
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")
x = a*b
if x%2==0:
    print("Odd")
else:
    print("Even")


### FIXED CODE ###

a,b = map(int,input().split())
if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
# from math import sqrt
# from heapq import heappush, heappop
# from collections import deque
from functools import reduce
# a, b = [int(v) for v in input().split()]


def main():

    mod = 1000000007

    def modpow(n, k, mod):
        if k == 0:
            return 1
        val = modpow(n, k // 2, mod)
        val = (val * val) % mod
        if k % 2 != 0:
            val *= n
        return val

    def modcmb(n, r, mod):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        over = reduce(lambda v1, v2: v1 * v2 % mod, range(n, n-r, -1))
        under = reduce(lambda v1, v2: v1 * v2 % mod, range(1, r+1))
        return over * modpow(under, mod - 2, mod) % mod

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

    count = modpow(2, n, mod)
    count -= modcmb(n, a, mod)
    count -= modcmb(n, b, mod)

    while count < 0:
        count += mod

    print(count % mod)


main()


### FIXED CODE ###

# from math import sqrt
# from heapq import heappush, heappop
# from collections import deque
from operator import mul
from functools import reduce
# a, b = [int(v) for v in input().split()]


def main():

    def modcmb(n, r, mod):
        if r < 0 or r > n:
            return 0
        r = min(r, n - r)
        over = 1
        under = 1
        for i in range(r):
            over = over * (n - i) % mod
            under = under * (i + 1) % mod

#        over = reduce(lambda v1, v2: (v1 * v2) % mod, range(n, n-r, -1))
#        under = reduce(lambda v1, v2: (v1 * v2) % mod, range(1, r+1))
        return (over * pow(under, mod - 2, mod)) % mod

    mod = 1000000007
    n, a, b = map(int, input().split())

    count = pow(2, n, mod) - 1
    count -= modcmb(n, a, mod)
    count -= modcmb(n, b, mod)

    while count < 0:
        count += mod
    print(count % mod)


main()
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())

V = sum(v)
dp = [[float("inf")] * (V + 1) for _ in range(N + 1)]
"""
for j in range(V + 1):
	dp[0][j] = 0
"""
dp[0][0] = 0
# dp[i][j]:i番目までの品物から価値がj以上になるよう選んだときの重さの総和の最小値
for i in range(N):
	for j in range(V + 1):
		# i+1番目を選ぶ場合
		if j - v[i] >= 0:
			dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - v[i]] + w[i])
		# i+1番目を選ばない場合
		dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

# print(dp)

# dp[N][j]がW以下であるようなjの最大値が答えになる
ans = 0
for j in range(V + 1):
	if dp[N][j] <= W:
		ans = j

print(ans)


### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
dp = [float("inf") for _ in range(N)]
dp[0] = 0
for i in range(1, N):
	dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))
	if i > 1:
		dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[N - 1])
inp = input()
a, b = input().split()
a = int(a)
b = float(b)
b100 = int(b*100)
ans100 = a * b100
ans = a/100
print(ans)

### FIXED CODE ###

from math import floor
inp = input()
a, b = inp.split()
b += '00000001'
a = int(a)
b = float(b)
b100 = int(b * 100)
ans100 = a * b100
ans = ans100 // 100
print(ans)
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  a=s-k-x
  a=0 if a < 0
  for y in range(a,k+1):
    if x + y > s:
      break
    for z in range(k+1):
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break

print(count)

### FIXED CODE ###

k,s = map(int,input().split())

count = 0
for x in range(k+1):
  for y in range(k+1):
    a = s - x - y
    if a >= 0 and a <= k:
      count += 1

print(count)
A,B=map(int,input().split())
Astr=bin(A)[2:]
Bstr=bin(B)[2:]
if len(Astr)<len(Bstr):
    Astr='0'*(len(Bstr)-len(Astr))+Astr
from collections import defaultdict
data=defaultdict(int)
Amod=[0]
Bmod=[0]
ruijo=[1]
now=1
for k in range(1+len(Bstr)):
    now*=2
    ruijo.append(now)
    Amod.append(A%now)
    Bmod.append(B%now)
for i in range(1,1+len(Bstr)):
    if A==B:break
    Aidx=Amod[i]
    Bidx=Bmod[i]
    if i==1:
        check=[0,1,1,0]
        start=int(Astr[-1])
        data[1]=check[start+(B-A)%4]
        continue
    if Aidx==Bidx:data[i]=0
    elif Aidx<Bidx:
        if Bidx<ruijo[i-1]:data[i]=0
        else:
            data[i]=(1+Bidx-max(ruijo[i-1],Aidx))%2
    elif Bidx<Aidx:
        data[i]=(max(0,1+Bidx-ruijo[i-1])+min(ruijo[i-1],ruijo[i]-Aidx))%2
ans=0
for x,y in data.items():
    ans+=y*ruijo[x-1]
        
if A==B:print(A)
else:print(ans)

### FIXED CODE ###

def xor(A,B):
    ruijo=[]
    now=1
    for j in range(51):
        ruijo.append(now)
        now*=2
    Astr=bin(A)[2:]
    Bstr=bin(B)[2:]
    Astr='0'*(max(len(Astr),len(Bstr))-len(Astr))+Astr
    Bstr='0'*(max(len(Astr),len(Bstr))-len(Bstr))+Bstr
    ans=0
    for i in range(1,len(Astr)+1):
        if Astr[-1*i]!=Bstr[-1*i]:
            ans+=ruijo[i-1]
    return ans
def fun(x):
    if x%2==0:res=x+1
    elif x%2==1:res=x-1
    ans=[x,1,res,0]
    return ans[x%4]
A,B=map(int,input().split())
if A==B:print(A)
elif A==0:print(fun(B))
else:
    print(xor(fun(A-1),fun(B)))
import fractions
import collections
A, B = map(int, input().split())
tmp_list = collections.defaultdict(int)


def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass


def make_divisors(n):
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            tmp_list[i] += 1
            if i != n // i:
                tmp_list[n//i] += 1


make_divisors(A)
make_divisors(B)

tmp = list(tmp_list.items())
divisors = [tmp[i][0] for i in range(len(tmp)) if tmp[i][1] >= 2]

prime_list = primes(max(A, B))

ans = []
for x in divisors:
    if x in prime_list or x == 1:
        ans.append(x)

print(len(ans))


### FIXED CODE ###

from math import sqrt, ceil
import fractions
A, B = map(int, input().split())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors


ans = 1

tmp = make_divisors(fractions.gcd(A, B))

for x in tmp:
    if is_prime(x):
        ans += 1

print(ans)
al = list("abcdefghijklmn")
C = input()
print(al[al.index(C)+1])

### FIXED CODE ###

al = list("abcdefghijklmnopqrstuvwxyz")
C = input()
print(al[al.index(C)+1])
import numpy as np
n = int(input())
a = list(map(int,input().split()))
w = np.zeros(9,dtype=int)
count = 0
for i in range(n):
    if a[i] < 3200 and w[a[i]//400]==0:
        count+=1
    w[a[i]//400]+=1
if count == 0 and w[8] <=8:
    print(1,w[8])
elif count == 0:
    print(1,8)
elif w[7] == 0:
    print(count,count)
elif count + w[8] <= 8:
    print(count,count+w[8])
else:
    print(count,count)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
w = [0 for i in range(8)]
count = 0
sup = 0
for i in a:
    if i < 3200 and w[i//400]==0:
        count+=1
        w[i//400] += 1
    elif i >= 3200:
        sup += 1
if count == 0:
    print(1,sup)
elif sup == 0:
    print(count,count)
else:
    b= count+sup
    print(count,b)
a,b=map(int,input().split())
if (a+b)/2%=0:
    ans=(a+b)//2
else:
    ans=(a+b)//2+1
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
if (a+b)%2==0:
    ans=(a+b)//2
else:
    ans=(a+b)//2+1
print(ans)