S=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;
    elif i + 1 >= int(K) :
        print(1);
        break;

15c9c26992ae703d6165706e9fdb94a7fd44a8c6
<mask token>

<mask token>
for i in range(len(S)):
    if int(S[i]) > 1:
        print(S[i])
        break
    elif i + 1 >= int(K):
        print(1)
        break

S = input()
K = input()
i = 0
for i in range(len(S)):
    if int(S[i]) > 1:
        print(S[i])
        break
    elif i + 1 >= int(K):
        print(1)
        break

S=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;
    elif i + 1 >= int(K) :
        print(1);
        break;
