#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
char s[35];
int main(){
ull n,len,i;
scanf("%s%lld",s,&n);
len=strlen(s);
while(len<n){
i=len;
while(i<n)i*=2;
i/=2;
if(n==i+1)n--;
n=n-i-1;
}
printf("%c",s[n-1]);
return 0;
}
求调,ull改ll就是WA。