#include<bits/stdc++.h> using namespace std; string s,c,sc=""; int a; int main(){ cin>>s>>c; sc=s+c; scanf("%d",&a); cout<<sc[a-1]; return 0; }