#include<bits/stdc++.h> using namespace std; int main() { int t,n; string s; cin>>t; while(t--) { cin>>n>>s; n=s.length()-1; cout<<s[n]<<endl; } return 0; }