#include <iostream> #include<cmath> using namespace std; int main() { string a,b,c; int d; cin>>a>>b>>d; c=a+b; cout<<c[d-1]; return 0; }