Harryxun/stf_run huggingface dataset:
a,b,c,d,e,f = map(int,input().split())
maxden = 0
amax = f //(a*100)
for i in range(amax+1):
  waterA = i*100*a
  res = f-waterA
  bmax = res // (b*100)
  for j in range(bmax+1):
    waterB = j*100*b
    waterS =waterA+waterB
    res = f-waterS
    cmax = res // c
    for k in range(cmax+1):
      sugarC = k*c
      res = f-waterS-sugarC
      dmax = res // d
      for l in range(dmax+1):
        sugarD = l*d
        sugarS = sugarC+sugarD
        if(sugarS+waterS==0):break
        den = (sugarS)*100/(sugarS+waterS)
        #if(den>49 and den<50.1):print(res-sugarD,waterA,waterB,sugarC,sugarD,den)
        if(den>maxden and (den/100)<=(e/(100+e))):
          maxden = den
          sugar = sugarS
          water = waterS

print(str(water+sugar)+" "+str(sugar))

### FIXED CODE ###

a,b,c,d,e,f = map(int,input().split())
maxden = 0
amax = f //(a*100)
water=a*100
sugar=0
for i in range(amax+1):
  waterA = i*100*a
  res = f-waterA
  bmax = res // (b*100)
  for j in range(bmax+1):
    waterB = j*100*b
    waterS =waterA+waterB
    res = f-waterS
    cmax = res // c
    for k in range(cmax+1):
      sugarC = k*c
      res = f-waterS-sugarC
      dmax = res // d
      for l in range(dmax+1):
        sugarD = l*d
        sugarS = sugarC+sugarD
        if(sugarS+waterS==0):break
        den = (sugarS)*100/(sugarS+waterS)
        #if(den>49 and den<50.1):print(res-sugarD,waterA,waterB,sugarC,sugarD,den)
        #if(sugarS==146 and waterS==200):print(waterS,sugarS,den,(den*(100+e))/100,e)
        #if(sugarS==582 and waterS==800):print(waterS,sugarS,den,(den*(100+e))/100,e)
        if(den>maxden and (den*(100+e)/100)-e<=10**-5):
          maxden = den
          sugar = sugarS
          water = waterS

print(str(water+sugar)+" "+str(sugar))
#print(maxden)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

a=int(input())
b=int(input())
c=int(input())

if 7 == a:
    if 5 == b and 5 == c:
        print("Yes")
elif 5 == a:
    if (7 == b and 5 == c) or (5 == b and 7 == c):
        print("Yes")
else:
    print("No")

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

if 7 == a[0]:
    if 5 == a[1] and 5 == a[2]:
        print("YES", end="\n")
    else:
        print("NO", end="\n")   

elif 5 == a[0]:
    if (7 == a[1] and 5 == a[2]) or (5 == a[1] and 7 == a[2]):
        print("YES", end="\n")
    else:
        print("NO", end="\n")   
else:
    print("NO", end="\n")
N=int(input())
G=[[] for i in range(N)]
for _ in range(N-1):
    u,v,w=map(int,input().split())
    G[u-1].append([v-1,w%2])
    G[v-1].append([u-1,w%2])
color=[0 for i in range(N)]
seen=[False for i in range(N)]
color[0]=1
def dps(i):
    seen[i]=True
    for g in G[i]:
        if seen[g[0]]:
            continue
        else:
            if g[1]==0:
                color[g[0]]=color[i]
            else:
                color[g[0]]=color[i]*-1
            dps(g[0])
dps(0)
for i in range(N):
    print(1 if color[i]==1 else 0)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
N=int(input())
G=[[] for i in range(N)]
for _ in range(N-1):
    u,v,w=map(int,input().split())
    G[u-1].append([v-1,w%2])
    G[v-1].append([u-1,w%2])
color=[0 for i in range(N)]
seen=[False for i in range(N)]
color[0]=1
def dps(i):
    seen[i]=True
    for g in G[i]:
        if seen[g[0]]:
            continue
        else:
            if g[1]==0:
                color[g[0]]=color[i]
            else:
                color[g[0]]=color[i]*-1
            dps(g[0])
dps(0)
for i in range(N):
    print(1 if color[i]==1 else 0)
N,M = map(int,input().split())
li = []
for m in range(M):
  li.append(input().split())

ac = 0
wa = 0

for n in range(N + 1):
  if n == 0:
    continue

  for index, i in enumerate(li):
    if int(i[0]) == n and i[1] == 'AC':
      ac += 1
      for indexs, x in enumerate(li):
        if indexs >= index:
          break
        if int(x[0]) == n and x[1] == 'WA':
          wa += 1
      break

print('{0} {1}'.format(ac, wa))

### FIXED CODE ###

s=input()

li = [chr(i) for i in range(97, 97+26)]
ans = 0

for index, i in enumerate(li):
  if i == s:
    ans = index

print(li[ans + 1])
import time
MOD = 10**9+7

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

stime = time.time()
F=[0]*n
F[0]=1
F[1]=2
for i in range(2,n):
    F[i]=(F[i-1]+F[i-2])%MOD

etime =time.time()


a=[0]*n
ans=1
for i in range(m):
      a[int(input())-1]+=1

io=-1
for i in range(n-1):
      if 0!=a[i] :
            io=i+1
            if 0!=a[i+1]:
                  print("0")
                  exit()
      else:
            if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0
i=n-1
ans*=F[i-io-1]%MOD
print(ans%MOD)      


### FIXED CODE ###

import time
MOD = 10**9+7

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

stime = time.time()
F=[0]*(n+1)
F[0]=1
F[1]=2
for i in range(2,n):
    F[i]=(F[i-1]+F[i-2])%MOD

etime =time.time()


a=[0]*(n+1)
ans=1
for i in range(m):
      a[int(input())-1]+=1

io=-1
for i in range(n-1):
      if 0!=a[i] :
            io=i+1
            if 0!=a[i+1]:
                  print("0")
                  exit()
      else:
            if a[i+1] and i-io>1 :
                  ans*=F[i-io-1]%MOD
                  s=0
i=n-1
if i-io>0 :
      ans*=F[i-io-1]%MOD
print(ans%MOD)
import numpy as np

N=int(input())
#A=np.array([map(int,input().split())])
A = np.array([int(i) for i in input().split()])
max_A=np.max(A)
min_A=np.min(A)
print(max_A-min_A)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
max_A=max(A)
min_A=min(A)
print(max_A-min_A)
N,A,B = (int(x) for x in input(),split())
print(min(N*A,B))

### FIXED CODE ###

N,A,B = (int(x) for x in input().split())
print(min(N*A,B))
import string
s = input()
t = input()
l = []
alp = string.ascii_lowercase
G = dict([(alp[i],-1) for i in range(len(alp))])
for i in range(len(s)-1,-1,-1):
  l.append(G.copy())
  G[s[i]] = i
l = l[::-1]  
stG = G.copy()

cnt = 0
ind = 0
while ind < len(t): 
  if stG[t[ind]] == -1:
    cnt = -1
    break
  else:
    lind = stG[t[ind]]
    ind += 1
    while l[lind][t[ind]] != -1:   
      lind = l[lind][t[ind]]
      ind += 1
      if ind == len(t):
        break          
    cnt += 1

###    
if cnt != -1:      
  print(cnt*len(s)-(len(s)-(lind+1)))
else:
  print(cnt)  

### FIXED CODE ###

import string
s = input()
t = input()
l = []
alp = string.ascii_lowercase
G = dict([(alp[i],-1) for i in range(len(alp))])
for i in range(len(s)-1,-1,-1):
  l.append(G.copy())
  G[s[i]] = i
l = l[::-1]  
stG = G.copy()

cnt = 0
ind = 0
while ind < len(t): 
  if stG[t[ind]] == -1:
    cnt = -1
    break
  else:
    lind = stG[t[ind]]
    ind += 1
    if ind >= len(t):
      cnt += 1
      break 
    while l[lind][t[ind]] != -1:   
      lind = l[lind][t[ind]]
      ind += 1
      if ind >= len(t):
        break          
    cnt += 1

###    
if cnt != -1:      
  print(cnt*len(s)-(len(s)-(lind+1)))
else:
  print(cnt)
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


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

if N<=2:
	print(max(a))
else:
	ans = gcd_list(a[1:])
	for i in range(1,N):
		temp_gcd = gcd_list(a[0:i]+a[i+1:])

		ans = max(ans , temp_gcd)

print(ans)


### FIXED CODE ###

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


def gcd(a, b):
    if a < b: return gcd(b, a)
    elif b > 0: return gcd(b, a % b)
    else:
        return a

L = [0,a[0]]
R = [0,a[-1]]

for i in range(1,N):
	L.append(gcd(a[i] , L[-1]))
	R.append(gcd(a[-(i+1)] , R[-1]))
gcd_val_list = []
for i in range(N):
	gcd_val_list.append(gcd(L[i] , R[-(i+2)]))
print(max(gcd_val_list))
N = int(input())
S = list(input())
num = 0
for i in range(N):
  if S[i] == '#' and S[i + 1] ==".":
    num++
print(num)
    

### FIXED CODE ###

N = int(input())
S = input()
a = 0
b = S.count('.')
num = min(N - b, b)
for i in range(N):
  x = S[i] =='#'
  a += x
  b -= 1-x
  num = min(num, a+b)
print(num)
# coding: utf-8
n,m=map(int,input().split())
score={}
muki={}
kita={}

for i in range(1,n+1):
    score[i]=0
    muki[i]=[(-1,0)]
    kita[i]=0

for i in range(m):
    a,b,c=map(int,input().split())
    if muki[a][0][0]==-1:
        muki[a]=[(b,c)]
    else:
        muki[a].append((b,c))
 
def heiro(g,moto):
    for n in muki[g]:
        if n[0]==moto:
            print('inf')
            exit()
        elif n[0]!=-1:
            heiro(n[0],moto)

for i in range(1,n+1):
    heiro(i,i)

def check(moto):
    for p in muki[moto]:
        if kita[p[0]]==0 or score[p[0]]<score[moto]+p[1]:
            score[p[0]]=score[moto]+p[1]
            kita[p[0]]+=1
        if muki[p[0]][0][0]!=-1:
            check(p[0])
            
check(1)
print(score[n])

### FIXED CODE ###

# coding: utf-8
n,m=map(int,input().split())
edge=[]
for i in range(m):
    a,b,c=map(int,input().split())
    edge.append((a-1,b-1,-c))
inf=99999999999999999999
d=[inf for i in range(n)]
d[0]=0
count=0
while count<n+1:
    count+=1
    if count==n:
        tmp=d[n-1]
    update=False
    for i in range(m):
        f,t,cost=edge[i]
        if(d[t]>d[f]+cost):
            d[t]=d[f]+cost
            update=True
    if count==n and tmp!=d[n-1]:
        print('inf')
        break
    if not update:
        print(-d[n-1])
        break
else:
    print(-d[n-1])
import copy
N = int(input())
a = [input() for i in range(N)]
b = copy.deepcopy(a)
for i in b:
    del b[i]
    print(max(b))
    b = copy.deepcopy(a)

### FIXED CODE ###

N = int(input())
a = [int(input()) for i in range(N)]
A = max(a)
b = sorted(a)[-2]
if a.count(A) > 1:
    for i in range(len(a)):
        print(A)
else:
    for i in range(len(a)):
        if a[i] == A:
            print(b)
        else:
            print(A)
elements = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

th = K-1
print(elements[th])

### FIXED CODE ###

elements = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
th = K-1
print(elements[th])
import math
def comb(a, b):
  return math.factorial(a) / (math.factorial(a - b) * math.factorial(b))
print(comb(n + m, 2) - n * m)


### FIXED CODE ###

n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)
N,M=map(int,input().split())
rest=[[] for _ in range(N)]
r2=[]
end=0
flag=0
buf=""
ans=float("inf")
end=0
for i in range(M):
    s,c=map(int,input().split())
    if len(rest[s-1])==0:
        rest[s-1].append(c)
    elif rest[s-1].count(c)==0:
        end=1
        break
#print(rest)

if N == 1:
    l=range(0,10**N,1)
else:
    l=range(10**(N-1),10**N,1)

if end!=1:
    for i in l:
        buf=str(i)
        #print(i)
        for j in range(N):
            if len(rest[j])==1:
                if buf[j]!=str(rest[j][0]):
                    fail=1
                    break
        if fail==0:
            ans=i
            flag=1
            break
        fail=0
if (flag==1):
    print(ans)
else:
    print("-1")

### FIXED CODE ###

import collections

N,M=map(int,input().split())
#if not(M==0):
s=[list(map(int,input().split())) for _ in range(M)]
flag=1
l=[[i+1,-1] for i in range(N)]
ns=""
#print(l)
"""
if M==0:
    for i in range(M):
        if i==0:
            l[i][1]=1
        else:
            l[i][1]=0
        ns="".join((ns,str(l[i][1])))
    print(ns)
"""
#else:
for i in range(M):
    #print(l)
    if l[s[i][0]-1][1]==-1:
        l[s[i][0]-1][1]=s[i][1]
    else:
        if not(l[s[i][0]-1][1]==s[i][1]):
            flag=0
if (not(N==1) and (l[0][1]==0)):
    flag=0
if flag==1:
    for i in range(N):
        if not(N==1):
            if (l[i][1]==-1):
                if i==0:
                    l[i][1]=1
                else:
                    l[i][1]=0
        else:
            if (l[i][1]==-1):
                l[i][1]=0
        ns="".join((ns,str(l[i][1])))
    print(ns)
else:
    print("-1")
n = int(input())
a = 111
for i in range(9):
  if a*i < n <= a*(i+1)
  print(a*(i+1))

### FIXED CODE ###

n = int(input())
a = 111
for i in range(9):
  if a*i < n <= a*(i+1):
    print(a*(i+1))
n=int(input())
a=int(input())
b=int(input())
if n ==1:
    print("Hello World")
elif n ==2:
    print(a+b)

### FIXED CODE ###

n=int(input())
if n ==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
a,b=map(int,input().split())
if a>80:
    print(-1)
elif a==b:
    if a<=3:
        print(25*a//2)
    else:
        print(-1)
else:
    if -(-25*a//2) <= 10*b and -(-25*a//2) > 9*b:
        print(25*a//2)
    else:
        print(-1)



### FIXED CODE ###

s=input()
print('Yes' if 'A' in s and 'B' in s else 'No')
h, w = map(int, input().split())
box = [["."] + list(input()) + ["."] for i in range(h)]
box.insert(0, ["."] * (w + 2))
box.append(["."] * (w + 2))


def seek(box, i, j):
    if box[i][j] == "#":
        for x, y in [[1, 0], [-1, 0], [0, 1], [0, -1]]:
            xx = x + i
            yy = y + j
            if box[xx][yy] == "#" or box[xx][yy] == "O":
                box[i][j] = "O"
                seek(box, xx, yy)
    return box


for i in range(1, h + 1):
    for j in range(1, w + 1):
        seek(box, i, j)

for i in range(1, h + 1):
    for j in range(1, w + 1):
        if box[i][j] == "#":
            print("No")
            exit()

print("Yes")

### FIXED CODE ###

H, W = map(int, input().split())
s = [input() for i in range(H)]
for i in range(H):
    for j in range(W):
        if s[i][j] == ".":
            continue
        if i == 0 or s[i-1][j] == "#":
            continue
        if i == H-1 or s[i+1][j] == "#":
            continue
        if j == 0 or s[i][j-1] == "#":
            continue
        if j == W-1 or s[i][j+1] == "#":
            continue
        print("No")
        exit()
print("Yes")
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    if(a.count(0)!=0):
        return 0
        
    res=a[0]
    for i in range(1,n):
        res*=a[i]
        if res>INFTY:
            return -1
    return res

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)

### FIXED CODE ###

INFTY=10**18

def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    if(a.count(0)!=0):
        return 0
        
    res=a[0]
    for i in range(1,n):
        res*=a[i]
        if res>INFTY:
            return -1
    return res

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)
import sys

#探索
def DFS(mapmap, start_flag = False):
    while 1:
        #はじめの探索
        for i in range(lines):
            for j in range(rows):
                if mapmap[i][j] == '#':
                    start_flag = True
                    break
        #則終了
        if start_flag == False:
            print('No')
            sys.exit()

        startl, startr = i, j
        #動き
        Stack = [[startl, startr]]
        #終了条件
        if mapmap[i+1][j] == '.' and mapmap[i-1][j] == '.' and mapmap[i][j+1] == '.' and mapmap[i][j-1] == '.':
            print('No')
            sys.exit()

        move_x = [1, -1, 0, 0]
        move_y = [0, 0, 1, -1]

        while Stack:
            x, y= Stack.pop()#今現在の位置
            #現在位置を変換
            mapmap[x][y] = '.'

            for i in range(len(move_x)):
                nx = x + move_x[i]
                ny = y + move_y[i]

                if 0 <= nx and nx < lines and 0 <= ny and ny < rows:
                    if mapmap[nx][ny] == '#':
                        Stack.append([nx, ny])
        
#入力管理
lines, rows = map(int, input().split())
mapmap = []

for i in range(lines):
    mapmap.append(list(input()))

DFS(mapmap)

### FIXED CODE ###

import sys

line_size, row_size = map(int, input().split())
mapmap = []#地図初期化

for i in range(line_size):
    mapmap.append(list(input()))

#探索
def Start_check(mapmap, px, py):
    start_flg = False
    move_x = [1, -1, 0, 0]
    move_y = [0, 0, 1, -1]
    for i in range(4):#動ける範囲で探索
        nx = px + move_x[i]
        ny = py + move_y[i]
        if 0 <= nx and nx < line_size and 0 <= ny and ny < row_size:
            if mapmap[nx][ny] == '#':#もし黒塗りなら
                start_flg = True
    
    if start_flg == False:
        print('No')
        sys.exit()

#Main
count = 0#探索回数（塗り絵した回数）
for i in range(line_size):
    for j in range(row_size):
        if mapmap[i][j] == '#':
            Start_check(mapmap, i, j)
            count += 1

#何もしなかった場合
print('Yes')
N,K=map(int,input().split())
L=list(map(int,input().split()))
L=sorted(L)
print(sum(L[:K]))


### FIXED CODE ###

N=int(input())
cnt=0
while N>0:
  N//=2
  cnt=cnt*2+1
print(cnt)
N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)


def f(u,c):
    color[u] = c
    for v in graph[u]:
        if color[v] == 0: # まだ塗られていない場合
            if not f(v,-c):
                return False
        else:
            if color[v] == c: # 隣接している頂点が同色の場合 二部グラフではない
                return False
    return True 

flag = True
color = [0 for _ in range(N)]
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            flag = False
            break

if flag: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = N*(N-1)//2 - M

print(int(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)


def f(u,c):
    color[u] = c
    for v in graph[u]:
        if color[v] == 0: # まだ塗られていない場合
            if not f(v,-c):
                return False
        else:
            if color[v] == c: # 隣接している頂点が同色の場合 二部グラフではない
                return False
    return True 

flag = True
color = [0 for _ in range(N)]
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            flag = False
            break

if flag: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = N*(N-1)//2 - M

print(int(ans))
N, M= (int(i) for i in input().split())
lst = [[int(i) for i in input().split()] for i in range(n)] 
import numpy as np
food = np.zeros((N,M))
for i in range(N):
    for j in range(lst[i][0]):
        #print(lst[i][j+1])
        food[i][lst[i][j+1]-1] = 1
#print(food)
s = np.sum(food, axis=0)
print(len(s[s==N]))

### FIXED CODE ###

N, M= (int(i) for i in input().split())
lst = [[int(i) for i in input().split()] for i in range(N)]
import numpy as np
food = np.zeros((N,M))
for i in range(N):
    for j in range(lst[i][0]):
        #print(lst[i][j+1])
        food[i][lst[i][j+1]-1] = 1
#print(food)
s = np.sum(food, axis=0)
print(len(s[s==N]))
n,q=map(int,input().split())
s=input()
for i in range(q):
    l,r=map(int,input().split())

    
    
dp =[0 for j in range(n)]


for j in range(n):
    t=0
    if s[j]=="C" and j!=0:
        if s[j-1]=="A":
            t=1

    dp[j]=dp[j-1]+t
        

for i in range(q):
    l,r=map(int,input().split())
    print(dp[r-1]-dp[l-1])

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
    
dp =[0 for j in range(n)]


for j in range(n):
    t=0
    if s[j]=="C" and j!=0:
        if s[j-1]=="A":
            t=1

    dp[j]=dp[j-1]+t
        

for i in range(q):
    l,r=map(int,input().split())
    print(dp[r-1]-dp[l-1])
A,B = map(int,input().split())
k = len(bin(B))-2
if k==1:
    totB = bin(B)[-1]
elif B==2**k-1:
    totB = "0"*k
else:
    if bin(B)[-2:]=="00":
        totB = "00"
    elif bin(B)[-2:]=="01":
        totB = "01"
    elif bin(B)[-2:]=="10":
        totB = "11"
    elif bin(B)[-2:]=="11":
        totB = "00"
    a = bin(B)[-1]
    for i in range(-3,-k-1,-1):
        if bin(B)[i]=="0":
            totB = "0"+totB
        elif bin(B)[i]=="1" and a=="1":
            totB = "0"+totB
        elif bin(B)[i]=="1" and a=="0":
            totB = "1"+totB
if A==0:
    totA == "0"
else:
    m = len(bin(A-1))-2
    if m==1:
        totA = bin(A-1)[-1]
    elif A-1==2**m-1:
        totA = "0"*m
    else:
        if bin(A-1)[-2:]=="00":
            totA = "00"
        elif bin(A-1)[-2:]=="01":
            totA = "01"
        elif bin(A-1)[-2:]=="10":
            totA = "11"
        elif bin(A-1)[-2:]=="11":
            totA = "00"
        a = bin(A-1)[-1]
        for i in range(-3,-m-1,-1):
            if bin(A-1)[i]=="0":
                totA = "0"+totA
            elif bin(A-1)[i]=="1" and a=="1":
                totA = "0"+totA
            elif bin(A-1)[i]=="1" and a=="0":
                totA = "1"+totA
totA = int(totA,2)
totB = int(totB,2)
tot = totA^totB
print(tot)

### FIXED CODE ###

def f(N):
    if N==0:
        return 0
    if N==1:
        return 1
    if N==2:
        return 1^2
    if N==3:
        return 0
    k = 2
    while 2**k<=N:
        k += 1
    k -= 1
    if 2**k==N:
        return N
    n = (N-2**k)//4
    cnt = 0
    i = 2**k+4*n
    while i<=N:
        cnt = cnt^i
        i += 1
    return cnt
A,B = map(int,input().split())
if A==0 and B==0:
    print(0)
elif A==0 and B>0:
    print(f(B))
else:
    print(f(B)^f(A-1))
N = int(input())
H = map(int, input().split())

count = []
for i in range(len(H)-1):
  count.append(0)
  if H[i] > H[i+1]:
    count[i] = 1
    
S = str(count).split('0')
L = map(len, S)
print(max(L))

### FIXED CODE ###

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

print(sum(filter(lambda x : x%3 != 0 or x%5 !=, range(N)))) 



### FIXED CODE ###

N = int(input())

print(sum(filter(lambda x : (x%3 != 0) and (x%5 !=0), range(N+1))))
import numpy as np
h,w=map(int,input().split())
S=np.array([list(input()) for _ in range(h)])
S=np.where(S==".",1,0)

left,right,up,down=[np.zeros((h,w)) for _ in range(4)]
for i in range(w):
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[:,-i-1]
for i in range(h):
    up[i]=(up[i-1]+1)*S[i]
    down[-i-1]=(down[-i]+1)*S[-i-1]

print(int(np.max(left+right+up+down)-3))


### FIXED CODE ###

import numpy as np
h,w=map(int,input().split())
S=np.array([list(input()) for _ in range(h)])
S=np.where(S==".",1,0)

left,right,up,down=[np.zeros((h,w),dtype=np.int64) for _ in range(4)]
for i in range(w):
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[:,-i-1]
for i in range(h):
    up[i]=(up[i-1]+1)*S[i]
    down[-i-1]=(down[-i]+1)*S[-i-1]

print(int(np.max(left+right+up+down)-3))
# -*- coding:utf-8 -*-

array = input().split()
a, b = int(array[0]), int(array[1])

x = a+b
print(int(math.log10(x) + 1))

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
import math

array =[]
for line in sys.stdin:
    array.append(line)
    
for i in range(len(array)):
    num = array[i].split(' ')
    a = int(num[0])
    b = int(num[1])
    n = a + b
    print(int(math.log10(n) + 1))
nums=input().split()
t=int(nums[1])/int(nums[2])
if t<int(nums[3]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

nums=input().split()
t=int(nums[0])/int(nums[2])
if t<=int(nums[1]):
  print("Yes")
else:
  print("No")
N = int(input())
p = list(map(int,input().rstrip().split(" ")))
ans = 0
swap = 0
for i in range(N):
    if p[i] == i + 1:
        if i != N:
            swap = p[i]
            p[i] = p[i + 1]
            p[i + 1] = swap
            ans += 1
        else:
            swap = p[i]
            p[i] = p[i - 1]
            p[i - 1] = swap
            ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
p = list(map(int,input().rstrip().split(" ")))
ans = 0
swap = 0
for i in range(N):
    if p[i] == i + 1:
        if i != N - 1:
            swap = p[i]
            p[i] = p[i + 1]
            p[i + 1] = swap
            ans += 1
        else:
            swap = p[i]
            p[i] = p[i - 1]
            p[i - 1] = swap
            ans += 1
print(ans)