#include <iostream>
#include <cstring>
using namespace std;
int main(void)
{
/*
char str[1001];
int i;
cin >> str;
cin >> i;
if (i >= 1 && i <= strlen(str))
{
cout << str[i - 1] << endl;
}
else
{
;
}
return 0;
*/
char temp[1000];
char* str = nullptr;
int i;
cin >> temp;
str = new char[strlen(temp) + 1];
strcpy_s(str, strlen(temp) + 1, temp);
cin >> i;
cout << str[i - 1] << endl;
return 0;
delete[] str;
}