#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define sz(a) int((a).size())
#define all(a) (a).begin(), (a).end()
#define lsb(x) (x & (-x))
#define vi vector<int>
#define YES { cout << "YES" << endl; return; }
#define NO { cout << "NO" << endl; return; }
using ll = long long;
using pii = std::pair<int, int>;
using namespace std;
void solve_testcase() {
string s;
cin >> s;
cout << s[0] << '\n';
}
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--)
solve_testcase();
return 0;
}