Harryxun/stf_run huggingface dataset:
lis = list(input().split())
a=lis.count(lis[0])
b=lis.count(lis[1])
c=lis.count(lis[2])
if a+b+C == 4:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

lis = list(input().split())
a=lis.count(lis[0])
b=lis.count(lis[1])
c=lis.count(lis[2])
if a+b+c == 5:
    print("Yes")
else:
    print("No")
n=int(input("n?"))
a=[int(input("a?")) for i in range(n)]
mon=1000
kai=0
for i in range(n-1):
  if a[i]>a[i+1]:
    mon+=kai*a[i]
    kai=0
  elif a[i]<a[i+1]:
    kai=int(mon/a[i])
    mon-=kai*a[i]

mon+=kai*a[n-1]

print(mon)

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
mon=1000
kai=0
for i in range(n-1):
  if a[i]>a[i+1]:
    mon+=kai*a[i]
    kai=0
  elif a[i]<a[i+1] and kai==0:
    kai=int(mon/a[i])
    mon-=kai*a[i]

mon+=kai*a[n-1]

print(mon)
import collections
l,r = map(int, raw_input().split(' '))
cc = collections.Counter([n % 2019 for n in range(l, r+1) ])

m = +float('inf')
for a in cc:
	for b in cc:
		if a!=b or cc[a] > 1:
			m = min(m,(a*b) % 2019)
print m

### FIXED CODE ###

import collections
l,r = map(int, raw_input().split(' '))
cc = collections.Counter([n % 2019 for n in range(l, min(r, l + 2019)+1) ])

m = +float('inf')
for a in cc:
	for b in cc:
		if a!=b or cc[a] > 1:
			m = min(m,(a*b) % 2019)
print m
n,a,b,c,d = map(int,input().split())
s = input().rstrip()
renzoku_iwa = [0 for i in range(n)]
renzoku_blank = [0 for i in range(n)]
old1 = ""
old2 = ""
for i,tmp in enumerate(s):
	if old1 == tmp:
		if old1 == "." and old2 == ".":
			renzoku_blank[i] = 1
		elif old1 == "#":
			renzoku_iwa[i] = 1
	old2 = old1
	old1 = tmp

if sum(renzoku_iwa[a-1:c]) == 0 and sum(renzoku_iwa[b-1:d]) == 0:
	if c < d:
		print("Yes")
	else:
		1/0
		if sum(renzoku_blank[b:d])>=1:
			print("Yes")
		else:
			print("No")
else:
	print("No")
print(renzoku_iwa)
print(renzoku_blank)

### FIXED CODE ###

n,a,b,c,d = map(int,input().split())
s = input().rstrip()
renzoku_iwa = [0 for i in range(n)]
renzoku_blank = [0 for i in range(n)]
old1 = ""
old2 = ""
for i,tmp in enumerate(s):
	if old1 == tmp:
		if old1 == "." and old2 == ".":
			renzoku_blank[i] = 1
		elif old1 == "#":
			renzoku_iwa[i] = 1
	old2 = old1
	old1 = tmp

if sum(renzoku_iwa[a-1:c]) == 0 and sum(renzoku_iwa[b-1:d]) == 0:
	if c < d:
		print("Yes")
	else:
		if sum(renzoku_blank[b:min(d+1,len(renzoku_blank))])>=1:
			print("Yes")
		else:
			print("No")
else:
	print("No")
def cf(x1,x2):
    cf=[]
    for i in range(1,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def is_prime(n):
    if n == 1: return True

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

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

res = len([i for i in lst if is_prime(i)])

print(res)

### FIXED CODE ###

import math

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)

    # divisors.sort()
    return divisors

def is_prime(n):
    if n == 1: return True

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

A, B = map(int, input().split())
AY = make_divisors(A)
BY = make_divisors(B)
AB = set(AY) & set(BY)
AB = list(AB)
cnt = [i for i in range(len(AB)) if is_prime(AB[i])]
print(len(cnt))
for i in range (1,6):
  print(i)
  int x
  if(x(i) == 0):
    print(i)

### FIXED CODE ###

*x, = map(int,input().split())
print(x.index(0)+1)
N=input()
print("vowel"if N=='a','i','u','e','o' else "constant")

### FIXED CODE ###

c=input()
print("vowel"if c in "aiueo" else "consonant")
n, m = (int(x) for x in input().split())
a = [0] * m
for i in range(m):
    a[i] = int(input())

dp = [0] * (n + 1)
mod = 1000000007
dp[0] = 1
j = 0
for i in range(1, n+1):
    if i == a[j]:
        dp[i] = 0
        if j != m - 1:
            j += 1
    elif i >= 2:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
    else:
        dp[i] = dp[i-1] % mod

print(dp[n])

### FIXED CODE ###

n, m = (int(x) for x in input().split())
a = [0] * m
for i in range(m):
    a[i] = int(input())
dp = [0] * (n + 1)
mod = 1000000007
dp[0] = 1
j = 0

if m > 0:
    for i in range(1, n + 1):
        if i == a[j]:
            dp[i] = 0
            if j != m - 1:
                j += 1
        elif i >= 2:
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod
        else:
            dp[i] = dp[i - 1] % mod
else:
    for i in range(1, n + 1):
        if i >= 2:
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod
        else:
            dp[i] = dp[i - 1] % mod
print(dp[n])
N,K=map(int,input().split())
P=list(map(int,input().split()))
L=[]
def E(n):
  e=0
  for i in range(1,n+1):
    e+=i
  e = e/n
  return e

l=sum(P[0:K])
k=0
for i in range(1,N-K+1):
  l = l-P[i-1]+P[i-1+K]
  if l>k:
    k=l
    L=P[i:i+K]

A=0
for i in range(K):
  A+=E(L[i])
print(A)

### FIXED CODE ###

N,K=map(int,input().split())
P=list(map(int,input().split()))


l=sum(P[0:K])
k=l
for i in range(N-K):
  l = l-P[i]+P[i+K]
  if l>k:
    k=l

print((k+K)/2)
N,A,B = map(int,input().split())
count = 0
Bs = "b"*A
Rs = "r"*B
ballset = Bs+Rs
#print(Bs)
#print(Rs)
n = (N//len(ballset)+1)
#print(len(ballset))
#print(n)
allball = ballset*n
print(allball[:N].count("b"))


### FIXED CODE ###

N,A,B = map(int,input().split())
count = 0
a = N//(A+B)
#print(a)
count += a*A
#print(count)
b = N%(A+B)
if b > A:
  count +=A
else:
  count +=b
print(count)
N = int(input())
s = [input() for i in range(N)]

M = int(input())
t = [input() for i in range(M)]

count_max = 0
for i in range(N):
    count = s.count(s[i]) - t.count(s[i])
    if count > count_max:
         count_max = count
            
print(count_max)
N = int(input())
s = [input() for i in range(N)]

M = int(input())
t = [input() for i in range(M)]

count_max = 0
for i in range(N):
    count = s.count(s[i]) - t.count(s[i])
    if count > count_max:
         count_max = count
            
print(count_max)

### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]

M = int(input())
t = [input() for i in range(M)]

count_max = 0
for i in range(N):
    count = s.count(s[i]) - t.count(s[i])
    if count > count_max:
         count_max = count
            
print(count_max)
n,m=map(int,input().split())

AC=[0]*n
WA=[0]*n

for i in range(m):
    t=input().split()
    p, s= int(t[0]), t[1]
    if s=='AC':
        AC[p-1]=1
    elif s=='WA' and AC[p-1]==0:
        WA[p-1]+=1

ac, wa=0,0

for i in range(n):
    if AC[i]:
        ac+=1
        wa+=WA[i]
        
print(ac, wa)

### FIXED CODE ###

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

AC=[0]*n
WA=[0]*n

for i in range(m):
    t=input().split()
    p, s= int(t[0]), t[1]
    if s=='AC':
        AC[p-1]=1
    elif s=='WA' and AC[p-1]==0:
        WA[p-1]+=1

ac, wa=0,0

for i in range(n):
    if AC[i]:
        ac+=1
        wa+=WA[i]

print(ac, wa)
n,m = map(int, intput().split())
print('Yes' if N==M else 'No')

### FIXED CODE ###

n,m = map(int, input().split())
print('Yes' if n == m else 'No')
N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
	print(B - A//2))
else:
	print(min(A - 1,N - B) + 1 + (B - A - 1)//2)

### FIXED CODE ###

N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
	print((B - A)//2)
else:
	print(min(A - 1,N - B) + 1 + (B - A - 1)//2)
from operator import itemgetter
restaurant = [[]]
inp = input().split("n/")[1:]
for i in range(input().split("n/")[0]):
      restaurant[i] = inp[i].split()
      restaurant[i].insert(0,i)
print(restaurant)

restaurant.sort(key=itemgetter(1,2))


### FIXED CODE ###

n = int(input())
a= []
for i in range(n):
	city, score = input().split()
	score = int(score)
	a.append((city, score, i+1))
a.sort(key=lambda k : (k[0], -k[1]))
for i in range(n):
	print(a[i][2])
a = input()
s = input()

if a<3200:
  print('red')
else:
  print(s)

### FIXED CODE ###

a = int(input())
s = str(input())

if a<3200:
  print('red')
else:
  print(s)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt = 0
for a_, b_ in zip(a, b):
    if a_ > b_:
        cnt += a - b
    else:
        cnt -= (b - a) // 2
if cnt <= 0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt = 0
for a_, b_ in zip(a, b):
    if a_ > b_:
        cnt += a_ - b_
    else:
        cnt -= (b_ - a_) // 2
if cnt <= 0:
    print('Yes')
else:
    print('No')
I = int(input())
L = list(map(int, input().split()))

print(2*I-1, flush=True)

m = 0
for i, item in enumerate(L):
    if abs(item) > abs(m):
        m = item
        m_index = i

for i in range(L):
    print(m_index+1, i+1, flush=True)

if m >= 0:
    for i in range(0, I-1):
        print(i+1, i+2)
else:
    for i in range(I, 0):
        print(i, i-1)


### FIXED CODE ###

I = int(input())
L = list(map(int, input().split()))

print(2*I-1, flush=True)

m = 0
m_index = 0
for i, item in enumerate(L):
    if abs(item) > abs(m):
        m = item
        m_index = i

for i in range(I):
    print(m_index+1, i+1, flush=True)

if m >= 0:
    for i in range(0, I-1):
        print(i+1, i+2)
else:
    for i in range(I, 1, -1):
        print(i, i-1)
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
count = 0

for i in range(X+1)
    count += A.count(i)

ans = min(count, len(A)-count)
print(ans)

### FIXED CODE ###

N, M, X = map(int, input().split())
A = list(map(int, input().split()))
count = 0

for i in range(X+1):
    count += A.count(i)

ans = min(count, len(A)-count)
print(ans)
import math
import pprint

def lcm(a,b):
    return (a*b)//math.gcd(a,b)

N, M = map(int,input().split())
S = input()
T = input()
L = lcm(N,M)
d1 = L//N
d2 = L//M
d = lcm(d1,d2)
l = list(range(L))
l = l[::d]
b = True
for i in l:
    if S[i//d1] != T[i//d2]:
        b = False
        break

if not b:
    L = -1
print(L)


### FIXED CODE ###

import sys

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

def lcm(a,b):
    return (a*b)//gcd(a,b)

N, M = map(int,input().split())
S = input()
T = input()
d = gcd(N,M)
L = lcm(N,M)
for i in range(d):
    if S[i*(N//d)] != T[i*(M//d)]:
        print(-1)
        sys.exit()

print(L)
# coding: utf-8
input_lines = raw_input().split()
a = int(input_lines[0])
b = int(input_lines[1])
c = int(input_lines[2])
d = int(input_lines[3])

flag = 0
if abs(c - a) > d:
    if abs(b - a) > d or abs(c - b) > d:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")
    
        


### FIXED CODE ###

input_lines = input().split()
a = int(input_lines[0])
b = int(input_lines[1])
c = int(input_lines[2])
d = int(input_lines[3])

flag = 0
if abs(c - a) > d:
    if abs(b - a) > d or abs(c - b) > d:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")
X = int(input())

B = [n**5 for n in range(300)]

A = []

for i in range(300):
    a = i**5- X if i**5 >= X else X-i**5
    A.append(a)

for j in range(300):
    if A[j] in B:
        a = j
        b = B.index(A[j])
        if a**5-b**5 = X:
            print(a,b)
        elif a**+b**5 = X:
            print(a,-b)
        break


### FIXED CODE ###

X = int(input())

B = [n**5 for n in range(200)]

A = []

for i in range(200):
    a = i**5- X if i**5 >= X else X-i**5
    A.append(a)

for j in range(200):
    if A[j] in B:
        a = j
        b = B.index(A[j])
        if a**5-b**5 == X:
            print(a,b)
        elif a**5+b**5 == X:
            print(a,-b)
        else:
            print(b,a)
        break
K = int(input())
X = int(input())
A=X-K+1
B=X+K-1
L=[]
for i in range(A,B):
  if i > 1000000 or i < -1000000:
    continue
  L.attend(str(i))
print(*L)

### FIXED CODE ###

K,X = map(int,input().split())
A=X-K+1
B=X+K-1
L=[]
for i in range(A,B+1):
  if i > 1000000 or i < -1000000:
    continue
  L.append(str(i))
print(*L)
import math

n = int(input())
print(2*n/math.gcd(2,n))


### FIXED CODE ###

from fractions import gcd

n = int(input())
print(2*n//gcd(2,n))
first_input = map(lambda x:int(x), input().split(" "))
#second_input = input()

print(str(first_input[2])+" "+str(first_input[0])+" "+str(first_input[1]))


### FIXED CODE ###


first_input = list(map(lambda x:int(x), input().split(" ")))
#second_input = input()

print(str(first_input[2])+" "+str(first_input[0])+" "+str(first_input[1]))
# C sugar water
from collections import deque
def noudo(water, sugar):
    if water+sugar==0: return 0
    return 100*sugar/(water+sugar)

A,B,C,D,E,F = map(int, input().split())
q = deque([(0,0)]) # water, sugar
max_noudo = 0
ans = None
while q:
    water,sugar = q.popleft()
    cur = noudo(water, sugar)
    if cur>max_noudo:
        ans = (water, sugar)
        max_noudo = cur
    for dw,ds in [(100*A, 0), (100*B, 0), (0,C), (0,D)]:
        if noudo(water+dw, sugar+ds)>noudo(100, E) or water+dw+sugar+ds>F: continue
        q.append((water+dw, sugar+ds))
        
water, sugar = ans
print(water+sugar, sugar)

### FIXED CODE ###

from fractions import gcd
A,B,C,D,E,F = map(int, input().split())
ans = {"w":A*100, "s":0}
def density(water, sugar):
    return 100*sugar/(water+sugar)

G = gcd(C,D)
for a in range(31):
    for b in range(31):
        water = (a*A+b*B)*100
        if water>F:
            continue
        max_sugar = min((a*A+b*B)*E, F-water)
        sugar = int(G*(max_sugar//G))
        if sugar<min(C,D): continue
        if water+sugar==0: 
            continue
        if density(water, sugar)>density(ans["w"], ans["s"]):
            ans["w"] = water
            ans["s"] = sugar
            #print(water, sugar)
print(ans["w"]+ans["s"], ans["s"])
#n=int(input())
n,m,x=map(int,input().split())
#a=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(n)]

def tas(l1,l2):
    l3=[]
    for i in range(m+1):
        l3.append(l1[i]+l2[i])
    return l3


ll=[[0 for i in range(m+1)]]
for i in range(n):
    for j in range(len(ll)):
        ll.append(tas(ll[j],l[i]))

lm=[]
for i in ll:
    lll=[]
    for j in range(1,i):
        if i[j]>=x:
            lll.append(True)
        else:
            lll.append(False)
    if all(lll)==True:
        lm.append(i[0])

if len(lm)>0:
    print(min(lm))
else:
    print(-1)


### FIXED CODE ###

#n=int(input())
n,m,x=map(int,input().split())
#a=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(n)]

def tas(l1,l2):
    l3=[]
    for i in range(m+1):
        l3.append(l1[i]+l2[i])
    return l3


ll=[[0 for i in range(m+1)]]
for i in range(n):
    for j in range(len(ll)):
        ll.append(tas(ll[j],l[i]))

lm=[]
for i in ll:
    lll=[]
    for j in range(1,len(i)):
        if i[j]>=x:
            lll.append(True)
        else:
            lll.append(False)
    if all(lll)==True:
        lm.append(i[0])

if len(lm)>0:
    print(min(lm))
else:
    print(-1)
L, R = [int(input()) for i in input().split()]
diff = R - L
ans = 2019
if diff == 1:
    x = (L * (L + 1)) % 2019
    print(min(x, ans))
else:
    for i in range(diff):
        for j in range(i + 1, diff):
            x = ((L + i) * (L + j)) % 2019
            ans = min(x, ans)
            if x == 0:
                break
    print(ans)


### FIXED CODE ###

L, R = [int(i) for i in input().split()]
R = min(R, L + 4038)
ans = 2018
for i in range(L, R + 1):
    for j in range(i + 1, R + 1):
        x = (i * j) % 2019
        if x == 0:
            ans = 0
            break
        ans = min(ans, x)
print(ans)
#input
h, w = list(map(int, input().split()))

c = [0 for i in range(10)]
for i in range(10):
    c[i] = list(map(int, input().split()))

wall = [0 for i in range(w)]

for i in range(h):
    wall[i] = list(map(int, input().split()))

#solve
#0へのコスト
costone = [((10**3) + 1) for i in range(11)]
#-1, 1はコストがかからないため０で初期化
costone[1] = 0
costone[10] = 0
#ワーシャルフロイド法を使う
#iは出発、jは経由,
for i in range(10):
    for j in range(10):
        for k in range(10):
            c[i][k] = min(c[i][k], c[i][j] + c[j][k])
#costoneを更新
for i in range(10):
    costone[i] = min(costone[i], c[i][1])
sum = 0
for i in range(h):
    for j in range(w):
        sum += costone[wall[i][j]]
print(sum)


### FIXED CODE ###

from scipy.sparse.csgraph import floyd_warshall

#input
h, w = list(map(int, input().split()))

c = [0 for i in range(10)]
for i in range(10):
    c[i] = list(map(int, input().split()))

wall = []

for i in range(h):
    wall.append(list(map(int, input().split())))

#solve
#1へのコスト
costone = [(10**3) + 1 for i in range(11)]
#-1, 1はコストがかからないため０で初期化
costone[1] = 0
#-1の処理
costone[10] = 0
#ワーシャルフロイド法を使う
#iは出発、jは経由,
c = floyd_warshall(c)
##for i in range(10):
##    for j in range(10):
##        for k in range(10):
##            c[i][k] = min(c[i][k], c[i][j] + c[j][k])
#costoneを更新
for i in range(10):
    costone[i] = min(costone[i], c[i][1])
sum = 0


for i in range(h):
    for j in range(w):
        sum += costone[wall[i][j]]
print(int(sum))
MOD=1000000007
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
pos=[]
neg=[]
nzero=0
for i in a:
    if i>0:
        pos.append(i)
    elif i<0:
        neg.append(-i)
    else:
        nzero+=1
if nzero+k>n:
    print(0)
elif len(pos)==0:
    res=1
    if k%2:
        neg.sort()
        for i in range(k):
            res*=MOD-neg[i]
            res%=MOD
    else:
        neg.sort(reverse=True)
        for i in range(k):
            res*=MOD-neg[i]
            res%=MOD
    print(res)
elif len(neg)==0:
    res=1
    pos.sort(reverse=True)
    for i in range(k):
        res*=pos[i]
        res%=MOD
    print(res)
else:
    pos.sort(reverse=True)
    neg.sort(reverse=True)
    ruip=[1 for i in range(len(pos)+1)]
    ruin=[1 for i in range(len(neg)+1)]
    for i in range(len(pos)):
        ruip[i+1]=ruip[i]*pos[i]
        ruip[i+1]%=MOD
    for i in range(len(neg)):
        ruin[i+1]=ruin[i]*neg[i]
        ruin[i+1]%=MOD
    np=0
    if len(pos)>=k:
        np=k
    elif (k-len(pos))%2:
        np=len(pos)-1
    else:
        np=len(pos)
    while np>=2 and (pos[np-1]*pos[np-2]<neg[k-np-1]*neg[k-np-2]):
        np-=2
        if np+len(neg)<k:
            np+=2
            break
    print((ruip[np]*ruin[k-np])%MOD)


### FIXED CODE ###

MOD=1000000007
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
pos=[]
neg=[]
nzero=0
for i in a:
    if i>0:
        pos.append(i)
    elif i<0:
        neg.append(-i)
    else:
        nzero+=1
if nzero+k>n:
    print(0)
elif nzero+k==n and len(pos)>0 and len(neg)>0:
    if nzero==0:
        res=1
        for i in pos+neg:
            res*=i
            res%=MOD
        if len(neg)%2:
            res*=-1
            res+=MOD
        print(res)
    elif len(neg)%2:
        print(0)
    else:
        res=1
        for i in pos+neg:
            res*=i
            res%=MOD
        print(res)
elif len(pos)==0:
    res=1
    if k%2 and nzero>0:
        print(0)
    elif k%2:
        neg.sort()
        for i in range(k):
            res*=MOD-neg[i]
            res%=MOD
        print(res)
    else:
        neg.sort(reverse=True)
        for i in range(k):
            res*=MOD-neg[i]
            res%=MOD
        print(res)
elif len(neg)==0:
    res=1
    pos.sort(reverse=True)
    for i in range(k):
        res*=pos[i]
        res%=MOD
    print(res)
else:
    pos.sort(reverse=True)
    neg.sort(reverse=True)
    ruip=[1 for i in range(len(pos)+1)]
    ruin=[1 for i in range(len(neg)+1)]
    for i in range(len(pos)):
        ruip[i+1]=ruip[i]*pos[i]
        ruip[i+1]%=MOD
    for i in range(len(neg)):
        ruin[i+1]=ruin[i]*neg[i]
        ruin[i+1]%=MOD
    np=0
    if len(pos)>=k:
        np=k
    elif (k-len(pos))%2:
        np=len(pos)-1
    else:
        np=len(pos)
    while np>=2 and (pos[np-1]*pos[np-2]<neg[k-np+1]*neg[k-np]):
        np-=2
        if len(neg)-1<k-np+1:
            break
    print((ruip[np]*ruin[k-np])%MOD)
a,b=input().split()
ai=int(a)
b=int(float(b)*100//1)

print(int(a*b/100))


### FIXED CODE ###

a,b=input().split()
ai=int(a)
bi=int(float(b)*100)//1
bi=int(b.replace('.',''))

print(ai*bi//100)
import sys
v=[0]*101
for e in sys.stdin:
 a,b=map(int,e.split())
 v[a]+=1;v[b]+=1
 if a==0:
  print(['OK','NG'][(v[1]&1)*(v[2]&1)*sum(x&1 for x in v)-2])
  v=[0]*101


### FIXED CODE ###

import sys
v=[0]*100
for e in sys.stdin:
 a,b=map(int,e.split())
 v[a]+=1;v[b]+=1
 if a==0:
  print(['NG','OK'][(v[1]&1)*(v[2]&1)*sum(x&1 for x in v)==2])
  v=[0]*100
def get_next_int():
    return int(input().rstrip("\n"))
def get_next_ints(delim=" "):
    return tuple([int(x) for x in input().rstrip("\n").split(delim)])
def main():
    n = get_next_int()
    
    a = get_next_ints()
    b = get_next_ints()
    
    a_offsets = []
    b_offsets = []
    for i in range(n):
        a_offsets.append(str(a[i] ^ a[i-1]))
        b_offsets.append(str(b[i] ^ b[i-1]))
    #print(a_offsets)
    #print(b_offsets)
    a_text = " ".join(a_offsets)
    b_text = " ".join(b_offsets)
    target_text = a_text + " " + a_text
    
    start = 0
    while target_text.find(b_text, start) >= 0 and start < len(a_text):
        start = target_text.find(b_text, start)
        #print(start)
        pos_diff = target_text[:start].count(" ")
        xor_diff = b[0] ^ a[pos_diff]
        print(pos_diff, xor_diff)        
        start = start + 2

if __name__ == '__main__':
    main()
    

### FIXED CODE ###

def get_next_int():
    return int(input().rstrip("\n"))


def get_next_ints(delim=" "):
    return tuple([int(x) for x in input().rstrip("\n").split(delim)])


def main():
    n = get_next_int()

    a = get_next_ints()
    b = get_next_ints()

    a_offsets = []
    b_offsets = []
    for i in range(n):
        a_offsets.append(str(a[i] ^ a[i - 1]))
        b_offsets.append(str(b[i] ^ b[i - 1]))
    #print(a_offsets)
    #print(b_offsets)
    a_text = " ".join(a_offsets)
    b_text = " ".join(b_offsets)
    target_text = a_text + " " + a_text
    start_pos = 0
    if target_text.find(b_text, start_pos) >= 0:
        fisrt_pos = target_text.find(b_text, start_pos)
        fisrt_pos_diff = target_text[:fisrt_pos].count(" ")
        fisrt_xor_diff = b[0] ^ a[fisrt_pos_diff]
        print(fisrt_pos_diff, fisrt_xor_diff)
        if target_text.find(b_text, fisrt_pos+1) >= 0:
            second_pos = target_text.find(b_text, fisrt_pos+1)
            second_pos_diff = target_text[:second_pos].count(" ")
            if second_pos_diff < len(a):
                second_xor_diff = b[0] ^ a[second_pos_diff]
                print(second_pos_diff, second_xor_diff)
                interval = (second_pos_diff - fisrt_pos_diff)
                remain = (n - second_pos_diff - 1) // (second_pos_diff - fisrt_pos_diff)
                for i in range(remain):
                    print(second_pos_diff + interval * (i + 1), [fisrt_xor_diff,second_xor_diff ][i % 2])

if __name__ == '__main__':
    main()
s = input()
k = int(input())

slist = list(s)
i = 0
count = 0
while slist[i] == "1":
    count += 1
    i += 1
    
if count >= k:
    print(1)
else:
    print(slist[i])

### FIXED CODE ###


s = input()
k = int(input())

slist = list(s)
i = 0
count = 0
while slist[i] == "1":
    count += 1
    i += 1
    if i >= len(slist):
        break
    
if count >= k:
    print(1)
else:
    print(slist[i])